@font-face {
  font-family: "Nafees Nastaleeq";
  src: url("fonts/Nafees-Nastaleeq.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg-1: #05070d;
  --bg-2: #0c1220;
  --panel: rgba(12, 16, 29, 0.9);
  --panel-soft: rgba(255, 255, 255, 0.055);
  --gold-1: #f7e4be;
  --gold-2: #efd2a2;
  --gold-3: #f7d57a;
  --gold-border: rgba(255, 222, 138, 0.25);
  --text: #f5f7ff;
  --muted: #abb5cf;
  --live: #22c55e;
  --offair: #4b5563;
  --header-control: rgba(255, 255, 255, 0.055);
  --header-control-border: rgba(255, 222, 138, 0.2);
  --progress-track: rgba(255, 255, 255, 0.16);
}


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

html[data-theme="light"] {
  color-scheme: light;
  --bg-1: #fffaf0;
  --bg-2: #eadcc3;
  --panel: rgba(255, 252, 244, 0.94);
  --panel-soft: rgba(23, 18, 11, 0.055);
  --gold-1: #f5deb0;
  --gold-2: #e6c57e;
  --gold-3: #9a6a12;
  --gold-border: rgba(137, 99, 27, 0.3);
  --text: #201a12;
  --muted: #746a5c;
  --live: #16a34a;
  --offair: #aaa49a;
  --header-control: rgba(255, 255, 255, 0.62);
  --header-control-border: rgba(137, 99, 27, 0.24);
  --progress-track: rgba(32, 26, 18, 0.13);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 0%, rgba(247, 213, 122, 0.15), transparent 34%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

.radio-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.radio-card {
  position: relative;
  width: min(100%, 540px);
  min-height: 560px;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--gold-border);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(5, 7, 13, 0.2), rgba(5, 7, 13, 0.88)),
    url("image.png") center 25% / 440px auto no-repeat,
    var(--panel);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
}

.radio-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(8, 11, 20, 0.36) 0%,
    rgba(8, 11, 20, 0.7) 40%,
    rgba(8, 11, 20, 0.96) 100%
  );
  pointer-events: none;
}

.radio-card > * {
  position: relative;
  z-index: 1;
}

.radio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.radio-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--header-control-border);
  border-radius: 50%;
  color: var(--text);
  background: var(--header-control);
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.theme-toggle:active {
  transform: scale(0.97);
}

.theme-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[data-theme="dark"] .theme-icon--sun,
html[data-theme="light"] .theme-icon--moon {
  display: none;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.brand__logo {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 222, 138, 0.44);
  border-radius: 12px;
  object-fit: cover;
  background: transparent;
  box-shadow: 0 0 0 3px rgba(247, 213, 122, 0.11);
}

.brand__text {
  overflow: hidden;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.status {
  flex: 0 0 auto;
  width: 30px;
  height: 12px;
  border: 0;
  border-radius: 999px;
  background: var(--offair);
  box-shadow: 0 0 0 3px rgba(75, 85, 99, 0.15);
}

.status--live {
  background: var(--live);
  box-shadow:
    0 0 0 3px rgba(34, 197, 94, 0.14),
    0 0 14px rgba(34, 197, 94, 0.28);
}

.status--offair,
.status--loading {
  background: var(--offair);
  box-shadow: 0 0 0 3px rgba(75, 85, 99, 0.15);
}

.station-switch {
  width: min(100%, 330px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin: 34px auto 0;
  padding: 5px;
  border: 1px solid rgba(255, 222, 138, 0.14);
  border-radius: 999px;
  background: rgba(6, 8, 15, 0.62);
  backdrop-filter: blur(12px);
}

.station-switch__button {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

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

.station-switch__button.is-active {
  color: #17120b;
  background: linear-gradient(145deg, var(--gold-1), var(--gold-2));
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
}

.station-switch__button:active {
  transform: scale(0.985);
}

.now-playing {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 10px 12px;
  text-align: center;
}

.now-playing__label {
  margin-bottom: 12px;
  color: var(--gold-3);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.now-playing__title {
  width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(24px, 6vw, 34px);
  line-height: 1.12;
  text-wrap: balance;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.7);
}


.now-playing__title[lang="ur"] {
  font-family: "Nafees Nastaleeq", "Noto Nastaliq Urdu", serif;
  font-weight: 400;
  line-height: 1.75;
  direction: rtl;
  text-align: center;
  overflow-wrap: normal;
  word-break: normal;
}

.now-playing__station {
  margin-top: 11px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.progress {
  width: min(100%, 400px);
  margin-top: 26px;
}

.progress__track {
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--progress-track);
}

.progress__fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c39537, var(--gold-3));
  transition: width 0.35s linear;
}

.progress__times {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.radio-controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  width: min(100%, 400px);
  margin: 6px auto 0;
}

.volume-control {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.volume-range {
  width: min(110px, 20vw);
  accent-color: #e7c271;
  cursor: pointer;
}

.round-button,
.play-button {
  border: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #17120b;
  background: linear-gradient(145deg, var(--gold-1), var(--gold-2));
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition:
    transform 0.18s ease,
    opacity 0.18s ease;
}

.round-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.play-button {
  width: 68px;
  height: 68px;
  border-radius: 50%;
}

.round-button:hover,
.play-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.round-button:active,
.play-button:active:not(:disabled) {
  transform: scale(0.98);
}

.play-button:disabled,
.round-button.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.play-icon,
.pause-icon {
  position: relative;
  width: 20px;
  height: 20px;
}

.play-icon::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 6px;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 13px solid currentColor;
}

.pause-icon::before,
.pause-icon::after {
  content: "";
  position: absolute;
  top: 1px;
  width: 4px;
  height: 17px;
  border-radius: 3px;
  background: currentColor;
}

.pause-icon::before {
  left: 3px;
}

.pause-icon::after {
  right: 3px;
}

.volume-icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.volume-icon--off {
  display: none;
}

.volume-button.is-muted .volume-icon--on {
  display: none;
}

.volume-button.is-muted .volume-icon--off {
  display: block;
}

.download-button {
  width: auto;
  min-width: 92px;
  padding: 0 16px;
  border-radius: 999px;
  justify-self: end;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.offline-message {
  margin-top: 18px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

#audioPlayer {
  display: none;
}


html[data-theme="light"] body {
  background:
    radial-gradient(circle at 50% 0%, rgba(194, 145, 48, 0.18), transparent 35%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
}

html[data-theme="light"] .radio-card {
  background:
    linear-gradient(180deg, rgba(255, 252, 244, 0.48), rgba(255, 252, 244, 0.9)),
    url("image.png") center 25% / 440px auto no-repeat,
    var(--panel);
  box-shadow: 0 28px 80px rgba(84, 62, 24, 0.2);
}

html[data-theme="light"] .radio-card::before {
  background: linear-gradient(
    180deg,
    rgba(255, 252, 244, 0.22) 0%,
    rgba(255, 252, 244, 0.62) 42%,
    rgba(255, 252, 244, 0.94) 100%
  );
}

html[data-theme="light"] .station-switch {
  border-color: rgba(137, 99, 27, 0.2);
  background: rgba(255, 255, 255, 0.58);
}

html[data-theme="light"] .station-switch__button.is-active {
  box-shadow: 0 8px 20px rgba(84, 62, 24, 0.16);
}

html[data-theme="light"] .now-playing__title {
  text-shadow: 0 3px 20px rgba(255, 255, 255, 0.85);
}

html[data-theme="light"] .round-button,
html[data-theme="light"] .play-button {
  box-shadow:
    0 12px 26px rgba(84, 62, 24, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .brand__logo {
  box-shadow: 0 0 0 3px rgba(171, 123, 30, 0.1);
}

@media (max-width: 520px) {
  .radio-page {
    padding: 0;
  }

  .radio-card {
    width: 100%;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    padding: 18px;
  }

  .station-switch {
    margin-top: 28px;
  }

  .now-playing {
    min-height: 250px;
    padding-inline: 0;
  }

  .radio-controls {
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    width: 100%;
  }

  .volume-range {
    display: none;
  }

  .volume-button {
    justify-self: start;
  }

  .download-button {
    justify-self: end;
  }
}
