/* ===== FRC Radio Design System ===== */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@400;500;600&display=swap');

:root {
  --main-white: rgb(205, 205, 205);
  --bright-white: rgb(225, 225, 225);
  --main-dark: rgb(24, 32, 41);
  --main-gray: rgb(103, 101, 101);
  --light-gray: rgb(174, 173, 173);
  --blue: rgb(72, 99, 125);
  --blue2: rgb(107, 131, 154);
  --blue3: #1f2531;
  --blue4: rgb(43, 64, 83);
  --blue5: rgb(47, 64, 84);
  --blue6: rgb(116, 167, 215);
  --link-blue: rgb(158, 197, 235);
  --purple: rgb(73, 42, 87);
  --pink: rgb(221, 196, 248);
  --green: rgb(161, 190, 128);
  --green2: rgb(49, 74, 36);
  --orange: rgb(165, 79, 4);
  --orange2: rgb(209, 158, 116);
  --orange3: rgb(222, 199, 174);
  --orange4: rgb(213, 189, 161);
  --red1: rgb(206, 101, 101);
  --red2: rgb(120, 51, 51);
  --red3: rgb(241, 143, 143);
  --border-radius: 4px;
  --main-distance: 8px;
  --butt-wide: 250px;
  --butt-tall: 54px;

  /* Elevated palette */
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --glow-orange: rgba(165, 79, 4, 0.3);
  --glow-blue: rgba(116, 167, 215, 0.15);
  --glow-green: rgba(161, 190, 128, 0.2);
}

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

body {
  background-color: var(--main-dark);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(72, 99, 125, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(165, 79, 4, 0.05) 0%, transparent 50%);
  min-height: 100vh;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px 40px;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ===== Typography ===== */

h1 {
  font-family: YoungSerif, 'DM Serif Display', Georgia, serif;
  color: var(--orange3);
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  margin: 40px 0 8px;
}

h3 {
  font-family: YoungSerif, 'DM Serif Display', Georgia, serif;
  color: var(--main-white);
  font-size: 1.2rem;
  margin: 10px 0;
}

h4 {
  font-family: YoungSerif, 'DM Serif Display', Georgia, serif;
  color: var(--main-white);
  font-size: 1.05rem;
  margin: 10px 0;
}

p {
  color: var(--main-white);
  line-height: 1.6;
  font-size: 0.95rem;
}

a {
  color: var(--link-blue);
  transition: color 0.2s ease;
}
a:hover {
  color: var(--blue6);
}

.subtitle {
  color: var(--light-gray);
  font-size: 0.95rem;
  margin-bottom: 30px;
}

.top-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 18px;
  margin: -10px 0 26px;
}

.top-links a {
  font-size: 0.88rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(158, 197, 235, 0.35);
  padding-bottom: 2px;
}

/* ===== Card / Surface ===== */

.card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 28px 24px;
  margin: 20px 0;
  backdrop-filter: blur(8px);
  transition: border-color 0.3s ease;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.card-header {
  font-family: YoungSerif, 'DM Serif Display', Georgia, serif;
  color: var(--orange3);
  font-size: 1rem;
  margin-bottom: 16px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

/* ===== Buttons ===== */

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 5px;
  width: var(--butt-wide);
  height: var(--butt-tall);
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  background: linear-gradient(135deg, var(--blue3), var(--blue4));
  color: var(--blue6);
  border: 1px solid var(--blue5);
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.25s ease;
}

button:hover {
  color: var(--green);
  border-color: var(--green2);
  box-shadow: 0 2px 20px var(--glow-green);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

button.primary {
  background: linear-gradient(135deg, var(--orange), rgb(190, 100, 20));
  color: var(--bright-white);
  border-color: rgba(255, 140, 0, 0.3);
  box-shadow: 0 2px 16px var(--glow-orange);
}

button.primary:hover {
  color: #fff;
  box-shadow: 0 4px 24px rgba(165, 79, 4, 0.5);
  border-color: rgba(255, 140, 0, 0.5);
}

/* ===== Selects ===== */

#category-select,
#playlist-select {
  display: block;
  margin: 12px auto 16px auto;
  text-align: center;
  width: var(--butt-wide);
  height: var(--butt-tall);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  background: var(--blue3);
  color: var(--blue6);
  border: 1px solid var(--blue5);
  border-radius: 8px;
  box-shadow: none;
  transition: border-color 0.15s ease, color 0.15s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  padding: 0 16px;
}

#category-select:hover {
  color: var(--blue6);
  border-color: var(--blue6);
  box-shadow: none;
}

#category-select:focus {
  outline: none;
  border-color: var(--blue6);
}

#playlist-select {
  transition: none;
}

#playlist-select:hover,
#playlist-select:focus {
  color: var(--blue6);
  border-color: var(--blue5);
  box-shadow: none;
  outline: none;
}

#playlist-select:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== Inputs ===== */

input {
  background-color: var(--blue3);
  color: var(--main-white);
  font-family: 'DM Sans', sans-serif;
}

input[type="text"],
input[type="url"] {
  border: 1px solid var(--blue5);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.95rem;
  transition: all 0.25s ease;
}

input[type="text"]:focus,
input[type="url"]:focus {
  outline: none;
  border-color: var(--blue6);
  box-shadow: 0 0 16px var(--glow-blue);
}

input[type="text"]::placeholder {
  color: var(--main-gray);
}

/* ===== Volume Slider ===== */

.volume-text {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  color: var(--orange2);
  display: block;
  margin-bottom: 5px;
  font-size: 0.9rem;
}

#volumeControl {
  margin: 20px auto;
  padding: 10px;
  max-width: 400px;
  text-align: center;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 75%;
  height: 20px;
  background: transparent;
  margin: 10px 0;
}

input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: linear-gradient(90deg, var(--blue4), var(--blue3));
  border-radius: 3px;
  border: 1px solid rgba(255, 140, 0, 0.3);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  border: none;
  height: 22px;
  width: 22px;
  border-radius: 50%;
  background: radial-gradient(circle, #ff8c00, #e07800);
  margin-top: -8px;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(255, 140, 0, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 18px rgba(255, 140, 0, 0.7);
}

input[type="range"]::-moz-range-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: linear-gradient(90deg, var(--blue4), var(--blue3));
  border-radius: 3px;
  border: 1px solid rgba(255, 140, 0, 0.3);
}

input[type="range"]::-moz-range-thumb {
  border: none;
  height: 22px;
  width: 22px;
  border-radius: 50%;
  background: radial-gradient(circle, #ff8c00, #e07800);
  cursor: pointer;
  box-shadow: 0 0 12px rgba(255, 140, 0, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 18px rgba(255, 140, 0, 0.7);
}

/* ===== Channel Grid (index) ===== */

.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin: 2rem auto;
  max-width: 800px;
  padding: 0 1rem;
}

.channel-box {
  padding: 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--surface);
  transition: transform 0.2s ease, border-color 0.3s ease;
}

.channel-box:hover {
  transform: translateY(-2px);
  border-color: rgba(161, 190, 128, 0.3);
}

.channel-title {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--green);
}

.channel-actions a {
  display: inline-block;
  margin: 0.25rem 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--green2), rgba(49, 74, 36, 0.8));
  color: var(--bright-white);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  border: 1px solid rgba(161, 190, 128, 0.2);
}

.channel-actions a:hover {
  box-shadow: 0 2px 16px var(--glow-green);
  border-color: rgba(161, 190, 128, 0.4);
}

/* ===== Status Messages ===== */

.status-msg {
  font-size: 0.9rem;
  margin-top: 16px;
  min-height: 1.4em;
  transition: color 0.2s ease;
}

.status-msg.success { color: var(--green); }
.status-msg.error { color: var(--red1); }

/* ===== Now Playing ===== */

.now-playing-bar {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px 24px;
  margin-top: 28px;
  text-align: left;
}

.now-playing-bar .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--main-gray);
  margin-bottom: 6px;
}

.now-playing-bar .value {
  color: var(--orange3);
  font-family: YoungSerif, 'DM Serif Display', Georgia, serif;
  font-size: 1.05rem;
}

.now-playing-bar .track-value {
  color: var(--bright-white);
  font-size: 1rem;
}

.np-divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 12px 0;
}

/* ===== Divider ===== */

.divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 28px 0;
}

/* ===== Steps (index how-it-works) ===== */

.steps {
  text-align: left;
  margin: 24px 0;
}

.step {
  display: flex;
  gap: 16px;
  margin: 18px 0;
  align-items: flex-start;
}

.step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), rgb(190, 100, 20));
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px var(--glow-orange);
}

.step-content strong {
  color: var(--bright-white);
  display: block;
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.step-content p {
  font-size: 0.88rem;
  color: var(--light-gray);
  margin: 0;
}

/* ===== Info Box ===== */

.info-box {
  background: rgba(161, 190, 128, 0.06);
  border: 1px solid rgba(161, 190, 128, 0.15);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 20px auto;
  max-width: 450px;
  text-align: left;
}

.info-box p {
  font-size: 0.85rem;
  color: var(--light-gray);
}

/* ===== Listener Page ===== */

.listener-hero {
  margin-top: 20px;
}

.play-button {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), rgb(200, 110, 20));
  border: none;
  box-shadow: 0 4px 30px var(--glow-orange);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  margin: 20px 0;
}

.play-button:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 40px rgba(165, 79, 4, 0.6);
}

.play-button svg {
  width: 32px;
  height: 32px;
  fill: #fff;
  margin-left: 4px;
}

/* ===== Link Copy Field ===== */

.link-field {
  display: flex;
  gap: 0;
  max-width: 420px;
  margin: 12px auto;
}

.link-field input {
  flex: 1;
  border-radius: 8px 0 0 8px;
  border: 1px solid var(--blue5);
  border-right: none;
  padding: 10px 14px;
  font-size: 0.85rem;
  background: var(--blue3);
  color: var(--light-gray);
}

.link-field button {
  width: auto;
  height: auto;
  padding: 10px 16px;
  border-radius: 0 8px 8px 0;
  margin: 0;
  font-size: 0.85rem;
  white-space: nowrap;
}

/* ===== Footer ===== */

.site-footer {
  margin-top: 40px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  color: var(--main-white);
  font-size: 0.9rem;
}
.site-footer-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.sfaudio-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--main-white);
  transition: opacity 0.2s ease;
}
.sfaudio-link:hover {
  opacity: 0.85;
}
.sfaudio-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  padding: 5px;
}
.sfaudio-text {
  text-align: left;
  line-height: 1;
}
.sfaudio-title { font-weight: 600; color: var(--bright-white); font-size: 0.9rem; }
.sfaudio-sub { font-size: 0.8rem; color: var(--main-gray); margin-top: 3px; }
.site-credit { font-size: 0.8rem; color: var(--main-gray); }
.site-credit a { color: var(--link-blue); text-decoration: underline; }
.site-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--main-gray);
}
.site-links a {
  color: var(--link-blue);
  text-decoration: none;
}
.site-links a:hover {
  color: var(--blue6);
}

/* ===== Fade In Animation ===== */

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

.fade-in {
  animation: fadeInUp 0.5s ease both;
}

.fade-in:nth-child(1) { animation-delay: 0.05s; }
.fade-in:nth-child(2) { animation-delay: 0.12s; }
.fade-in:nth-child(3) { animation-delay: 0.19s; }
.fade-in:nth-child(4) { animation-delay: 0.26s; }
.fade-in:nth-child(5) { animation-delay: 0.33s; }

/* ===== Responsive ===== */

@media (max-width: 480px) {
  body { padding: 0 14px 30px; }
  h1 { font-size: 1.3rem; margin: 30px 0 6px; }
  button { width: 100%; max-width: 280px; }
  #category-select, #playlist-select { width: 100%; max-width: 280px; }
  .link-field { flex-direction: column; gap: 8px; }
  .link-field input { border-radius: 8px; border-right: 1px solid var(--blue5); }
  .link-field button { border-radius: 8px; width: 100%; }
  .top-links { gap: 8px 12px; }
}
