/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #0d0d0d;
  color: #e0e0e0;
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: #7eb8da;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Layout: Landing Page ── */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.landing {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
}

.landing h1 {
  font-size: 2.5rem;
  color: #fff;
  margin-bottom: 0.25rem;
}

.tagline {
  font-size: 1.1rem;
  color: #888;
  margin-bottom: 3rem;
}

.projects h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #666;
  margin-bottom: 0.75rem;
}

.projects ul {
  list-style: none;
}

.projects li {
  padding: 0.5rem 0;
  font-size: 1.05rem;
}

/* ── Layout: Concert Tracker (sidebar + main) ── */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: 220px;
  background: #111;
  border-right: 1px solid #2a2a2a;
  padding: 1.25rem 0.75rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-heading {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #666;
  margin-bottom: 0.75rem;
  padding: 0 0.25rem;
}

.sidebar-divider {
  border: none;
  border-top: 1px solid #2a2a2a;
  margin: 0.75rem 0;
}

.search-hint {
  font-size: 0.75rem;
  color: #555;
  padding: 0 0.25rem;
}

/* ── Sidebar: Search ── */
.artist-search-wrapper {
  position: relative;
  margin-bottom: 0.5rem;
}

.artist-search {
  width: 100%;
  padding: 0.45rem 0.5rem;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 0.85rem;
  outline: none;
}

.artist-search:focus {
  border-color: #7eb8da;
}

.artist-search::placeholder {
  color: #555;
}

.search-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 0 0 6px 6px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 10;
}

.search-results.visible {
  display: block;
}

.search-result-item {
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-result-item:hover {
  background: #252525;
}

.search-result-item.already-tracked {
  color: #666;
  cursor: default;
}

.tracked-badge {
  font-size: 0.7rem;
  color: #555;
  margin-left: 0.5rem;
}

.search-no-results {
  padding: 0.45rem 0.6rem;
  color: #666;
  font-size: 0.85rem;
}

/* ── Sidebar: Artist Chips ── */
.tracked-artists {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.artist-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #1e2a35;
  border: 1px solid #2a3a4a;
  color: #7eb8da;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.8rem;
}

.chip-remove {
  background: none;
  border: none;
  color: #5a8aa8;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0;
}

.chip-remove:hover {
  color: #e06060;
}

/* ── Sidebar: Location ── */
.location-wrapper {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.location-wrapper .artist-search {
  flex: 1;
}

.location-set-btn {
  background: #1e2a35;
  border: 1px solid #2a3a4a;
  color: #7eb8da;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  flex-shrink: 0;
}

.location-set-btn:hover {
  background: #2a3a4a;
}

.location-current {
  font-size: 0.75rem;
  color: #888;
  padding: 0 0.25rem;
  min-height: 1.2em;
}

/* ── Sidebar: Radius Slider ── */
.radius-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.25rem;
}

.radius-wrapper input[type="range"] {
  flex: 1;
  accent-color: #7eb8da;
}

.radius-value {
  font-size: 0.85rem;
  color: #7eb8da;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Sidebar: Overlay (sign-in gate) ── */
.sidebar-controls {
  position: relative;
  flex: 1;
}

.sidebar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.75);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  z-index: 5;
  pointer-events: all;
  border-radius: 6px;
}

.sidebar-overlay p {
  color: #7eb8da;
  font-size: 0.9rem;
  line-height: 1.5;
}

.sidebar-overlay.hidden {
  display: none;
}

/* ── Sign-in Modal ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-backdrop.hidden {
  display: none;
}

.modal {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 1.75rem;
  max-width: 360px;
  text-align: center;
}

.modal p {
  font-size: 0.95rem;
  color: #ccc;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.modal-btn {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
}

.modal-btn-primary {
  background: #1e2a35;
  border: 1px solid #2a3a4a;
  color: #7eb8da;
}

.modal-btn-primary:hover {
  background: #2a3a4a;
}

.modal-btn-secondary {
  background: transparent;
  color: #666;
}

.modal-btn-secondary:hover {
  color: #888;
}

/* ── Main Content ── */
.main-content {
  flex: 1;
  padding: 2rem;
}

/* ── Concert Tracker: Header ── */
header {
  margin-bottom: 2rem;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.back-link {
  display: inline-block;
  font-size: 0.9rem;
  color: #888;
}

.back-link:hover {
  color: #7eb8da;
}

/* ── Auth ── */
.auth-container {
  display: flex;
  align-items: center;
}

.auth-btn {
  background: #1e2a35;
  border: 1px solid #2a3a4a;
  color: #7eb8da;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.auth-btn:hover {
  background: #2a3a4a;
}

.auth-btn-small {
  padding: 0.3rem 0.5rem;
  font-size: 0.75rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.user-name {
  font-size: 0.8rem;
  color: #ccc;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Email Opt-In ── */
.email-optin-wrapper {
  padding: 0 0.25rem;
}

.email-optin-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #aaa;
  cursor: pointer;
}

.email-optin-label input[type="checkbox"] {
  accent-color: #7eb8da;
}

header h1 {
  font-size: 2rem;
  color: #fff;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: #888;
}

/* ── Event Cards ── */
.artist-section {
  margin-bottom: 2.5rem;
}

.artist-section h2 {
  font-size: 1.3rem;
  color: #fff;
  border-bottom: 1px solid #2a2a2a;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.event-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  transition: border-color 0.2s;
}

.event-card:hover {
  border-color: #7eb8da;
}

.event-date {
  font-size: 0.85rem;
  color: #7eb8da;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.event-venue {
  font-size: 1.05rem;
  color: #fff;
}

.event-location {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 0.5rem;
}

.event-link {
  font-size: 0.85rem;
  font-weight: 600;
}

/* ── States ── */
.loading {
  color: #888;
  text-align: center;
  padding: 3rem 0;
}

.no-events {
  color: #666;
  font-style: italic;
}

.error-message {
  color: #e06060;
  background: #1a1a1a;
  border: 1px solid #3a2020;
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

/* ── Footer ── */
footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #2a2a2a;
  font-size: 0.85rem;
  color: #666;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid #2a2a2a;
    padding: 1rem;
  }

  .main-content {
    padding: 1.5rem 1rem;
  }

  .landing h1 {
    font-size: 2rem;
  }

  header h1 {
    font-size: 1.6rem;
  }

  .container {
    padding: 2rem 1rem;
  }
}
