:root {
  --header-background: #1d4ed8;
  --brand-primary: #1d4ed8;
  --brand-secondary: #0ea5e9;
  --brand-accent: #22c55e;
}

.app-body {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.16), transparent 40%),
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.12), transparent 34%),
    #f2f6ff;
  color: #0f172a;
}

.app-navbar {
  background: var(--header-background);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25);
}

.app-brand {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.app-station-logo {
  height: 34px;
  width: auto;
  border-radius: 0.35rem;
}

.app-navbar .nav-link {
  color: rgba(255, 255, 255, 0.86);
}

.app-navbar .nav-link:hover {
  color: #ffffff;
}

.app-navbar .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.55);
  padding: 0.35rem 0.5rem;
}

.app-navbar .navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.18);
}

.app-navbar .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,0.95%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.theme-toggle-btn {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.92);
  background: rgba(15, 23, 42, 0.45);
  font-weight: 600;
}

.theme-toggle-btn:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.65);
}

.metric {
  font-size: 1.4rem;
  font-weight: 700;
}

.page-hero {
  background: linear-gradient(130deg, var(--brand-primary) 0%, var(--brand-secondary) 55%, var(--brand-accent) 130%);
  border-radius: 1rem;
  color: #ffffff;
  box-shadow: 0 18px 32px rgba(29, 78, 216, 0.28);
}

.glass-panel {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 1rem;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.section-title {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.episode-card {
  border: none;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.episode-meta {
  color: #475569;
  font-size: 0.9rem;
}

.player-shell {
  border: 1px solid #dbe7ff;
  background: linear-gradient(180deg, #f8fbff, #edf4ff);
  border-radius: 0.85rem;
  padding: 0.65rem 0.75rem 0.8rem;
}

.player-eq {
  height: 44px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin-top: 0.45rem;
  padding: 0.35rem 0.4rem 0.25rem;
  border-radius: 0.65rem;
  background: rgba(148, 163, 184, 0.12);
}

.player-eq-bar {
  width: 5px;
  min-height: 18%;
  height: var(--eq-base);
  border-radius: 999px;
  background: linear-gradient(180deg, #38bdf8, #1d4ed8);
  transform-origin: bottom;
  animation-name: eqPulse;
  animation-duration: var(--eq-duration);
  animation-delay: var(--eq-delay);
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
  animation-play-state: paused;
  opacity: 0.65;
}

.player-shell.is-playing .player-eq-bar {
  animation-play-state: running;
  opacity: 1;
}

@keyframes eqPulse {
  from {
    transform: scaleY(0.3);
  }
  to {
    transform: scaleY(1);
  }
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.player-btn {
  min-width: 88px;
  border-radius: 999px;
  font-weight: 600;
  border: none;
  background: linear-gradient(130deg, var(--brand-primary), var(--brand-secondary));
  color: #fff;
}

.player-btn:hover {
  color: #fff;
  filter: brightness(1.06);
}

.player-skip-btn {
  min-width: 58px;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.28);
  font-weight: 600;
  background: rgba(59, 130, 246, 0.08);
  color: #1e3a8a;
}

.player-skip-btn:hover {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.14);
}

.player-range {
  flex: 1;
  margin: 0;
}

.player-time {
  min-width: 92px;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #334155;
}

.progress {
  height: 6px;
  border-radius: 999px;
  background-color: #dbeafe;
}

.js-progress {
  width: 0;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
}

.tag-chip {
  background: #e2e8f0;
  color: #0f172a;
  font-weight: 500;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
}

.player-share-actions {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.6rem;
}

.player-share-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.8);
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.player-share-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.player-share-btn-facebook {
  color: #1877f2;
}

.player-share-btn-whatsapp {
  color: #25d366;
}

.now-playing-strip {
  display: grid;
  gap: 0.15rem;
  margin-bottom: 1rem;
  padding: 0.7rem 0.9rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

.now-playing-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6366f1;
  font-weight: 700;
}

.now-playing-title {
  font-size: 1rem;
  font-weight: 700;
}

.now-playing-meta {
  color: #334155;
  font-size: 0.86rem;
}

.now-playing-tags {
  color: #475569;
  font-size: 0.82rem;
}

.app-body.has-mini-player {
  padding-bottom: 92px;
}

.mini-player {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(760px, calc(100% - 20px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.65rem 0.8rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(248, 250, 252, 0.95);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.22);
  z-index: 1040;
  backdrop-filter: blur(8px);
}

.mini-player-main {
  min-width: 0;
}

.mini-player-title {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-player-time {
  color: #475569;
  font-size: 0.82rem;
}

.mini-player-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.mini-player-btn {
  min-width: 58px;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  background: rgba(219, 234, 254, 0.7);
  color: #1d4ed8;
  font-weight: 600;
}

.public-dark {
  background:
    radial-gradient(circle at 85% -10%, rgba(56, 189, 248, 0.2), transparent 46%),
    radial-gradient(circle at 5% -15%, rgba(99, 102, 241, 0.3), transparent 40%),
    #040712;
  color: #e2e8f0;
}

.public-dark .app-navbar {
  background: var(--header-background);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.public-dark .page-hero {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 20px 44px rgba(2, 6, 23, 0.5);
}

.public-dark .glass-panel {
  background: rgba(10, 16, 32, 0.75);
  border: 1px solid rgba(100, 116, 139, 0.35);
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.45);
}

.public-dark .episode-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(9, 14, 27, 0.95));
  border: 1px solid rgba(100, 116, 139, 0.35);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.5);
}

.public-dark .episode-meta,
.public-dark .small.text-muted,
.public-dark .text-muted {
  color: #94a3b8 !important;
}

.public-dark .player-shell {
  border: 1px solid rgba(99, 102, 241, 0.35);
  background: linear-gradient(180deg, rgba(20, 26, 45, 0.95), rgba(13, 18, 34, 0.95));
}

.public-dark .player-eq {
  background: rgba(15, 23, 42, 0.6);
}

.public-dark .player-eq-bar {
  background: linear-gradient(180deg, #22d3ee, #818cf8);
}

.public-dark .player-btn {
  background: linear-gradient(130deg, var(--brand-primary), var(--brand-secondary));
}

.public-dark .player-skip-btn {
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(125, 211, 252, 0.32);
}

.public-dark .player-time {
  color: #cbd5e1;
}

.public-dark .player-share-btn {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.65);
}

.public-dark .player-share-btn-facebook {
  color: #60a5fa;
}

.public-dark .player-share-btn-whatsapp {
  color: #4ade80;
}

.public-dark .progress {
  background-color: rgba(51, 65, 85, 0.8);
}

.public-dark .js-progress {
  background: linear-gradient(90deg, var(--brand-secondary), var(--brand-primary));
}

.public-dark .form-control,
.public-dark .form-select {
  background-color: rgba(15, 23, 42, 0.8);
  border-color: rgba(100, 116, 139, 0.55);
  color: #e2e8f0;
}

.public-dark .form-control::placeholder {
  color: #94a3b8;
}

.public-dark .form-control:focus,
.public-dark .form-select:focus {
  background-color: rgba(15, 23, 42, 0.95);
  border-color: rgba(56, 189, 248, 0.8);
  color: #f8fafc;
  box-shadow: 0 0 0 0.25rem rgba(56, 189, 248, 0.15);
}

.public-dark a:not(.btn):not(.nav-link) {
  color: #7dd3fc;
}

.public-dark .theme-toggle-btn {
  border-color: rgba(148, 163, 184, 0.55);
  background: rgba(15, 23, 42, 0.72);
}

.public-dark .text-dark {
  color: #e2e8f0 !important;
}

.public-dark .tag-chip {
  background: rgba(99, 102, 241, 0.26);
  color: #e0e7ff;
}

.public-dark .now-playing-strip {
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(12, 18, 34, 0.82);
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.45);
}

.public-dark .now-playing-label {
  color: #93c5fd;
}

.public-dark .now-playing-meta {
  color: #cbd5e1;
}

.public-dark .now-playing-tags {
  color: #94a3b8;
}

.public-dark .mini-player {
  border-color: rgba(71, 85, 105, 0.75);
  background: rgba(6, 10, 20, 0.92);
  box-shadow: 0 16px 36px rgba(2, 6, 23, 0.7);
}

.public-dark .mini-player-time {
  color: #94a3b8;
}

.public-dark .mini-player-btn {
  color: #c7d2fe;
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(30, 41, 59, 0.85);
}

.public-dark footer .text-muted {
  color: #94a3b8 !important;
}

.flash-autodismiss {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.flash-autodismiss.is-hiding {
  opacity: 0;
  transform: translateY(-6px);
}

.log {
  max-height: 400px;
  overflow: auto;
  font-size: 12px;
}

@media (max-width: 991.98px) {
  .app-navbar .container {
    row-gap: 0.5rem;
  }

  .app-navbar .navbar-collapse {
    padding-top: 0.45rem;
  }

  .app-navbar .navbar-nav {
    gap: 0.1rem;
  }

  .app-navbar .navbar-nav .nav-link {
    padding: 0.42rem 0.2rem;
  }

  .app-navbar .theme-toggle-btn {
    margin: 0.45rem 0 0.1rem;
    width: fit-content;
  }
}

@media (max-width: 767.98px) {
  .page-hero {
    padding: 1rem !important;
  }

  .player-controls {
    flex-wrap: wrap;
  }

  .player-range {
    order: 2;
    width: 100%;
  }

  .player-time {
    order: 3;
    min-width: 0;
    width: 100%;
    justify-content: flex-end;
    gap: 0.45rem;
  }

  .mini-player {
    width: calc(100% - 14px);
    left: 7px;
    transform: none;
    bottom: 8px;
    padding: 0.55rem 0.6rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
  }

  .mini-player-actions {
    justify-content: space-between;
  }

  .mini-player-btn {
    flex: 1;
    min-width: 0;
  }
}
