:root {
  --bg: #0c0a14;
  --bg-glow-1: #ff2d78;
  --bg-glow-2: #7c3aed;
  --bg-glow-3: #00d9ff;
  --surface: #17131f;
  --surface-2: #1f1a2c;
  --border: #322a44;
  --text: #f5f3ff;
  --text-dim: #a79fc2;
  --accent: #ff2d78;
  --accent-2: #ffb703;
  --sold-out: #55506a;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);

  --genre-rock: #ff4d6d;
  --genre-metal: #ef4444;
  --genre-jazz: #3b82f6;
  --genre-electronic: #00d9ff;
  --genre-classical: #ffd60a;
  --genre-hiphop: #b357f5;
  --genre-world: #2dd881;
  --genre-pop: #ff6ec7;
  --genre-other: #9295a6;
}

:root[data-theme="light"] {
  --bg: #f7f5fb;
  --bg-glow-1: #ffd0e2;
  --bg-glow-2: #dcd0ff;
  --bg-glow-3: #cdf4ff;
  --surface: #ffffff;
  --surface-2: #f1edf9;
  --border: #e3ddf0;
  --text: #1c1730;
  --text-dim: #6b6483;
  --sold-out: #b8b3c9;
  --shadow: 0 8px 24px rgba(90, 60, 150, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image:
    radial-gradient(600px circle at 8% -5%, color-mix(in srgb, var(--bg-glow-1) 22%, transparent), transparent 60%),
    radial-gradient(700px circle at 95% 10%, color-mix(in srgb, var(--bg-glow-2) 22%, transparent), transparent 60%),
    radial-gradient(800px circle at 50% 0%, color-mix(in srgb, var(--bg-glow-3) 14%, transparent), transparent 55%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding-inline: max(16px, env(safe-area-inset-left));
  transition: background-color 0.2s ease, color 0.2s ease;
}

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding-block: 20px 48px;
}

/* ---------- Header ---------- */

header.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.hero-text {
  min-width: 0;
}

.logo {
  font-family: "Bungee", "Space Grotesk", sans-serif;
  font-size: clamp(2.4rem, 9vw, 4rem);
  line-height: 1;
  margin: 0;
  letter-spacing: 0.01em;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 55%, var(--genre-electronic) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 34px color-mix(in srgb, var(--accent) 35%, transparent);
  display: inline-block;
}

.tagline {
  margin: 2px 0 0;
  color: var(--text-dim);
  font-size: clamp(0.85rem, 2.6vw, 1.05rem);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.logo-link {
  text-decoration: none;
}

.top-nav {
  margin-bottom: 10px;
}

.top-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
}

.top-nav a:hover {
  color: var(--accent);
}

.artist-search {
  position: relative;
  margin-bottom: 14px;
}

.artist-search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-family: inherit;
  box-shadow: var(--shadow);
}

.artist-search input:focus {
  outline: none;
  border-color: var(--accent);
}

.artist-search-results {
  position: absolute;
  z-index: 10;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.artist-search-results a {
  display: block;
  padding: 9px 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}

.artist-search-results a:hover {
  background: var(--surface-2);
}

.theme-toggle {
  flex: 0 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.theme-toggle:hover {
  border-color: var(--accent);
}

/* ---------- Filters ---------- */

.filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.filters-row:last-child {
  margin-bottom: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 140px;
  min-width: 0;
}

.field label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 700;
}

.field select,
.field input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 0.9rem;
  min-width: 0;
  font-family: inherit;
}

.field select:focus,
.field input:focus {
  outline: none;
  border-color: var(--accent);
}

.checkbox-field {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 600;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* Genre chips */

.genre-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  --chip-color: var(--text-dim);
  appearance: none;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s ease, background-color 0.12s ease, border-color 0.12s ease,
    color 0.12s ease, box-shadow 0.12s ease;
}

.chip::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--chip-color);
  margin-right: 7px;
  vertical-align: middle;
  opacity: 0.55;
}

.chip:hover {
  transform: translateY(-1px);
  border-color: var(--chip-color);
  color: var(--text);
}

.chip.active {
  background: var(--chip-color);
  border-color: var(--chip-color);
  color: #0c0a14;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--chip-color) 40%, transparent);
  transform: scale(1.04);
}

.chip.active::before {
  background: #0c0a14;
  opacity: 0.55;
}

.chip.all-chip {
  --chip-color: var(--accent);
}

/* ---------- Results ---------- */

.result-count {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 12px;
  font-weight: 600;
}

.day-group {
  margin-bottom: 22px;
}

.day-heading {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
}

.event-card {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--card-color, var(--accent));
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 9px;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, border-color 0.12s ease;
  cursor: pointer;
}

.event-card:hover {
  transform: translateY(-2px) scale(1.005);
}

/* ---------- Thumbnails ---------- */

.thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-2);
}

.thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pill-color, var(--text-dim));
  font-size: 1.4rem;
  opacity: 0.7;
}

.thumb-round {
  border-radius: 999px;
}

.thumb-hero {
  width: 100%;
  height: 220px;
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 3rem;
}

.thumb-hero.thumb-round {
  width: 140px;
  height: 140px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.event-main {
  flex: 1 1 auto;
  min-width: 0;
}

.event-artist {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 3px;
  word-wrap: break-word;
}

.event-meta {
  color: var(--text-dim);
  font-size: 0.82rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-weight: 500;
}

.genre-pill {
  display: inline-block;
  background: color-mix(in srgb, var(--pill-color, var(--text-dim)) 20%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--pill-color, var(--text-dim)) 55%, var(--border));
  color: var(--text);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.72rem;
  font-weight: 700;
}

.alcohol-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.alcohol-yes {
  background: color-mix(in srgb, var(--accent-2) 20%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--accent-2) 55%, var(--border));
  color: var(--text);
}

.alcohol-no {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.alcohol-unknown {
  background: var(--surface-2);
  border: 1px dashed var(--border);
  color: var(--text-dim);
}

.event-side {
  flex: 0 0 auto;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.price {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.ticket-link {
  display: inline-block;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #140b1f;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 7px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.ticket-link.sold-out {
  background: var(--sold-out);
  color: var(--text-dim);
  pointer-events: none;
}

.empty-state {
  color: var(--text-dim);
  padding: 40px 0;
  text-align: center;
  font-weight: 600;
}

/* ---------- Detail / artist views ---------- */

.back-link {
  display: inline-block;
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 14px;
}

.back-link:hover {
  color: var(--accent);
}

.section-heading {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin: 22px 0 10px;
}

.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--card-color, var(--accent));
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 8px;
}

.detail-body {
  padding: 18px 20px 20px;
}

.detail-title {
  font-size: clamp(1.4rem, 5vw, 2rem);
  margin: 8px 0 4px;
}

.detail-meta {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.92rem;
  margin: 2px 0;
}

.detail-price {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 12px 0 14px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.details-link {
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: underline;
}

.ticket-link-disabled {
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.artist-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.artist-about {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.artist-about p {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 6px 0 4px;
}

.artist-link {
  color: var(--text);
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
}

.artist-link:hover {
  color: var(--accent);
}

.bio-source {
  color: var(--text-dim);
  font-size: 0.78rem;
  text-decoration: underline;
}

.related-artists {
  margin-top: 16px;
}

.related-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.related-chip {
  text-decoration: none;
  --chip-color: var(--genre-hiphop);
}

.artist-mini-card {
  display: flex;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  align-items: center;
}

.artist-mini-name {
  font-weight: 800;
}

.artist-mini-bio {
  color: var(--text-dim);
  font-size: 0.82rem;
}

.artist-hero {
  display: flex;
  gap: 18px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 8px;
}

.artist-hero p {
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 8px 0 6px;
}

.artist-shows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.artist-show-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.artist-show-row:hover {
  border-color: var(--accent);
}

@media (max-width: 480px) {
  .artist-hero,
  .artist-about {
    flex-direction: column;
    text-align: center;
  }
  .artist-hero .thumb-hero.thumb-round {
    margin: 0 auto;
  }
}

/* ---------- Sources page ---------- */

.source-table {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.source-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 0.85rem;
}

.source-row-head {
  background: transparent;
  border: none;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0 12px;
}

.source-row-name a {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.source-row-name a:hover {
  color: var(--accent);
}

.source-status {
  font-weight: 700;
  white-space: nowrap;
}

.source-ok {
  color: var(--genre-world);
}

.source-failed {
  color: var(--genre-rock);
  cursor: help;
}

.source-row-count,
.source-row-time {
  color: var(--text-dim);
}

@media (max-width: 600px) {
  .source-row {
    grid-template-columns: 1fr 1fr;
    row-gap: 4px;
  }
  .source-row-head {
    display: none;
  }
}

@media (max-width: 480px) {
  .event-card {
    flex-direction: column;
    align-items: stretch;
  }
  .event-side {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
