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

:root {
  --bg:        #0d0d0f;
  --surface:   #18181c;
  --surface2:  #22222a;
  --border:    #2e2e38;
  --accent:    #1db954;   /* Spotify green */
  --accent2:   #ff0000;   /* YouTube red */
  --text:      #e8e8f0;
  --muted:     #888899;
  --gold:      #f5c518;
  --radius:    12px;
  --font:      'Inter', system-ui, sans-serif;
  --font-head: 'Space Grotesk', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── Header ── */
header {
  background: linear-gradient(180deg, #12121a 0%, #0d0d0f 100%);
  border-bottom: 1px solid var(--border);
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
}

.header-inner { max-width: 900px; margin: 0 auto; }

.logo {
  font-family: var(--font-head);
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
  margin: 0 0 0.5rem;  /* reset h1 browser default, keep bottom gap */
}
.logo-sf    { color: var(--accent); }
.logo-list  { color: var(--text); }
.logo-music { color: var(--muted); }

.tagline {
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.updated-note {
  font-size: 0.75rem;
  color: #555566;
}

/* ── Nav ── */
.view-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(13,13,15,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  max-width: 100%;
}

.nav-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: var(--font);
  transition: all 0.15s;
  white-space: nowrap;
}
.nav-btn:hover  { border-color: var(--accent); color: var(--accent); }
.nav-btn.active { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 600; }

.search-wrap { margin-left: auto; }

#search {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-family: var(--font);
  width: min(240px, 40vw);
  outline: none;
  transition: border-color 0.15s;
}
#search:focus { border-color: var(--accent); }
#search::placeholder { color: var(--muted); }

/* ── Main ── */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
}

/* ── Loading ── */
.loading-state {
  text-align: center;
  padding: 4rem 0;
  color: var(--muted);
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Week day selector / All-shows week selector ── */
#week-day-selector,
#all-week-selector {
  display: none;
  position: sticky;
  top: 53px;
  z-index: 9;
  background: rgba(13,13,15,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 1.5rem;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
}
#week-day-selector::-webkit-scrollbar,
#all-week-selector::-webkit-scrollbar { display: none; }
#week-day-selector.active,
#all-week-selector.active { display: flex; }

.week-day-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.82rem;
  font-family: var(--font);
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
}
.week-day-btn:hover { border-color: var(--accent); color: var(--accent); }
.week-day-btn.active { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 600; }
.week-day-btn:disabled { opacity: 0.3; cursor: default; pointer-events: none; }

/* ── Date group ── */
.date-group { margin-bottom: 2.5rem; }

.date-header {
  position: sticky;
  top: 53px;             /* slot below the .view-nav */
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
/* When a sub-nav selector bar is visible, date headers sit below it */
body.week-view .date-header,
body.all-view  .date-header { top: 101px; }

/* fade just under the sticky header so cards aren't visible peeking through */
.date-header::before {
  content: '';
  position: absolute;
  inset: 0 -1.5rem;
  background: var(--bg);
  z-index: -1;
}

.date-day {
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

.date-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.date-today-badge {
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--accent);
  color: #000;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Show card ── */
.show-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.75rem;
  transition: border-color 0.15s, transform 0.1s;
}
.show-card:hover {
  border-color: #3e3e50;
  transform: translateY(-1px);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.bands-list {
  flex: 1;
  min-width: 0;
}

.band-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
  padding: 0.15rem 0;
}
.band-item:last-child { margin-bottom: 0.4rem; }
.band-item .band-name { flex: 1; min-width: 0; }

.band-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.music-btns {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.btn-spotify, .btn-youtube {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.btn-spotify { background: var(--accent); color: #000; }
.btn-youtube { background: var(--accent2); color: #fff; }
.btn-spotify:hover, .btn-youtube:hover { opacity: 0.85; }

.btn-spotify svg, .btn-youtube svg { width: 12px; height: 12px; flex-shrink: 0; }

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  margin-top: 0.8rem;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
}

.venue-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.venue-link:hover { color: var(--accent); }
.venue-icon {
  width: 13px;
  height: 13px;
  color: var(--accent);
  flex-shrink: 0;
}

.meta-pill {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
}
.pill-age   { color: #a78bfa; border-color: #3d2f6e; background: #1c1333; }
.pill-price { color: var(--gold); border-color: #4a3900; background: #1f1600; }
.pill-time  { color: #67e8f9; border-color: #0e4a54; background: #071c20; }
.pill-note  { color: #f87171; border-color: #5a1f1f; background: #200a0a; }

.symbols {
  display: flex;
  gap: 0.25rem;
}
.symbol {
  font-size: 0.8rem;
  cursor: help;
  color: var(--gold);
}

.card-buy { margin-left: auto; }

.btn-buy {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--gold);
  color: #1a1300;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn-buy:hover { opacity: 0.88; transform: translateY(-1px); }

/* Highlight a show card briefly after navigating from the map */
.show-card.highlight {
  animation: card-flash 5s ease-out;
}
@keyframes card-flash {
  0%   { box-shadow: 0 0 0 2px var(--accent), 0 0 24px rgba(29,185,84,0.6); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* Clickable venue title in map popup */
.popup-venue-link {
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.popup-venue-link:hover { text-decoration: underline; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 4rem 0;
  color: var(--muted);
}
.empty-state h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }

/* ── Month divider ── */
.month-divider {
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 2rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.month-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Map view ── */
#map-view {
  display: none;
  height: calc(100vh - 130px);  /* full remaining viewport under header+nav */
  width: 100%;
  position: relative;
}
#map-view.active { display: block; }

#map-day-nav {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(13,13,15,0.88);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 0.45rem 0.9rem;
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.map-day-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}
.map-day-btn:hover { border-color: var(--accent); color: var(--accent); }
.map-day-btn:disabled { opacity: 0.3; cursor: default; }
.map-day-btn:disabled:hover { border-color: var(--border); color: var(--muted); }

#map-day-label {
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  min-width: 180px;
  text-align: center;
}

.venue-dot {
  width: 14px !important;
  height: 14px !important;
  background: var(--accent);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(29,185,84,0.7);
}

/* Dark Leaflet popup — !important to win over Leaflet's stylesheet */
.leaflet-popup-content-wrapper {
  background: #18181c !important;
  color: #e8e8f0 !important;
  border: 1px solid #2e2e38 !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6) !important;
}
.leaflet-popup-tip {
  background: #18181c !important;
  border: 1px solid #2e2e38 !important;
}
.leaflet-popup-close-button {
  color: #888899 !important;
  font-size: 22px !important;
  padding: 4px 8px 0 0 !important;
}
.leaflet-popup-close-button:hover { color: #fff !important; }
.leaflet-popup-content { margin: 0.85rem 1.1rem !important; color: #e8e8f0 !important; }
.popup-venue {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #1db954;
  margin-bottom: 0.5rem;
}
.popup-band {
  font-size: 0.85rem;
  color: #ffffff;
  font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 1px solid #2e2e38;
}
.popup-band:last-of-type { border-bottom: none; }
.popup-meta {
  font-size: 0.75rem;
  color: #b0b0c0;
  margin-top: 0.5rem;
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: #44445a;
  line-height: 1.8;
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); }

/* ── Venue view ── */

/* Extra right padding so cards don't hide under the A-Z strip */
body.venue-view main { padding-right: 2.5rem; }

.venue-cards { display: flex; flex-direction: column; gap: 0.75rem; }

.venue-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.venue-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.venue-card-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.venue-card-body {
  padding: 0.85rem 1.25rem 1rem;
}

.venue-date-group { margin-bottom: 1rem; }
.venue-date-group:last-child { margin-bottom: 0; }

.venue-date-label {
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── Side A-Z strip ── */
.venue-az-side {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: none;           /* shown only in venue view via body.venue-view */
  flex-direction: column;
  align-items: center;
  background: rgba(18,18,28,0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 2px;
  gap: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
body.venue-view .venue-az-side { display: flex; }

.venue-az-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 700;
  font-family: var(--font);
  line-height: 1;
  padding: 3px 6px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.1s, color 0.1s;
  width: 22px;
  text-align: center;
}
.venue-az-btn:hover { background: var(--surface2); color: var(--accent); }
.venue-az-btn.inactive { opacity: 0.2; cursor: default; pointer-events: none; }

/* ── Band name link ── */
.band-link {
  cursor: pointer;
  transition: color 0.15s;
}
.band-link:hover { color: var(--accent); }

/* ── Artist panel ── */
.panel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  backdrop-filter: blur(2px);
}
.panel-overlay.open { display: block; }

.artist-panel {
  position: fixed;
  top: 0;
  right: -520px;
  width: min(480px, 100vw);
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 201;
  overflow-y: auto;
  transition: right 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -6px 0 32px rgba(0,0,0,0.5);
  padding: 1.5rem 1.75rem 3rem;
}
.artist-panel.open { right: 0; }

.panel-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.panel-close:hover { border-color: var(--text); color: var(--text); }

.panel-band-name {
  font-family: var(--font-head);
  font-size: clamp(1.4rem, 5vw, 2rem);
  font-weight: 700;
  color: var(--text);
  margin: 0.25rem 0 1rem;
  padding-right: 2.5rem;
  line-height: 1.2;
}

.panel-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.panel-section {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.panel-section-title {
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.9rem;
}

.panel-show-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.panel-show-row:last-child { border-bottom: none; }
.panel-show-date {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.panel-show-venue {
  color: var(--muted);
  font-size: 0.82rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.panel-no-shows { color: var(--muted); font-size: 0.88rem; }

.panel-subscribe-desc {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0.9rem;
  line-height: 1.5;
}
.panel-subscribe-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.panel-email-input {
  flex: 1;
  min-width: 180px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}
.panel-email-input:focus { border-color: var(--accent); }
.panel-email-input::placeholder { color: var(--muted); }

.btn-panel-subscribe {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.btn-panel-subscribe:hover { opacity: 0.85; }
.btn-panel-subscribe:disabled { opacity: 0.5; cursor: default; }

.panel-subscribe-status {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  min-height: 1.2em;
}
.panel-subscribe-status.success { color: var(--accent); }
.panel-subscribe-status.error   { color: #f87171; }

/* ── Subscribed confirmation banner ── */
.subscribed-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  background: var(--accent);
  color: #000;
  padding: 0.7rem 1.25rem;
  border-radius: 24px;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  white-space: nowrap;
}
.banner-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #000;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .view-nav { flex-wrap: wrap; }
  .search-wrap { width: 100%; margin-left: 0; }
  #search { width: 100%; }
  .card-top { flex-direction: column; }
}
