/* ══════════════════════════════════════════════════════════════
   GROOVY SHOW GROUPIES — STYLES
   ══════════════════════════════════════════════════════════════ */

/* ── Variables ── */
:root {
  --bg:           #09090f;
  --surface:      #111120;
  --card:         #161626;
  --card-hover:   #1c1c30;
  --border:       #252538;
  --border-light: #2e2e48;

  --accent:       #8b5cf6;
  --accent-glow:  rgba(139,92,246,.25);
  --hot:          #ec4899;
  --warm:         #f97316;
  --green:        #22c55e;
  --red:          #ef4444;
  --teal:         #14b8a6;

  /* Source colors */
  --tm-color:     #026cdf;   /* Ticketmaster blue   */
  --sg-color:     #e8475f;   /* SeatGeek red-pink   */
  --sh-color:     #00a651;   /* StubHub green       */
  --bit-color:    #00b4b3;   /* Bandsintown teal    */
  --sk-color:     #f50;      /* Songkick orange-red  */
  --serp-color:   #4285f4;   /* Google blue          */
  --local-color:  #22c55e;   /* Local venues green   */
  --fb-color:     #1877f2;   /* Facebook blue        */

  --text:         #f1f0fa;
  --text-muted:   #94a3b8;
  --text-dim:     #64748b;

  --radius-card:  12px;
  --radius-sm:    8px;
  --radius-pill:  999px;

  --shadow-card:  0 4px 24px rgba(0,0,0,.4);
  --shadow-float: 0 8px 40px rgba(0,0,0,.6);

  --transition:   0.18s ease;
  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;

  --header-h:     72px;
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  /* Allow normal scrolling on all devices */
  overflow-y: auto;
  overscroll-behavior-y: auto;
}
/* Only lock scroll on mobile when a bottom-sheet popup is open */
@media (max-width: 480px) {
  body.popup-open { overflow: hidden; }
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--hot); }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ── Source dots ── */
.source-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.source-dot.source-tm  { background: var(--tm-color);  }
.source-dot.source-sg  { background: var(--sg-color);  }
.source-dot.source-sh  { background: var(--sh-color);  }
.source-dot.source-bit { background: var(--bit-color); }
.source-dot.source-sk    { background: var(--sk-color);    }
.source-dot.source-serp  { background: var(--serp-color);  }
.source-dot.source-local { background: var(--local-color); }
.source-dot.source-fb    { background: var(--fb-color);    }

/* ── Buttons ── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  background: var(--accent); color: #fff;
  border-radius: var(--radius-pill);
  font-family: var(--font-heading); font-weight: 600; font-size: 14px; letter-spacing: .02em;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn-primary:hover { background: #7c3aed; transform: translateY(-1px); box-shadow: 0 4px 16px var(--accent-glow); }
.btn-primary:active { transform: translateY(0); }
.btn-large { padding: 14px 32px; font-size: 16px; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  background: var(--border); color: var(--text);
  border-radius: var(--radius-pill);
  font-weight: 500; font-size: 14px;
  transition: background var(--transition);
}
.btn-secondary:hover { background: var(--border-light); }

.btn-ghost {
  padding: 8px 16px;
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  font-size: 14px;
  transition: color var(--transition), background var(--transition);
}
.btn-ghost:hover { color: var(--text); background: var(--border); }

/* ══════════════════════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(9,9,15,.95);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 24px;
}
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 20px; padding: 48px 40px;
  max-width: 520px; width: 100%;
  box-shadow: var(--shadow-float); text-align: center;
  animation: modalIn .3s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 24px; }
.modal-emoji { font-size: 36px; }
.modal-app-name {
  font-family: var(--font-heading); font-size: 28px; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--hot));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.modal-heading { font-family: var(--font-heading); font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.modal-body { color: var(--text-muted); font-size: 15px; line-height: 1.7; margin-bottom: 24px; }
.modal-steps {
  text-align: left; display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 28px; padding: 20px;
  background: rgba(255,255,255,.03); border-radius: var(--radius-card); border: 1px solid var(--border);
}
.modal-step { display: flex; gap: 14px; font-size: 14px; color: var(--text-muted); align-items: flex-start; }
.step-num {
  flex-shrink: 0; width: 24px; height: 24px;
  background: var(--accent); color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; font-family: var(--font-heading);
}
.modal-link { color: var(--accent); font-weight: 500; }
.modal-link:hover { color: var(--hot); }
.modal-input-row { margin-bottom: 16px; }
.modal-input {
  width: 100%; padding: 14px 18px;
  background: var(--bg); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font-body); font-size: 14px;
  outline: none; transition: border-color var(--transition);
}
.modal-input:focus { border-color: var(--accent); }
.modal-input::placeholder { color: var(--text-dim); }
.modal-disclaimer { margin-top: 16px; font-size: 12px; color: var(--text-dim); }

/* ══════════════════════════════════════════════════════════════
   SETTINGS PANEL
══════════════════════════════════════════════════════════════ */
.settings-panel {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: var(--header-h); z-index: 90;
  animation: slideDown .2s ease;
}
.settings-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 20px 24px;
}
.settings-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.settings-title {
  font-family: var(--font-heading); font-size: 16px; font-weight: 700;
}
.settings-close { padding: 4px 12px; font-size: 16px; }
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.settings-source {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.settings-source-head {
  display: flex; align-items: flex-start; gap: 10px;
}
.settings-source-head > div {
  flex: 1; display: flex; flex-direction: column; gap: 2px;
}
.settings-source-desc { font-size: 12px; color: var(--text-dim); }
.settings-source-status {
  font-size: 11px; font-weight: 600; color: var(--text-dim);
  padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--border); white-space: nowrap;
}
.settings-source-status.active-green { color: var(--green); background: rgba(34,197,94,.1); }
.settings-source-status.active-blue { color: #60a5fa; background: rgba(96,165,250,.1); }
.settings-input-row { display: flex; gap: 8px; }
.settings-input {
  flex: 1; padding: 9px 12px;
  background: var(--bg); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font-body); font-size: 13px;
  outline: none; transition: border-color var(--transition);
}
.settings-input:focus { border-color: var(--accent); }
.settings-input::placeholder { color: var(--text-dim); }
.settings-save-btn { padding: 9px 14px; font-size: 13px; white-space: nowrap; }
.settings-note { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.settings-note a { color: var(--text-dim); text-decoration: underline; text-underline-offset: 2px; }
.settings-note a:hover { color: var(--accent); }

/* ══════════════════════════════════════════════════════════════
   HEADER
══════════════════════════════════════════════════════════════ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-h);
  background: rgba(9,9,15,.92);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.header-container {
  max-width: 1280px; margin: 0 auto; padding: 0 24px;
  min-height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; flex-shrink: 0;
}
.brand-icon { font-size: 28px; }
.brand-info { display: flex; flex-direction: column; }
.brand-name {
  font-family: var(--font-heading); font-size: 18px; font-weight: 800;
  background: linear-gradient(135deg, #a78bfa, var(--hot));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  line-height: 1.2;
}
.brand-sub { font-size: 11px; color: var(--text-dim); line-height: 1; }
.header-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }

.location-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius-pill); color: var(--text);
  font-size: 14px; font-weight: 500;
  transition: background var(--transition), border-color var(--transition);
  max-width: 240px;
}
.location-btn:hover { background: var(--card-hover); border-color: var(--accent); }
.location-pin { font-size: 16px; flex-shrink: 0; }
.location-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.location-edit { font-size: 11px; color: var(--text-dim); flex-shrink: 0; }

.radius-widget {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
}
.radius-step-btn {
  width: 26px; height: 26px; background: var(--border); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1; color: var(--text);
  transition: background var(--transition); flex-shrink: 0;
}
.radius-step-btn:hover { background: var(--accent); }
.radius-center { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.radius-value-row { display: flex; align-items: baseline; gap: 3px; }
.radius-value { font-family: var(--font-heading); font-size: 18px; font-weight: 700; line-height: 1; min-width: 28px; text-align: center; }
.radius-unit { font-size: 11px; color: var(--text-dim); }
.radius-slider {
  -webkit-appearance: none; appearance: none;
  width: 80px; height: 3px;
  background: var(--border-light); border-radius: 2px; outline: none;
}
.radius-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px;
  border-radius: 50%; background: var(--accent); cursor: pointer;
  transition: background var(--transition);
}
.radius-slider::-webkit-slider-thumb:hover { background: var(--hot); }
.radius-slider::-moz-range-thumb {
  width: 14px; height: 14px; border: none;
  border-radius: 50%; background: var(--accent); cursor: pointer;
}

.find-location-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.find-location-btn:hover { background: var(--card-hover); color: var(--text); border-color: var(--accent); }

.settings-btn {
  width: 36px; height: 36px;
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-muted);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
.settings-btn:hover { background: var(--card-hover); color: var(--text); border-color: var(--accent); }
.settings-btn.active { color: var(--accent); border-color: var(--accent); background: var(--accent-glow); }

/* ══════════════════════════════════════════════════════════════
   LOCATION SEARCH PANEL
══════════════════════════════════════════════════════════════ */
.location-panel {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 16px 24px; animation: slideDown .2s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.location-panel-inner {
  max-width: 640px; margin: 0 auto;
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.location-search-input {
  flex: 1 1 260px; padding: 10px 16px;
  background: var(--bg); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font-body); font-size: 14px;
  outline: none; transition: border-color var(--transition);
}
.location-search-input:focus { border-color: var(--accent); }
.location-search-input::placeholder { color: var(--text-dim); }
.location-panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ══════════════════════════════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════════════════════════════ */
.main {
  max-width: 1280px; margin: 0 auto;
  padding: 24px 24px 48px;
  min-height: calc(100vh - var(--header-h) - 60px);
  min-height: calc(100dvh - var(--header-h) - 60px);
}

/* Source bar */
.source-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  padding: 12px 0 20px;
  border-bottom: 1px solid var(--border); margin-bottom: 24px;
}
.source-stats { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.source-stat {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted);
}
.source-stat-count { font-family: var(--font-heading); font-weight: 700; color: var(--text); }
.source-stat-loading { color: var(--text-dim); font-style: italic; }
.results-meta { display: flex; align-items: center; gap: 12px; }
.last-updated { font-size: 12px; color: var(--text-dim); }
.refresh-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; background: var(--border);
  border-radius: var(--radius-pill); font-size: 13px; color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.refresh-btn:hover { background: var(--border-light); color: var(--text); }
.refresh-icon { display: inline-block; font-size: 16px; }
.refresh-btn.spinning .refresh-icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Genre filter bar ── */
.genre-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.genre-bar::-webkit-scrollbar { display: none; }

.genre-bar-inner {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 10px 24px;
  /* Ensure Tonight button is always the leftmost visible item */
  /* min-width forces left-align when content overflows */
}
.tonight-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  color: #f97316;
  background: rgba(249,115,22,.12);
  border: 1px solid rgba(249,115,22,.35);
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--transition), box-shadow var(--transition);
}
.tonight-btn:hover  { background: rgba(249,115,22,.22); }
.tonight-btn.active {
  background: #f97316;
  color: #fff;
  border-color: #f97316;
  box-shadow: 0 0 12px rgba(249,115,22,.45);
}

/* ── Pick-a-date widget ── */
.date-widget {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  flex-shrink: 0;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.date-widget.active {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.date-widget-icon {
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.date-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  color-scheme: dark;
  cursor: pointer;
  min-width: 116px;
}
.date-input::-webkit-calendar-picker-indicator {
  filter: invert(.7);
  cursor: pointer;
}
.date-clear {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
.date-clear:hover { background: var(--accent); color: #fff; }

.genre-bar-divider {
  width: 1px;
  background: var(--border-light);
  align-self: stretch;
  margin: 2px 4px;
  flex-shrink: 0;
}

.genre-btn {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--border);
  border: 1px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.genre-btn:hover { background: var(--border-light); color: var(--text); }
.genre-btn.active {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: var(--accent);
}

/* ── Loading ── */
.loading-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 20px; padding: 80px 24px;
}
.equalizer { display: flex; align-items: flex-end; gap: 5px; height: 48px; }
.eq-bar {
  width: 6px;
  background: linear-gradient(to top, var(--accent), var(--hot));
  border-radius: 3px; animation: eqBounce 1.2s ease-in-out infinite;
}
.eq-bar:nth-child(1) { animation-delay: 0s;    height: 60%; }
.eq-bar:nth-child(2) { animation-delay: .1s;   height: 80%; }
.eq-bar:nth-child(3) { animation-delay: .2s;   height: 40%; }
.eq-bar:nth-child(4) { animation-delay: .3s;   height: 100%; }
.eq-bar:nth-child(5) { animation-delay: .1s;   height: 60%; }
.eq-bar:nth-child(6) { animation-delay: .25s;  height: 90%; }
.eq-bar:nth-child(7) { animation-delay: .15s;  height: 50%; }
@keyframes eqBounce {
  0%, 100% { transform: scaleY(1); }
  50%       { transform: scaleY(.2); }
}
.loading-msg { color: var(--text-muted); font-size: 16px; font-weight: 500; }
.loading-countdown { font-size: 13px; color: var(--text-dim); font-variant-numeric: tabular-nums; min-height: 20px; }
.loading-sources {
  display: flex; gap: 16px; flex-wrap: wrap; justify-content: center;
}
.loading-source-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-dim);
}
.loading-source-item.done { color: var(--green); }
.loading-source-item.fail { color: var(--red); }

/* ── Error ── */
.error-state {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 80px 24px; text-align: center;
}
.error-emoji { font-size: 48px; }
.error-title { font-family: var(--font-heading); font-size: 22px; font-weight: 700; }
.error-detail { color: var(--text-muted); font-size: 14px; max-width: 480px; }
.error-actions { display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }

/* ── No results ── */
.no-results-state {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; padding: 80px 24px; text-align: center;
}
.no-results-art { font-size: 64px; }
.no-results-state h2 { font-family: var(--font-heading); font-size: 24px; font-weight: 700; }
.no-results-state p { color: var(--text-muted); max-width: 440px; }
.no-results-hint { font-size: 14px; }

/* ══════════════════════════════════════════════════════════════
   EVENTS
══════════════════════════════════════════════════════════════ */
.events-container { display: flex; flex-direction: column; gap: 32px; }

.day-section { display: flex; flex-direction: column; gap: 16px; }

.day-header {
  position: sticky; top: var(--sticky-top-h, 120px); z-index: 50;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; background: var(--bg);
}
.day-label {
  font-family: var(--font-heading); font-size: 20px; font-weight: 700;
  background: linear-gradient(90deg, var(--accent), var(--hot));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.day-date { font-size: 13px; color: var(--text-dim); }
.day-count {
  margin-left: auto; font-size: 12px; color: var(--text-dim);
  padding: 3px 10px; background: var(--surface);
  border-radius: var(--radius-pill); border: 1px solid var(--border);
}
.day-divider { flex: 1; height: 1px; background: linear-gradient(to right, var(--border-light), transparent); }

.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

/* ══════════════════════════════════════════════════════════════
   EVENT CARD
══════════════════════════════════════════════════════════════ */
.event-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-card); overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: flex; flex-direction: column;
}
.event-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); border-color: var(--border-light); }

/* Source stripe on left edge */
.event-card.source-tm  { border-left: 3px solid var(--tm-color);  }
.event-card.source-sg  { border-left: 3px solid var(--sg-color);  }
.event-card.source-sh  { border-left: 3px solid var(--sh-color);  }
.event-card.source-bit { border-left: 3px solid var(--bit-color); }
.event-card.source-sk    { border-left: 3px solid var(--sk-color);    }
.event-card.source-serp  { border-left: 3px solid var(--serp-color);  }
.event-card.source-local { border-left: 3px solid var(--local-color); }
.event-card.source-fb    { border-left: 3px solid var(--fb-color);    }

.event-image-wrap {
  position: relative; width: 100%; aspect-ratio: 16/7;
  overflow: hidden; background: var(--surface);
}
.event-image { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; cursor: pointer; }
.event-image-placeholder { cursor: pointer; }
.event-card:hover .event-image { transform: scale(1.03); }
.event-image-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; background: linear-gradient(135deg, #1a1a2e, #2d1b4e);
}

/* Badges */
.event-badges {
  position: absolute; top: 10px; left: 10px;
  display: flex; gap: 6px; flex-wrap: wrap;
}
.badge {
  padding: 3px 9px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700;
  font-family: var(--font-heading); letter-spacing: .04em; text-transform: uppercase;
}
.badge-onsale    { background: var(--green);  color: #fff; }
.badge-soldout   { background: var(--red);    color: #fff; }
.badge-free      { background: var(--warm);   color: #fff; }
.badge-presale   { background: var(--accent); color: #fff; }
.badge-cancelled { background: var(--border); color: var(--text-muted); }

.source-badge {
  position: absolute; top: 10px; right: 10px;
  display: flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  background: rgba(9,9,15,.8); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; color: var(--text-muted);
  border: 1px solid var(--border-light);
}

.distance-badge {
  padding: 3px 8px;
  background: rgba(9,9,15,.8); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; color: var(--text);
}

.event-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; }

.event-artists { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.artist-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-heading); font-size: 16px; font-weight: 700;
  color: var(--text); text-decoration: none;
  transition: color var(--transition); line-height: 1.3;
}
.artist-link:hover { color: var(--hot); }
.artist-link .yt-icon { font-size: 12px; opacity: .5; transition: opacity var(--transition); }
.artist-link:hover .yt-icon { opacity: 1; }
.artist-sep { color: var(--text-dim); font-size: 13px; padding: 0 2px; }

.genre-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.genre-tag {
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition);
  background: rgba(139,92,246,.15);
  color: var(--accent);
  border: 1px solid rgba(139,92,246,.3);
}
.genre-tag:hover { opacity: .8; }
.genre-tag[data-genre="jam"]        { background: rgba(249,115,22,.12);  color: #f97316; border-color: rgba(249,115,22,.3); }
.genre-tag[data-genre="jazz"]       { background: rgba(20,184,166,.12);  color: var(--teal); border-color: rgba(20,184,166,.3); }
.genre-tag[data-genre="blues"]      { background: rgba(96,165,250,.12);  color: #60a5fa; border-color: rgba(96,165,250,.3); }
.genre-tag[data-genre="funk"]       { background: rgba(236,72,153,.12);  color: var(--hot); border-color: rgba(236,72,153,.3); }
.genre-tag[data-genre="rock"]       { background: rgba(239,68,68,.12);   color: #ef4444; border-color: rgba(239,68,68,.3); }
.genre-tag[data-genre="country"]    { background: rgba(234,179,8,.12);   color: #eab308; border-color: rgba(234,179,8,.3); }
.genre-tag[data-genre="electronic"] { background: rgba(139,92,246,.12);  color: var(--accent); border-color: rgba(139,92,246,.3); }

.artist-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.55;
  font-style: italic;
  margin-top: 2px;
}

.event-time-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.event-time { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.time-icon { font-size: 14px; color: var(--text-dim); }
.show-time { font-weight: 600; color: var(--accent); font-family: var(--font-heading); }
.doors-time { color: var(--text-dim); font-size: 12px; }

.venue-block {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px;
  background: var(--surface); border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.venue-info-row {
  display: flex; align-items: flex-start; gap: 6px;
  font-size: 12px; color: var(--text-muted); line-height: 1.5;
}
.vinfo-icon { font-size: 12px; flex-shrink: 0; margin-top: 1px; }
.vinfo-text { flex: 1; }
.venue-desc-text {
  font-size: 12px; color: var(--text-dim);
  line-height: 1.55;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  margin-top: 2px;
}

/* Action buttons row */
.event-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px 16px;
  background: rgba(0,0,0,.2);
  border-top: 1px solid var(--border);
}
.action-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px;
  background: var(--border); color: var(--text-muted);
  border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.action-btn:hover { background: var(--border-light); color: var(--text); }
.action-btn-setlist {
  background: rgba(255,140,0,.12);
  color: #ff8c00;
  border: 1px solid rgba(255,140,0,.3);
}
.action-btn-setlist:hover { background: rgba(255,140,0,.22); color: #ff8c00; }

.action-btn-ticket {
  background: linear-gradient(135deg, var(--accent), var(--hot));
  color: #fff;
}
.action-btn-ticket:hover { opacity: .9; color: #fff; }

.event-price {
  font-size: 13px; color: var(--text-muted);
  display: flex; align-items: center; gap: 5px;
}
.price-value { font-weight: 600; color: var(--warm); font-family: var(--font-heading); }

.event-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  background: rgba(0,0,0,.2);
}
.ticket-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px;
  background: linear-gradient(135deg, var(--accent), var(--hot));
  color: #fff; border-radius: var(--radius-pill);
  font-weight: 600; font-family: var(--font-heading); font-size: 13px; letter-spacing: .02em;
  transition: opacity var(--transition), transform var(--transition);
  text-decoration: none;
}
.ticket-btn:hover { opacity: .9; transform: translateY(-1px); color: #fff; }

.venue-details-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 8px;
  font-size: 12px; color: var(--text-dim);
  transition: color var(--transition), background var(--transition);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.venue-details-btn:hover { color: var(--text-muted); background: rgba(255,255,255,.03); }
.venue-details-arrow { transition: transform var(--transition); }
.venue-details-btn.open .venue-details-arrow { transform: rotate(180deg); }

.venue-details-panel {
  padding: 12px 16px 16px;
  background: rgba(0,0,0,.2); border-top: 1px solid var(--border);
  display: none; flex-direction: column; gap: 10px;
  animation: fadeIn .2s ease;
}
.venue-details-panel.open { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.venue-detail-row { display: flex; gap: 8px; font-size: 13px; line-height: 1.5; }
.venue-detail-label { font-weight: 600; color: var(--text-muted); flex-shrink: 0; min-width: 90px; }
.venue-detail-value { color: var(--text-muted); }
.venue-detail-loading { text-align: center; color: var(--text-dim); font-size: 13px; padding: 8px; }

/* ══════════════════════════════════════════════════════════════
   LOCAL LISTINGS
══════════════════════════════════════════════════════════════ */
.local-listings { margin-top: 40px; }

.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.listing-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.listing-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  border-color: var(--border-light);
  color: var(--text);
}

.listing-source {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
}

.listing-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

.listing-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.listing-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.listing-read-more {
  color: var(--accent);
  font-weight: 500;
}

/* ══════════════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════════════ */
.footer { border-top: 1px solid var(--border); background: var(--surface); padding: 18px 24px; }
.footer-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-dim);
}
.footer-inner a { color: var(--text-dim); }
.footer-inner a:hover { color: var(--accent); }
.footer-sep { opacity: .4; }
.footer-btn { color: var(--text-dim); font-size: 13px; transition: color var(--transition); }
.footer-btn:hover { color: var(--accent); }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .events-grid { grid-template-columns: 1fr; }
  .listings-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Mobile auto-hide banners ────────────────────────────────
   On mobile (≤680px) the header + genre bar switch to
   position:fixed and slide off-screen when scrolling down,
   then slide back when scrolling up.
   Desktop and tablet keep the current sticky behaviour.
──────────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .header {
    position: fixed;
    top: 0; left: 0; right: 0;
    transition: transform 0.3s ease;
  }
  .genre-bar {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    transition: transform 0.3s ease;
  }
  /* Slide both off the top when scrolled down */
  .header.banner-hidden  { transform: translateY(-100%); }
  .genre-bar.banner-hidden { transform: translateY(calc(-1 * var(--header-h) - 100%)); }
  /* Compensate for fixed positioning so content doesn't sit under the banners */
  .main { padding-top: calc(var(--sticky-top-h, 120px) + 12px); }
  .location-panel { top: var(--header-h); position: fixed; left: 0; right: 0; z-index: 95; }
}

@media (max-width: 680px) {
  /* Day headers scroll with content on mobile — no sticky locking */
  .day-header { position: relative; top: auto; }

  /* Header stacks into two rows — height measured by JS and set as --header-h */
  .header-container {
    flex-wrap: wrap;
    padding: 10px 16px;
    gap: 8px;
    row-gap: 8px;
  }
  .brand { flex: 1 1 auto; }
  .header-right {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }
  .brand-sub { display: none; }
  .brand-name { font-size: 15px; }
  .location-btn { flex: 1 1 auto; max-width: none; }
  .location-text { max-width: none; flex: 1; }
  .radius-slider { width: 56px; }
  .find-location-btn { padding: 8px 10px; font-size: 12px; }

  /* Genre bar: single row on mobile, starts from left so Tonight is always visible */
  .genre-bar-inner { flex-wrap: nowrap; justify-content: flex-start; padding: 8px 16px; }

  .main { padding-right: 12px; padding-left: 12px; padding-bottom: 40px; }
  /* padding-top is set by the mobile banner block above — do not override it here */
  .modal-card { padding: 28px 16px; }
  .source-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .source-stats { flex-wrap: wrap; gap: 10px; }

  /* Bigger touch targets for action buttons */
  .action-btn { padding: 10px 16px; font-size: 13px; }
  .genre-btn  { padding: 8px 14px; }
}

@media (max-width: 480px) {
  .radius-slider { display: none; }
  /* Keep find-location visible — replace text with icon only */
  .find-location-btn .find-location-text { display: none; }
  .settings-btn { display: none; }
  .listings-grid { grid-template-columns: 1fr; }

  /* Cards: stack action buttons vertically on very small screens */
  .event-actions { gap: 6px; }
  .action-btn { flex: 1 1 calc(50% - 6px); justify-content: center; }
}

/* ── iOS / Android touch improvements ── */
/* Prevent iOS zoom on input focus (requires font-size ≥ 16px) */
input, select, textarea { font-size: 16px !important; }
/* Remove tap highlight flash on Android/iOS */
* { -webkit-tap-highlight-color: transparent; }
/* Smooth momentum scrolling on iOS */
.main { -webkit-overflow-scrolling: touch; }
/* Prevent horizontal overflow on mobile */
/* overflow-x: hidden on body/html BREAKS position:sticky in Safari — do not use */
html, body { max-width: 100%; }

/* Safe-area insets for notched iPhones (iPhone X+) */
.header { padding-left:  env(safe-area-inset-left);
          padding-right: env(safe-area-inset-right); }
.footer { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
.genre-bar { padding-left:  max(0px, env(safe-area-inset-left));
             padding-right: max(0px, env(safe-area-inset-right)); }

/* ══════════════════════════════════════════════════════════════
   ARTIST PREVIEW POPUP
══════════════════════════════════════════════════════════════ */
.artist-popup {
  position: fixed;
  z-index: 2000;
  width: 260px;
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-float);
  overflow: hidden;
  animation: popupIn .15s ease;
}
@keyframes popupIn {
  from { opacity: 0; transform: translateY(6px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.artist-popup-close {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,.55); color: #fff;
  border-radius: 50%; width: 26px; height: 26px;
  font-size: 13px; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.artist-popup-close:hover { background: rgba(0,0,0,.8); }
.artist-popup-img {
  width: 100%; height: 140px; object-fit: cover; display: block;
}
.artist-popup-placeholder {
  width: 100%; height: 140px;
  background: linear-gradient(135deg, #1a1a2e, #2d1b4e);
  display: flex; align-items: center; justify-content: center;
  font-size: 52px;
}
.artist-popup-name {
  padding: 10px 14px 6px;
  font-family: var(--font-heading); font-size: 15px; font-weight: 700;
  color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.artist-popup-ytlink {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 14px; margin: 0 14px 14px;
  background: #ff0000; color: #fff;
  border-radius: var(--radius-pill);
  font-weight: 700; font-size: 13px; text-decoration: none;
  transition: opacity var(--transition);
}
.artist-popup-ytlink:hover { opacity: .85; color: #fff; }

/* Mobile: bottom sheet */
@media (max-width: 480px) {
  .artist-popup {
    position: fixed; bottom: 0; left: 0; right: 0; width: 100%;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    animation: popupUp .2s ease;
  }
  @keyframes popupUp {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .artist-popup-img { height: 180px; }
  .artist-popup-placeholder { height: 180px; }
}

/* ══════════════════════════════════════════════════════════════
   FEATURE 3 — SAVED SHOWS
══════════════════════════════════════════════════════════════ */
.saved-section {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.saved-section-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.saved-section-title {
  font-family: var(--font-heading); font-size: 20px; font-weight: 700;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.saved-section-count {
  font-size: 12px; color: var(--text-dim);
  padding: 3px 10px; background: var(--surface);
  border-radius: var(--radius-pill); border: 1px solid var(--border);
}

/* Star save button */
.action-btn-save {
  background: var(--border);
  color: var(--text-dim);
  font-size: 14px;
  padding: 7px 12px;
}
.action-btn-save.saved {
  color: #fbbf24;
  background: rgba(251,191,36,.15);
  border: 1px solid rgba(251,191,36,.35);
}
.action-btn-save:hover { background: var(--border-light); color: #fbbf24; }

/* ══════════════════════════════════════════════════════════════
   FEATURE 4 — SHOW TIME ALERTS
══════════════════════════════════════════════════════════════ */
.action-btn-alert {
  background: var(--border);
  color: var(--text-dim);
  font-size: 14px;
  padding: 7px 12px;
}
.action-btn-alert.alerted {
  color: #60a5fa;
  background: rgba(96,165,250,.15);
  border: 1px solid rgba(96,165,250,.35);
}
.action-btn-alert:hover { background: var(--border-light); color: #60a5fa; }

/* ══════════════════════════════════════════════════════════════
   FEATURE 5 — SOLD OUT OVERLAY
══════════════════════════════════════════════════════════════ */
.card-sold-out {
  opacity: 0.55;
  filter: grayscale(40%);
}
.sold-out-overlay {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.45);
  pointer-events: none;
}
.sold-out-overlay-text {
  font-family: var(--font-heading);
  font-size: 28px; font-weight: 800;
  color: var(--red);
  letter-spacing: .08em;
  text-shadow: 0 2px 12px rgba(0,0,0,.7);
  border: 3px solid var(--red);
  padding: 6px 18px;
  border-radius: 6px;
  background: rgba(9,9,15,.6);
}
.action-btn-ticket-soldout {
  background: var(--border) !important;
  color: var(--text-dim) !important;
  cursor: not-allowed !important;
  opacity: 0.7;
}

/* ══════════════════════════════════════════════════════════════
   FEATURE 6 — WEEKLY EVENTS SECTION
══════════════════════════════════════════════════════════════ */
#weekly-section {
  margin-top: 40px;
}
.weekly-section-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.weekly-section-title {
  font-family: var(--font-heading); font-size: 20px; font-weight: 700;
  color: var(--text);
}
.weekly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.weekly-card {
  background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius-card); padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.weekly-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); border-color: var(--border-light); }
.weekly-day {
  font-family: var(--font-heading); font-size: 13px; font-weight: 700;
  color: var(--teal); text-transform: uppercase; letter-spacing: .06em;
}
.weekly-name {
  font-family: var(--font-heading); font-size: 15px; font-weight: 600;
  color: var(--text);
}
.weekly-venue {
  font-size: 13px; color: var(--text-muted);
}
.weekly-time {
  font-size: 12px; color: var(--text-dim);
}
.weekly-desc {
  font-size: 12px; color: var(--text-muted); line-height: 1.5;
}
.weekly-footer {
  display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.weekly-free-badge {
  padding: 2px 9px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700;
  background: var(--warm); color: #fff;
  font-family: var(--font-heading);
}
.weekly-link {
  font-size: 12px; color: var(--accent); font-weight: 500;
}
.weekly-link:hover { color: var(--hot); }
.weekly-phone {
  font-size: 12px; color: var(--text-dim); margin-left: auto;
}

/* ══════════════════════════════════════════════════════════════
   FEATURE 7 — FREE FILTER BUTTON
══════════════════════════════════════════════════════════════ */
.free-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  color: #22c55e;
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.35);
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--transition), box-shadow var(--transition);
}
.free-btn:hover { background: rgba(34,197,94,.22); }
.free-btn.active {
  background: #22c55e;
  color: #fff;
  border-color: #22c55e;
  box-shadow: 0 0 12px rgba(34,197,94,.45);
}

/* ── Scrollbar (desktop only) ── */
@media (pointer: fine) {
  ::-webkit-scrollbar { width: 8px; }
  ::-webkit-scrollbar-track { background: var(--bg); }
  ::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
}
