:root {
  --bg: #05070f;
  --bg-soft: #0a0f1e;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-strong: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef2fb;
  --muted: #8b96ad;
  --indigo: #6366f1;
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --danger: #f87171;
  --success: #34d399;
  --radius: 18px;
  --font-body: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Sora", "Segoe UI", Roboto, Arial, sans-serif;
  --shadow-card: 0 8px 30px rgba(2, 6, 23, 0.55);
}

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

html {
  scrollbar-color: #2a3550 #0a0f1e;
}

::selection {
  background: rgba(99, 102, 241, 0.45);
  color: #fff;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Aurora background */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(ellipse 55% 45% at 12% -8%, rgba(99, 102, 241, 0.22), transparent 60%),
    radial-gradient(ellipse 45% 40% at 88% 4%, rgba(34, 211, 238, 0.14), transparent 60%),
    radial-gradient(ellipse 60% 50% at 50% 110%, rgba(139, 92, 246, 0.16), transparent 65%),
    var(--bg);
}

.aurora::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
  pointer-events: none;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 7, 15, 0.72);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
}

.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
  background: linear-gradient(135deg, var(--indigo), var(--cyan));
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4);
}

.logo-text {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.logo-text .grad {
  background: linear-gradient(90deg, #a5b4fc, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.nav a {
  color: var(--muted);
  font-weight: 600;
  font-size: 13.5px;
  padding: 8px 16px;
  border-radius: 999px;
  transition: color 0.18s ease, background 0.18s ease;
}

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

.nav a.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(139, 92, 246, 0.9));
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

/* Main */
main {
  flex: 1;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

.hero {
  margin-bottom: 28px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.page-title.small {
  font-size: 22px;
  margin-top: 40px;
}

.page-subtitle {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 22px;
}

/* Search */
.search-wrap {
  position: relative;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.search-wrap:focus-within {
  border-color: rgba(34, 211, 238, 0.5);
  background: var(--surface-strong);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}

.search-wrap svg {
  flex-shrink: 0;
  color: var(--muted);
}

.search-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
}

.search-wrap input::placeholder {
  color: #5b6579;
}

.search-wrap kbd {
  flex-shrink: 0;
  font-family: inherit;
  font-size: 11.5px;
  color: var(--muted);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
}

/* Grid + cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 12px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.22s cubic-bezier(0.22, 0.68, 0.35, 1), border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(129, 140, 248, 0.55);
  background: var(--surface-strong);
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.6), 0 0 0 1px rgba(99, 102, 241, 0.25), 0 0 34px rgba(99, 102, 241, 0.18);
}

.card.hidden {
  display: none;
}

.card .icon {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(160deg, rgba(99, 102, 241, 0.18), rgba(34, 211, 238, 0.1));
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 700;
  color: #c7d2fe;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.card:hover .icon {
  transform: scale(1.08);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.28);
}

.card .icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card .name {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  color: #dbe2f2;
}

/* Empty / no results */
.empty-note,
.no-results {
  grid-column: 1 / -1;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 30px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.no-results {
  display: none;
}

/* Skeleton */
.skeleton-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 20px 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: pulse 1.4s ease-in-out infinite;
}

.skeleton-card .sk-icon {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--surface-strong);
}

.skeleton-card .sk-line {
  width: 70%;
  height: 11px;
  border-radius: 6px;
  background: var(--surface-strong);
}

@keyframes pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 0.68, 0.35, 1);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* Radio */
.radio-bar {
  border-top: 1px solid var(--border);
  background: rgba(8, 12, 26, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.radio-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.radio-cover {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--violet), var(--indigo) 55%, var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.radio-meta {
  flex: 1;
  min-width: 150px;
}

.radio-meta .station {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15.5px;
}

.radio-meta .live {
  font-size: 10.5px;
  color: var(--cyan);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 2px;
}

.equalizer {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
}

.equalizer span {
  width: 4px;
  height: 18%;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--cyan), var(--indigo));
  opacity: 0.35;
  transition: opacity 0.3s ease;
}

.radio-bar.playing .equalizer span {
  opacity: 1;
  animation: eq 0.9s ease-in-out infinite;
}

.radio-bar.playing .equalizer span:nth-child(2) { animation-delay: 0.12s; animation-duration: 1.1s; }
.radio-bar.playing .equalizer span:nth-child(3) { animation-delay: 0.25s; animation-duration: 0.8s; }
.radio-bar.playing .equalizer span:nth-child(4) { animation-delay: 0.38s; animation-duration: 1.25s; }

@keyframes eq {
  0%, 100% { height: 16%; }
  50% { height: 100%; }
}

.radio-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4);
}

.radio-play:hover {
  transform: scale(1.07);
  box-shadow: 0 8px 26px rgba(99, 102, 241, 0.55);
}

.radio-play.playing {
  background: linear-gradient(135deg, #f43f5e, #fb7185);
  box-shadow: 0 6px 18px rgba(244, 63, 94, 0.4);
}

.radio-status {
  font-size: 12px;
  color: var(--muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(5, 7, 15, 0.9);
  color: var(--muted);
  text-align: center;
  padding: 18px 20px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-admin {
  color: #a5b4fc;
  font-weight: 600;
  transition: color 0.15s ease;
}

.footer-admin:hover {
  color: var(--cyan);
}

/* ------------------------- Admin ------------------------- */

.admin-main {
  max-width: 900px;
}

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 30px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-card);
}

.admin-card h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.4px;
  margin-bottom: 8px;
}

.login-form {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

input[type="text"],
input[type="password"],
input[type="search"] {
  padding: 11px 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  background: rgba(3, 6, 16, 0.55);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: rgba(129, 140, 248, 0.6);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

input::placeholder {
  color: #5b6579;
}

.login-form input {
  flex: 1;
  min-width: 200px;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn.primary {
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  color: #fff;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
}

.btn.primary:hover {
  box-shadow: 0 8px 26px rgba(99, 102, 241, 0.5);
}

.btn.ghost {
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn.danger {
  background: rgba(248, 113, 113, 0.14);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.btn.danger:hover {
  background: rgba(248, 113, 113, 0.22);
}

.msg {
  margin-top: 14px;
  font-size: 13.5px;
  min-height: 18px;
}

.msg.ok { color: var(--success); }
.msg.error { color: var(--danger); }

.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(3, 6, 16, 0.45);
  border: 1px solid var(--border);
  width: fit-content;
}

.tab {
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.radio-edit {
  background: rgba(3, 6, 16, 0.4);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 26px;
}

.radio-edit h2 {
  font-family: var(--font-display);
  font-size: 15px;
  margin-bottom: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.form-row label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.link-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 22px;
}

.link-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 10px;
  align-items: center;
  background: rgba(3, 6, 16, 0.35);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  transition: border-color 0.2s ease;
}

.link-row:focus-within {
  border-color: rgba(129, 140, 248, 0.5);
}

.link-row .del {
  padding: 10px 14px;
}

.list-empty {
  color: var(--muted);
  font-size: 14px;
  padding: 10px 2px;
}

.editor-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.danger-zone {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .logo {
    justify-content: center;
  }

  .nav {
    justify-content: center;
  }

  .page-title {
    font-size: 27px;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
    gap: 12px;
  }

  .card .icon {
    width: 54px;
    height: 54px;
  }

  .link-row {
    grid-template-columns: 1fr;
  }

  .radio-inner {
    justify-content: center;
    text-align: center;
  }

  .radio-meta {
    min-width: 120px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
