@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Unbounded:wght@500;600;700&display=swap');

:root {
  color-scheme: dark;
  --bg: #0b0d13;
  --bg-alt: #111724;
  --card: #161b2a;
  --stroke: rgba(255, 255, 255, 0.08);
  --text: #e5e7ef;
  --muted: #9aa3b2;
  --accent: #34d399;
  --accent-2: #60a5fa;
  --warning: #f59e0b;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background: radial-gradient(circle at top left, rgba(96, 165, 250, 0.12), transparent 50%),
    radial-gradient(circle at 15% 55%, rgba(52, 211, 153, 0.12), transparent 45%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 40px 32px 80px;
}

.glow {
  position: fixed;
  inset: -20% 0 auto 0;
  height: 320px;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.25), transparent 65%);
  filter: blur(40px);
  z-index: -1;
}

.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.brand {
  display: flex;
  gap: 20px;
  align-items: center;
}

.brand-mark {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.9), rgba(52, 211, 153, 0.9));
  display: grid;
  place-items: center;
  font-family: 'Unbounded', system-ui, sans-serif;
  font-weight: 700;
  font-size: 24px;
  box-shadow: var(--shadow);
}

.brand-mark img {
  /*width: 28px;*/
  height: 36px;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.kicker {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

h1 {
  font-family: 'Unbounded', system-ui, sans-serif;
  font-size: clamp(28px, 4vw, 40px);
  margin: 6px 0 10px;
}

.subtitle {
  color: var(--muted);
  max-width: 560px;
}

.meta {
  display: flex;
  gap: 16px;
}

.meta-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 14px 18px;
  min-width: 120px;
  display: grid;
  gap: 6px;
  box-shadow: var(--shadow);
}

.meta-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.app {
  display: grid;
  gap: 24px;
}

.controls {
  display: grid;
  gap: 16px;
}

.search {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow);
}

.search input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 16px;
  outline: none;
}

.search-hint {
  font-size: 12px;
  color: var(--muted);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.view-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.view-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.view-options {
  display: inline-flex;
  gap: 8px;
  background: var(--bg-alt);
  border: 1px solid var(--stroke);
  padding: 6px;
  border-radius: 999px;
}

.view-export {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
}

.view-export .view-switch {
  flex: 0 0 auto;
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.export-btn {
  border: 1px solid var(--stroke);
  background: var(--bg-alt);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.export-btn:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.view-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-btn.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.22), rgba(96, 165, 250, 0.22));
  box-shadow: 0 10px 30px rgba(52, 211, 153, 0.18);
}

.mode-filter {
  display: grid;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.mode-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.mode-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.mode-chip:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.tab {
  border: 1px solid var(--stroke);
  background: var(--bg-alt);
  color: var(--muted);
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.tab[aria-selected="true"] {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.22), rgba(96, 165, 250, 0.22));
  color: var(--text);
  border-color: transparent;
  box-shadow: 0 10px 30px rgba(52, 211, 153, 0.25);
}

.list {
  display: grid;
  gap: 20px;
}

.list-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14px;
}

.list-table th,
.list-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  text-align: left;
  vertical-align: top;
}

.list-table thead th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.list-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.list.view-list {
  overflow-x: auto;
}

.loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px 20px;
  border-radius: var(--radius);
  border: 1px dashed var(--stroke);
  color: var(--muted);
  font-size: 14px;
}

.loading.active {
  display: flex;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent-2);
  animation: spin 0.9s linear infinite;
}

.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: grid;
  gap: 16px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.4s ease;
}

.list.view-list .card {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 18px 24px;
  align-items: start;
}

.list.view-list .card-head {
  flex-direction: column;
  align-items: flex-start;
}

.list.view-list .freq {
  text-align: left;
}

.list.view-list .pill-row {
  grid-column: 1 / -1;
}

.list.view-list .sections {
  grid-column: 1 / -1;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.callsign {
  font-size: 20px;
  font-weight: 600;
}

.location {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.map-link {
  display: inline-flex;
  margin-top: 8px;
  font-size: 13px;
  color: var(--accent-2);
  text-decoration: none;
}

.map-link:hover {
  text-decoration: underline;
}

.freq {
  text-align: right;
  font-size: 15px;
}

.freq-main {
  font-weight: 600;
  font-size: 18px;
}

.freq-sub {
  color: var(--muted);
  font-size: 13px;
}

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

.pill {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.pill.accent {
  color: var(--accent);
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.12);
}

.pill.blue {
  color: var(--accent-2);
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(96, 165, 250, 0.12);
}

.pill.onair {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(34, 197, 94, 0.16);
}

.section {
  display: grid;
  gap: 8px;
}

.section h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.field-grid {
  display: grid;
  gap: 8px 16px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.field {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 10px 12px;
}

.field span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.field strong {
  font-size: 14px;
  font-weight: 500;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 12px;
  border-radius: var(--radius);
  border: 1px dashed var(--stroke);
}

.footer {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.footer a {
  color: var(--accent-2);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 720px) {
  body {
    padding: 28px 20px 64px;
  }

  .meta {
    width: 100%;
  }

  .meta-card {
    flex: 1;
  }

  .freq {
    text-align: left;
  }
}
