@charset "utf-8";

@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,600;0,700;1,300;1,800&display=swap");

* {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  height: 100%;
  /* iOS Safari: extend past dynamic toolbar so % heights resolve to the visible viewport */
  height: -webkit-fill-available;
  background: linear-gradient(to bottom right, #0f172a 0%, #1e1b4b 40%, #111827 100%);
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  /* Fill the screen on iOS/iPadOS (100vh alone is often too short or leaves gaps) */
  min-height: 100%;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: transparent;
  color: #fff;
  font-family: "Poppins", sans-serif;
  overflow-x: hidden;
  overflow-y: hidden;
  /* Reduce rubber-band flash past the player background */
  overscroll-behavior: none;
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  inset: 0;
  width: auto;
  height: auto;
  min-height: 100%;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  background: linear-gradient(135deg, #000 0%, #111 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loading-content {
  text-align: center;
  animation: fadeInUp 0.8s ease;
}

.loading-artwork {
  width: 120px;
  height: 120px;
  margin: 0 auto 30px;
  position: relative;
  border-radius: 15px;
  overflow: hidden;
}

.loading-artwork-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-radius: 15px;
}

.loading-pulse {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
  animation: shimmer 2s infinite;
}

.loading-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.loading-subtitle {
  font-size: 16px;
  color: #ccc;
  margin-bottom: 30px;
}

.loading-bar {
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  margin: 0 auto;
  overflow: hidden;
}

.loading-progress {
  height: 100%;
  background: linear-gradient(90deg, #fff 0%, #ccc 100%);
  border-radius: 2px;
  animation: loadingProgress 2s ease-in-out infinite;
}

/* Skeleton Loading Animations */
.song-skeleton,
.artist-skeleton,
.history-song-skeleton,
.history-artist-skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.1) 25%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.1) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  display: inline-block;
  width: 100%;
  height: 1em;
}

.artist-skeleton {
  width: 70%;
}

.history-song-skeleton {
  width: 80%;
}

.history-artist-skeleton {
  width: 60%;
}

/* Artwork Loading */
.loading-artwork-main {
  position: relative;
}

.artwork-loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top: 3px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.loading-artwork-main.loading .artwork-loading-spinner {
  opacity: 1;
}

/* Button Loading */
.btn-play {
  position: relative;
  overflow: hidden;
}

.btn-loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-top: 2px solid #000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-play.loading .btn-loading-spinner {
  opacity: 1;
}

.btn-play.loading i,
.btn-play.loading span {
  opacity: 0;
}

/* Lyrics Loading */
.lyrics-loading-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
  opacity: 0;
}

.lyrics.loading .lyrics-loading-dot {
  opacity: 1;
}

.lyrics-loading {
  padding: 20px 0;
}

.lyrics-skeleton-line {
  height: 16px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.1) 25%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.1) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 12px;
}

.lyrics-skeleton-line.short {
  width: 60%;
}

/* History Cover Loading */
.cover-historic {
  position: relative;
}

.cover-loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top: 2px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cover-historic.loading .cover-loading-spinner {
  opacity: 1;
}


/* ─────────────────────────────────────────────────────────────────────────
   Apple-Music-style inline lyrics / history
   No modal, no drawer, no card — panels live inside .player-right and
   fade in/out directly on the same blurred backdrop as the rest of the player.
   ───────────────────────────────────────────────────────────────────────── */

/* ── Panels: invisible until opened, fill .player-right exactly ──────── */
.lyrics-panel,
.history-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* No background, no border, no shadow — pure text on the backdrop */
  background: transparent;
  border: none;
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.42s ease,
    visibility 0s linear 0.42s;
  contain: layout paint;
  will-change: opacity;
}

.lyrics-panel.is-open,
.history-panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.42s ease;
}

/* ── Default song-info fades out while panel is visible ─────────────── */
.song-info {
  transition: opacity 0.35s ease;
}

.player-container.lyrics-open .song-info,
.player-container.history-open .song-info {
  opacity: 0;
  pointer-events: none;
}

/* Encoder off-air: hide track/song placeholders (main column + bar + cover-meta). */
body.stream-offline .current-song,
body.stream-offline .current-artist,
.player-container.stream-offline .current-song,
.player-container.stream-offline .current-artist {
  display: none !important;
}

body.stream-offline .current-station .artist-skeleton,
.player-container.stream-offline .current-station .artist-skeleton {
  display: none !important;
}

body.stream-offline .bottom-nowplaying-track,
.player-bottom-bar.stream-offline .bottom-nowplaying-track {
  display: none !important;
}

body.stream-offline .cover-meta-song,
body.stream-offline .cover-meta-artist {
  display: none !important;
}

/* ── Cover-meta: song + artist appear below the cover when panel is open */
.cover-meta {
  margin-top: 18px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.42s ease;
}

.player-container.lyrics-open .cover-meta,
.player-container.history-open .cover-meta {
  opacity: 1;
}

/* ~3× artwork column height so lyrics/history are readable with less scrolling */
.player-container.lyrics-open .player-right,
.player-container.history-open .player-right {
  min-height: min(945px, 62vh);
}

@media (max-width: 768px) {
  .player-container.lyrics-open .player-right,
  .player-container.history-open .player-right {
    /* Keep centered layout and reduce open-panel height on smaller screens too */
    min-height: min(50vh, 448px);
    width: 100%;
  }

  /* Mobile interaction model:
     - default: centered station/song/artist under cover
     - on lyrics/history open: cover shrinks and moves up to free vertical space */
  .player-interface {
    gap: 18px;
    align-items: center;
  }

  .player-left {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .player-right {
    width: 100%;
    align-items: center;
  }

  .song-info {
    width: 100%;
    text-align: center;
    margin-bottom: 0;
  }

  .song-info .current-station,
  .current-song,
  .current-artist {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }

  .player-container.lyrics-open .main-artwork,
  .player-container.history-open .main-artwork {
    width: 190px;
    height: 190px;
    transform: translateY(-12px) scale(0.96);
  }

  .player-container.lyrics-open .player-left,
  .player-container.history-open .player-left {
    transform: translateY(-10px);
  }

  .player-container.lyrics-open .cover-meta,
  .player-container.history-open .cover-meta {
    opacity: 0;
    pointer-events: none;
  }

  .player-container.lyrics-open .song-info,
  .player-container.history-open .song-info {
    opacity: 0;
    max-height: 0;
    margin: 0;
    overflow: hidden;
  }
}

@media (hover: none) and (pointer: coarse) {
  /* Prevent hover scale from fighting open/close animation on touch devices */
  .main-artwork:hover {
    transform: none;
  }
}

.cover-meta-song {
  font-size: clamp(0.85rem, 1.5vw, 1.05rem);
  font-weight: 700;
  color: #f1f5f9;
  margin: 0 0 4px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 460px;
}

.cover-meta-artist {
  font-size: clamp(0.75rem, 1.2vw, 0.9rem);
  font-weight: 400;
  color: #94a3b8;
  margin: 0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 460px;
}

/* ── Lyrics text ─────────────────────────────────────────────────────── */
.lyrics-text {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  line-height: 2.1;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  font-weight: 400;
  color: #e2e8f0;
  font-family: "Poppins", sans-serif;
  scrollbar-gutter: stable both-edges;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 252, 248, 0.52) transparent;
}

/* Glass-style thumb only — no track fill (content shows through) */
.lyrics-text::-webkit-scrollbar {
  width: 8px;
}

.lyrics-text::-webkit-scrollbar-corner {
  background: transparent;
}

.lyrics-text::-webkit-scrollbar-track {
  background: transparent;
}

.lyrics-text::-webkit-scrollbar-thumb {
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.58) 0%,
    rgba(255, 255, 255, 0.26) 48%,
    rgba(230, 240, 255, 0.2) 100%
  );
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.6),
    0 2px 12px rgba(15, 23, 42, 0.45);
}

.lyrics-text::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.75) 0%,
    rgba(255, 255, 255, 0.38) 100%
  );
  border-color: rgba(255, 255, 255, 0.55);
}

/* ── History panel heading ───────────────────────────────────────────── */
.history-panel-heading {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
  margin: 0 0 18px;
  font-family: "Poppins", sans-serif;
  flex-shrink: 0;
}

/* History remains a classic scrollable list (cover -> title/artist -> buttons) */
.history-panel {
  padding-top: 2px;
}

.history-panel .history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  margin: 0;
  scrollbar-gutter: stable both-edges;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 252, 248, 0.52) transparent;
}

.history-panel .history-list::-webkit-scrollbar {
  width: 8px;
}

.history-panel .history-list::-webkit-scrollbar-corner {
  background: transparent;
}

.history-panel .history-list::-webkit-scrollbar-track {
  background: transparent;
}

.history-panel .history-list::-webkit-scrollbar-thumb {
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.58) 0%,
    rgba(255, 255, 255, 0.26) 48%,
    rgba(230, 240, 255, 0.2) 100%
  );
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.6),
    0 2px 12px rgba(15, 23, 42, 0.45);
}

.history-panel .history-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.75) 0%,
    rgba(255, 255, 255, 0.38) 100%
  );
  border-color: rgba(255, 255, 255, 0.55);
}

.history-panel .music-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.history-panel .streaming-buttons {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.history-panel .streaming-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  box-shadow: none;
  transform: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.history-panel .streaming-btn:hover {
  transform: none;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.history-panel .streaming-btn i {
  font-size: 0.82rem;
}

.history-panel .streaming-btn.apple-music i { color: rgba(252, 60, 68, 0.95); }
.history-panel .streaming-btn.spotify i { color: rgba(30, 215, 96, 0.95); }
.history-panel .streaming-btn.youtube i { color: rgba(255, 0, 0, 0.95); }
.history-panel .streaming-btn.lyrics-btn i { color: rgba(171, 125, 255, 0.95); }

.history-panel .streaming-btn.apple-music,
.history-panel .streaming-btn.spotify,
.history-panel .streaming-btn.youtube,
.history-panel .streaming-btn.lyrics-btn {
  background: rgba(255, 255, 255, 0.09) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

/* Robust history card layout (prevents oversized artwork and broken flow) */
.history-panel .history-item {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 10px 10px 12px;
  border-radius: 12px;
  background: rgba(6, 12, 34, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.history-panel .cover-historic {
  width: 84px;
  height: 84px;
  border-radius: 10px;
  overflow: hidden;
  flex: 0 0 84px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.history-panel .cover-historic img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-panel .music-info .song,
.history-panel .music-info .artist {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-panel .music-info .song {
  font-size: 1rem;
  font-weight: 650;
  color: #f8fafc;
  line-height: 1.25;
}

.history-panel .music-info .artist {
  margin-top: 2px;
  font-size: 0.92rem;
  color: #b9c5dc;
}

.history-panel .music-info .played-time {
  margin-top: 4px;
  font-size: 0.78rem;
  color: #8ea0bf;
}

/* ── Reduced motion ─────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .lyrics-panel,
  .history-panel,
  .song-info,
  .cover-meta {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}


.lyrics-text.lyrics-text--message {
  color: #94a3b8;
  font-style: italic;
  line-height: 1.65;
}

.lyrics-text p {
  margin: 0 0 1em;
}

.lyrics-text p:last-child {
  margin-bottom: 0;
}

.lyrics-text.loading {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 8px;
}

.lyrics-footer {
  flex-shrink: 0;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  max-width: 42em;
}

.lyrics-footer[hidden] {
  display: none !important;
}

.lyrics-footer .lyrics-writers,
.lyrics-footer .lyrics-attribution {
  margin: 0;
  font-size: clamp(0.75rem, 1.4vw, 0.8125rem);
  line-height: 1.55;
  color: #94a3b8;
  font-family: "Poppins", sans-serif;
}

.lyrics-footer .lyrics-writers {
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 8px;
}

.lyrics-footer .lyrics-writers:empty,
.lyrics-footer .lyrics-attribution:empty {
  display: none;
}

.lyrics-panel .lyrics-loading {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.lyrics-panel .lyrics-skeleton-line {
  height: 14px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06) 25%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(255, 255, 255, 0.06) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
  width: 100%;
}

.lyrics-panel .lyrics-skeleton-line.short {
  width: 72%;
}

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

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@media (max-width: 480px) {
  .lyrics-text {
    font-size: 0.9375rem;
    line-height: 1.75;
  }
}

.cover-site {
  position: fixed;
  /* Paint beyond viewport edges so iOS safe areas get the same gradient */
  top: calc(-1 * env(safe-area-inset-top, 0px));
  right: 0;
  bottom: calc(-1 * env(safe-area-inset-bottom, 0px));
  left: 0;
  width: auto;
  height: auto;
  min-height: 100svh;
  min-height: 100%;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  overflow: hidden;
  background: linear-gradient(to bottom right, #0f172a 0%, #1e1b4b 40%, #111827 100%);
  z-index: 1;
}

/* Web Audio visualizer: above base frost, below light top frost (Player.cshtml stack) */
.player-bottom-bar-viz .player-ambient-viz {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  opacity: 0;
  filter: saturate(125%) contrast(1.05);
  -webkit-filter: saturate(125%) contrast(1.05);
  transition: opacity 0.55s ease, filter 0.55s ease;
}

.player-bottom-bar.viz-active .player-bottom-bar-viz .player-ambient-viz {
  opacity: 0.94;
  filter: saturate(135%) contrast(1.08);
  -webkit-filter: saturate(135%) contrast(1.08);
}

.player-bottom-bar:not(.viz-active) .player-bottom-bar-viz .player-ambient-viz {
  opacity: 0;
}

/* Lava-lamp style slow blobs */
.player-backdrop-blobs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.backdrop-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  -webkit-filter: blur(72px);
  opacity: 0.55;
  mix-blend-mode: screen;
  will-change: transform;
}

.backdrop-blob--1 {
  width: min(85vw, 720px);
  height: min(85vw, 720px);
  left: -18%;
  top: -12%;
  background: radial-gradient(
    circle at 35% 40%,
    rgba(56, 189, 248, 0.55) 0%,
    rgba(99, 102, 241, 0.35) 45%,
    transparent 68%
  );
  animation: backdropBlobDrift1 22s ease-in-out infinite alternate;
}

.backdrop-blob--2 {
  width: min(75vw, 640px);
  height: min(75vw, 640px);
  right: -22%;
  top: 8%;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(244, 114, 182, 0.45) 0%,
    rgba(168, 85, 247, 0.35) 50%,
    transparent 70%
  );
  animation: backdropBlobDrift2 26s ease-in-out infinite alternate;
}

.backdrop-blob--3 {
  width: min(90vw, 780px);
  height: min(90vw, 780px);
  left: 5%;
  bottom: -35%;
  background: radial-gradient(
    circle at 45% 35%,
    rgba(34, 211, 238, 0.4) 0%,
    rgba(59, 130, 246, 0.3) 55%,
    transparent 72%
  );
  animation: backdropBlobDrift3 30s ease-in-out infinite alternate;
}

.backdrop-blob--4 {
  width: min(55vw, 480px);
  height: min(55vw, 480px);
  right: 10%;
  bottom: 5%;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(251, 191, 36, 0.22) 0%,
    rgba(249, 115, 22, 0.28) 45%,
    transparent 65%
  );
  animation: backdropBlobDrift4 18s ease-in-out infinite alternate;
}

@keyframes backdropBlobDrift1 {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  100% {
    transform: translate(12%, 14%) scale(1.12) rotate(8deg);
  }
}

@keyframes backdropBlobDrift2 {
  0% {
    transform: translate(0, 0) scale(1.05) rotate(0deg);
  }
  100% {
    transform: translate(-10%, 18%) scale(1.08) rotate(-6deg);
  }
}

@keyframes backdropBlobDrift3 {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  100% {
    transform: translate(-8%, -12%) scale(1.15) rotate(5deg);
  }
}

@keyframes backdropBlobDrift4 {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(16%, -10%) scale(1.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .backdrop-blob {
    animation: none !important;
    opacity: 0.35;
  }
}

.bg-mask {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.62) 0%, rgba(30, 27, 75, 0.45) 50%, rgba(17, 24, 39, 0.72) 100%);
  z-index: 2;
}

.bg-mask::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('data:image/svg+xml,%3Csvg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Cg fill="%23374151" fill-opacity="0.1"%3E%3Ccircle cx="30" cy="30" r="1"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
  opacity: 0.3;
  z-index: 1;
}

main {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 1100px;
  padding: 30px;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.5s forwards;
}

.container {
  width: 100%;
}

/* Spotify-style Player Interface */
.player-interface {
  display: flex;
  align-items: center;
  gap: 60px;
  width: 100%;
}

/* Left Side: Artwork */
.player-left {
  flex-shrink: 0;
}

.main-artwork {
  width: 450px;
  height: 450px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  transition: transform 0.3s ease, width 0.44s cubic-bezier(0.22, 1, 0.36, 1), height 0.44s cubic-bezier(0.22, 1, 0.36, 1);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.main-artwork:hover {
  transform: scale(1.02);
}

/* Same grid cell as cover — stacks above artwork (see-through + text-shadow) */
.main-artwork .watermark {
  grid-column: 1;
  grid-row: 1;
  z-index: 1;
  pointer-events: none;
}

/* Stream beacon upper-left on cover (same slot station name had) */
.main-artwork .stream-status-beacon {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  justify-self: start;
  position: relative;
  z-index: 3;
  margin: 0.85rem 0 0 0.85rem;
  margin-bottom: 0;
  max-width: calc(100% - 1.7rem);
  flex-wrap: wrap;
}

/* Station name in right column (was beacon slot): see-through + blurred text-shadow */
.song-info .current-station {
  margin: 0 0 18px 0;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  font-size: clamp(1.1875rem, 3.125vw, 1.6rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.35;
  text-align: left;
  max-width: 100%;
  pointer-events: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 0 1px rgba(255, 255, 255, 0.75),
    0 0 4px rgba(255, 255, 255, 0.5),
    0 0 10px rgba(255, 255, 255, 0.35),
    0 0 18px rgba(255, 255, 255, 0.2);
}

.song-info .current-station .artist-skeleton {
  max-width: 12.5rem;
  height: 1.25rem;
  margin-left: 0;
  display: block;
  -webkit-text-fill-color: unset;
  text-shadow: none;
}

#currentCoverArt {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  z-index: 0;
  background: url("../images/sauticast_placeholder.svg") no-repeat center;
  background-size: cover;
  transition: background-image 1s ease;
}

/* Right Side: Song Info and Controls — also a stacking context for inline panels */
.player-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

/* Song Information */
.song-info {
  margin-bottom: 40px;
  text-align: left;
}

/* Stream on-air / offline beacon */
.stream-status-beacon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.55);
}

.stream-status-beacon__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.25);
}

.stream-status-beacon--unknown .stream-status-beacon__dot {
  animation: stream-beacon-pulse-muted 2s ease-in-out infinite;
}

.stream-status-beacon--online {
  color: rgba(187, 247, 208, 0.95);
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(34, 197, 94, 0.12);
}

.stream-status-beacon--online .stream-status-beacon__dot {
  background: #4ade80;
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.65);
  animation: stream-beacon-pulse-green 1.6s ease-in-out infinite;
}

.stream-status-beacon--offline {
  color: rgba(254, 202, 202, 0.95);
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(239, 68, 68, 0.12);
}

.stream-status-beacon--offline .stream-status-beacon__dot {
  background: #f87171;
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.55);
  animation: stream-beacon-pulse-red 1.4s ease-in-out infinite;
}

.stream-status-beacon--full {
  color: rgba(254, 240, 138, 0.96);
  border-color: rgba(250, 204, 21, 0.42);
  background: rgba(234, 179, 8, 0.16);
}

.stream-status-beacon--full .stream-status-beacon__dot {
  background: #facc15;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.55);
  animation: stream-beacon-pulse-gold 1.5s ease-in-out infinite;
}

@keyframes stream-beacon-pulse-green {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 8px rgba(74, 222, 128, 0);
  }
}

@keyframes stream-beacon-pulse-red {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.5);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 8px rgba(248, 113, 113, 0);
  }
}

@keyframes stream-beacon-pulse-gold {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.5);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 8px rgba(250, 204, 21, 0);
  }
}

@keyframes stream-beacon-pulse-muted {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .stream-status-beacon__dot,
  .stream-status-beacon--unknown .stream-status-beacon__dot {
    animation: none !important;
  }
}

.current-song {
  font-size: 48px;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0 0 15px 0;
  letter-spacing: 1px;
  line-height: 1.2;
  /* Line clamp for 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.current-artist {
  font-size: 24px;
  font-weight: 400;
  color: #ccc;
  margin: 0;
  text-transform: capitalize;
  line-height: 1.2;
  /* Line clamp for 1 line */
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Player Controls */
.player-controls {
  display: flex;
  flex-direction: column;
  gap: 30px;
  align-items: flex-start;
}

.btn-play {
  background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
  border: none;
  color: #000;
  padding: 18px 45px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 50px;
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 160px;
  justify-content: center;
  height: 60px;
}

.btn-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(255, 255, 255, 0.3);
}

.btn-play:active {
  transform: translateY(0);
}

/* Volume Control */
.volume-control {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  max-width: 400px;
}

.volume-icon {
  font-size: 22px;
  color: #ccc;
}

.volume-slide {
  flex: 1;
}

.volume-indicator {
  font-size: 16px;
  color: #ccc;
  min-width: 55px;
  text-align: right;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 25px;
  transition: all 0.3s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

/* Range Input Styling */
input[type="range"] {
  -webkit-appearance: none;
  background: transparent;
  width: 100%;
  height: 7px;
}

input[type="range"]:focus {
  outline: none;
}

input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 7px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

input[type="range"]::-webkit-slider-thumb {
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-moz-range-track {
  width: 100%;
  height: 7px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  border: none;
}

input[type="range"]::-moz-range-thumb {
  border: none;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Modal Styling */
.modal-content {
  background-color: rgba(0, 0, 0, 0.95);
  color: #fff;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-content .btn-primary {
  background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
  color: #000;
  border: none;
  border-radius: 25px;
  font-weight: 600;
}

.close {
  color: #fff;
  opacity: 0.8;
}

.close:hover {
  color: #fff;
  opacity: 1;
}

/* Streaming Service Buttons */
.streaming-buttons {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}

.streaming-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.streaming-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  text-decoration: none;
  color: #fff;
}

.lyrics-btn {
  background: rgba(138, 43, 226, 0.8) !important;
  border-color: rgba(138, 43, 226, 0.5) !important;
}

.lyrics-btn:hover {
  background: rgba(138, 43, 226, 1) !important;
  border-color: rgba(138, 43, 226, 0.8) !important;
}

.streaming-btn.apple-music {
  background: linear-gradient(135deg, #fc3c44 0%, #000 100%);
  border-color: #fc3c44;
}

.streaming-btn.apple-music:hover {
  background: linear-gradient(135deg, #ff5a62 0%, #333 100%);
  color: #fff;
}

.streaming-btn.spotify {
  background: linear-gradient(135deg, #1db954 0%, #191414 100%);
  border-color: #1db954;
}

.streaming-btn.spotify:hover {
  background: linear-gradient(135deg, #1ed760 0%, #333 100%);
  color: #fff;
}

.streaming-btn.youtube {
  background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
  border-color: #ff0000;
}

.streaming-btn.youtube:hover {
  background: linear-gradient(135deg, #ff3333 0%, #ff0000 100%);
  color: #fff;
}

/* Modal backdrop for better contrast */
.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.8);
}

/* Bootstrap lyrics modal — same slate theme as player */
#modalLyrics .modal-dialog {
  max-width: 560px;
}

#modalLyrics .modal-content {
  background: linear-gradient(160deg, rgba(17, 24, 39, 0.98) 0%, rgba(30, 41, 59, 0.99) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55);
}

#modalLyrics .modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 1.25rem;
}

#modalLyrics .modal-title {
  font-family: "Poppins", sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #f9fafb;
}

#modalLyrics .modal-body {
  font-family: "Poppins", sans-serif;
  font-size: 1rem;
  line-height: 1.8;
  color: #e5e7eb;
  max-height: min(60vh, 420px);
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
}

#modalLyrics .modal-body .lyrics-skeleton-line {
  height: 14px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06) 25%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(255, 255, 255, 0.06) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
  margin-bottom: 12px;
}

#modalLyrics .close {
  color: #94a3b8;
  text-shadow: none;
  opacity: 1;
  font-size: 1.5rem;
  line-height: 1;
}

#modalLyrics .close:hover {
  color: #f9fafb;
}

/* Responsive Design */
@media (max-width: 768px) {
  main {
    max-width: 100%;
    padding: 15px;
  }

  .player-interface {
    flex-direction: column;
    gap: 30px;
    text-align: center;
  }

  .player-right {
    align-items: center;
  }

  /* Keep history metadata leading-aligned on mobile */
  .history-panel .history-item,
  .history-panel .music-info,
  .history-panel .music-info .song,
  .history-panel .music-info .artist,
  .history-panel .music-info .played-time,
  .history-panel .streaming-buttons {
    text-align: left;
    justify-content: flex-start;
    align-items: flex-start;
  }

  .song-info {
    text-align: center;
    margin-bottom: 30px;
  }

  .main-artwork .stream-status-beacon {
    margin: 0.65rem 0 0 0.65rem;
    margin-bottom: 0;
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  .player-controls {
    align-items: center;
    width: 100%;
  }

  .main-artwork {
    width: 280px;
    height: 280px;
  }

  .song-info .current-station {
    font-size: clamp(1.025rem, 4vw, 1.3125rem);
    margin-bottom: 16px;
  }

  .current-song {
    font-size: 28px;
  }

  .current-artist {
    font-size: 18px;
  }

  .action-buttons {
    justify-content: center;
    width: 100%;
  }

  .btn-secondary {
    flex: 1;
    justify-content: center;
    max-width: 150px;
  }
}

@media (max-width: 480px) {
  .main-artwork {
    width: 250px;
    height: 250px;
  }

  .main-artwork .stream-status-beacon {
    margin: 0.5rem 0 0 0.5rem;
    margin-bottom: 0;
  }

  .song-info .current-station {
    font-size: clamp(0.925rem, 4.375vw, 1.15rem);
  }

  .current-song {
    font-size: 24px;
  }

  .current-artist {
    font-size: 16px;
  }

  .action-buttons {
    flex-direction: column;
    gap: 12px;
  }

  .btn-secondary {
    max-width: none;
  }
}

/* Loading Animations */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

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

@keyframes loadingProgress {
  0% {
    width: 0%;
  }
  50% {
    width: 70%;
  }
  100% {
    width: 100%;
  }
}

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

/* Animation Classes */
.animated {
  animation-duration: 1s;
  animation-fill-mode: both;
}

.flipInY {
  animation-name: flipInY;
}

.bounceInLeft {
  animation-name: bounceInLeft;
}

.slideInRight {
  animation-name: slideInRight;
}

@keyframes flipInY {
  from {
    transform: perspective(400px) rotateY(90deg);
    opacity: 0;
  }
  40% {
    transform: perspective(400px) rotateY(-20deg);
  }
  60% {
    transform: perspective(400px) rotateY(10deg);
  }
  80% {
    transform: perspective(400px) rotateY(-5deg);
  }
  to {
    transform: perspective(400px);
    opacity: 1;
  }
}

@keyframes bounceInLeft {
  from,
  60%,
  75%,
  90%,
  to {
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1.0);
  }
  0% {
    opacity: 0;
    transform: translate3d(-3000px, 0, 0);
  }
  60% {
    opacity: 1;
    transform: translate3d(25px, 0, 0);
  }
  75% {
    transform: translate3d(-10px, 0, 0);
  }
  90% {
    transform: translate3d(5px, 0, 0);
  }
  to {
    transform: none;
  }
}

@keyframes slideInRight {
  from {
    transform: translate3d(100%, 0, 0);
    visibility: visible;
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

/* Mobile override (final): center text + guaranteed cover shrink/raise on lyrics/history. */
@media (max-width: 768px) {
  .player-left {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.46s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .main-artwork {
    width: 280px;
    height: 280px;
    transition:
      width 0.46s cubic-bezier(0.22, 1, 0.36, 1),
      height 0.46s cubic-bezier(0.22, 1, 0.36, 1),
      transform 0.46s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .song-info {
    width: 100%;
    text-align: center;
    transition: opacity 0.34s ease, max-height 0.34s ease, margin 0.34s ease;
  }

  .song-info .current-station,
  .song-info .current-song,
  .song-info .current-artist,
  .current-song,
  .current-artist {
    text-align: center !important;
    margin-left: auto;
    margin-right: auto;
  }

  .song-info .current-station {
    max-width: min(92vw, 520px);
  }

  .player-container.lyrics-open .main-artwork,
  .player-container.history-open .main-artwork {
    width: 140px !important;   /* 50% of 280px mobile default */
    height: 140px !important;  /* 50% of 280px mobile default */
    transform: translateY(-20px);
  }

  .player-container.lyrics-open .player-left,
  .player-container.history-open .player-left {
    transform: translateY(-16px);
  }

  .player-container.lyrics-open .song-info,
  .player-container.history-open .song-info {
    opacity: 0;
    max-height: 0;
    margin: 0;
    overflow: hidden;
    pointer-events: none;
  }
}

@media (max-width: 480px) {
  .player-container.lyrics-open .main-artwork,
  .player-container.history-open .main-artwork {
    width: 125px !important;   /* 50% of 250px small-phone default */
    height: 125px !important;  /* 50% of 250px small-phone default */
    transform: translateY(-18px);
  }
}
