/* ==========================================================
   GAKONDO RADIO — STYLES
   Palette + type are re-themeable via CSS custom properties,
   set at runtime from config.js (see js/app.js applyTheme()).
   ========================================================== */

:root {
  --bg: #1B1613;
  --panel: #231C18;
  --panel-raised: #2E2622;
  --ivory: #F5EDE1;
  --terracotta: #C4531D;
  --brick: #8A2E1F;
  --gold: #D9A441;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius-lg: 28px;
  --radius-md: 16px;
  --radius-sm: 10px;

  --shadow-panel: 0 20px 50px -20px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: radial-gradient(120% 90% at 50% -10%, #2a2019 0%, var(--bg) 55%);
  color: var(--ivory);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh; /* accounts for mobile browser chrome / standalone PWA viewport */
  display: flex;
  flex-direction: column;
}

.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

button { font-family: inherit; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(27, 22, 19, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(245, 237, 225, 0.08);
}

.header-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 20px;
  padding-top: calc(14px + env(safe-area-inset-top));
  padding-left: calc(20px + env(safe-area-inset-left));
  padding-right: calc(20px + env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo { border-radius: 50%; display: block; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-tagline {
  font-size: 0.72rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions { display: flex; align-items: center; gap: 10px; }

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  background: var(--brick);
  color: var(--ivory);
  padding: 6px 10px 6px 8px;
  border-radius: 999px;
}
.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #ff6b4a;
  box-shadow: 0 0 0 0 rgba(255,107,74,0.6);
  animation: pulse 1.8s infinite;
}
.live-badge.offline { background: var(--panel-raised); color: rgba(245,237,225,0.5); }
.live-badge.offline .live-dot { background: rgba(245,237,225,0.4); animation: none; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,107,74,0.55); }
  70% { box-shadow: 0 0 0 7px rgba(255,107,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,107,74,0); }
}

.icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(245,237,225,0.15);
  background: var(--panel-raised);
  color: var(--ivory);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.icon-btn:hover { background: var(--brick); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.small { width: 32px; height: 32px; }
.icon-btn:focus-visible, .pill-btn:focus-visible, .tab-btn:focus-visible,
.play-btn:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------------- Main / Player ---------------- */
.app-main {
  flex: 1;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 20px 40px;
  padding-left: calc(20px + env(safe-area-inset-left));
  padding-right: calc(20px + env(safe-area-inset-right));
  position: relative;
  z-index: 1;
}

.player-section { display: flex; justify-content: center; margin-bottom: 28px; }

.player-card {
  width: 100%;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg) 100%);
  border: 1px solid rgba(245,237,225,0.07);
  border-radius: var(--radius-lg);
  padding: 32px 24px 24px;
  box-shadow: var(--shadow-panel);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.art-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  margin-bottom: 22px;
}

.imigongo-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: center;
}
.imigongo-ring.spin {
  animation: spin 26s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .imigongo-ring.spin { animation: none; }
}
@keyframes spin { to { transform: rotate(360deg); } }

.art-disc {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  height: 60%;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--gold);
  background: var(--panel-raised);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.cover-img { width: 100%; height: 100%; object-fit: cover; display: block; }

.now-playing-meta { margin-bottom: 22px; max-width: 100%; }
.np-eyebrow {
  margin: 0 0 4px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
}
.np-track {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.np-artist {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(245,237,225,0.65);
}

.transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-bottom: 20px;
  width: 100%;
}

.play-btn {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(155deg, var(--terracotta), var(--brick));
  color: var(--ivory);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 24px -6px rgba(196, 83, 29, 0.55);
  transition: transform .15s ease;
  flex-shrink: 0;
}
.play-btn:hover { transform: scale(1.04); }
.play-btn:active { transform: scale(0.96); }
.play-btn svg { padding-left: 2px; }
.play-btn #pauseIcon { padding-left: 0; }

.spin { animation: spin-icon 1s linear infinite; }
@keyframes spin-icon { to { transform: rotate(360deg); } }

.volume-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 180px;
}

.volume-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 999px;
  background: rgba(245,237,225,0.18);
  outline: none;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  border: 2px solid var(--bg);
}
.volume-slider::-moz-range-thumb {
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  border: 2px solid var(--bg);
}

.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(245,237,225,0.15);
  background: var(--panel-raised);
  color: var(--ivory);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.pill-btn:hover { background: var(--brick); }
.pill-btn:active { transform: scale(0.97); }
.pill-btn.ghost { background: transparent; border-color: rgba(245,237,225,0.25); }
.pill-btn.active-timer { background: var(--terracotta); border-color: var(--terracotta); }

.text-btn {
  background: none; border: none;
  color: rgba(245,237,225,0.55);
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 6px;
}

/* ---------------- Tabs ---------------- */
.tabs {
  display: flex;
  gap: 6px;
  background: var(--panel);
  border-radius: 999px;
  padding: 5px;
  margin-bottom: 18px;
  border: 1px solid rgba(245,237,225,0.06);
  overflow-x: auto;
}
.tab-btn {
  flex: 1;
  white-space: nowrap;
  background: none;
  border: none;
  color: rgba(245,237,225,0.6);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.tab-btn.active {
  background: linear-gradient(155deg, var(--terracotta), var(--brick));
  color: var(--ivory);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade-in .25s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* Schedule */
.schedule-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.schedule-item {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--panel);
  border: 1px solid rgba(245,237,225,0.06);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.schedule-time {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gold);
  min-width: 118px;
}
.schedule-details { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.schedule-show { font-weight: 700; font-size: 0.98rem; }
.schedule-host { font-size: 0.82rem; color: rgba(245,237,225,0.55); }
.schedule-days {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(245,237,225,0.45);
}

/* Podcasts */
.podcast-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.podcast-item {
  background: var(--panel);
  border: 1px solid rgba(245,237,225,0.06);
  border-radius: var(--radius-md);
  padding: 16px;
}
.podcast-title { margin: 0 0 4px; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.podcast-desc { margin: 0 0 10px; font-size: 0.85rem; color: rgba(245,237,225,0.6); }
.podcast-date { font-size: 0.72rem; color: var(--gold); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; display: block; }
.podcast-item audio { width: 100%; }
.podcast-item iframe { width: 100%; border: none; border-radius: var(--radius-sm); }

/* Chat */
.chat-frame {
  background: var(--panel);
  border: 1px solid rgba(245,237,225,0.06);
  border-radius: var(--radius-md);
  height: 420px;
  overflow: hidden;
}

/* About */
.about-content {
  background: var(--panel);
  border: 1px solid rgba(245,237,225,0.06);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}
.about-content h2 { font-family: var(--font-display); margin-top: 0; }
.social-row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.social-link {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--panel-raised);
  color: var(--ivory);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  transition: background .15s ease, transform .15s ease;
}
.social-link:hover { background: var(--terracotta); transform: translateY(-2px); }
.about-note { font-size: 0.82rem; color: rgba(245,237,225,0.5); margin: 0; }

/* ---------------- Footer ---------------- */
.site-footer {
  text-align: center;
  padding: 18px 20px 28px;
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
  font-size: 0.78rem;
  color: rgba(245,237,225,0.4);
}

/* ---------------- Sheets (modals) ---------------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  animation: fade-in .2s ease;
}
@media (min-width: 640px) {
  .sheet-backdrop { align-items: center; }
}

.sheet {
  background: var(--panel);
  border: 1px solid rgba(245,237,225,0.1);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px 22px 28px;
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
  padding-left: calc(22px + env(safe-area-inset-left));
  padding-right: calc(22px + env(safe-area-inset-right));
  width: 100%;
  max-width: 420px;
  text-align: center;
}
@media (min-width: 640px) {
  .sheet { border-radius: var(--radius-lg); }
}
.sheet h2 { font-family: var(--font-display); margin: 0 0 6px; }
.sheet-sub { margin: 0 0 16px; font-size: 0.85rem; color: rgba(245,237,225,0.55); }

.sheet-options { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 14px; }

.qr-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  background: var(--ivory);
  border-radius: var(--radius-md);
  padding: 16px;
}

.share-link-row { display: flex; gap: 8px; margin-bottom: 16px; }
.share-link-row input {
  flex: 1;
  background: var(--panel-raised);
  border: 1px solid rgba(245,237,225,0.15);
  border-radius: var(--radius-sm);
  color: var(--ivory);
  padding: 10px 12px;
  font-size: 0.82rem;
  min-width: 0;
}

/* ---------------- Utility ---------------- */
[hidden] { display: none !important; }

@media (max-width: 380px) {
  .art-wrap { width: 180px; height: 180px; }
  .np-track { font-size: 1.25rem; }
}
