/* ============================================================
   RADIO HIDAYAH — Main Stylesheet
   Brand Color: #3DB800 (Hijau Hidayah)
   ============================================================ */

:root {
  --green:       #3DB800;
  --green-light: #5DD100;
  --green-dark:  #2A8000;
  --green-glow:  rgba(61,184,0,0.35);
  --bg:          #0D0D0D;
  --bg2:         #141414;
  --card:        #1C1C1C;
  --card2:       #242424;
  --border:      rgba(61,184,0,0.18);
  --text:        #F0F0F0;
  --text2:       #A0A0A0;
  --text3:       #6A6A6A;
  --white:       #FFFFFF;
  --nav-h:       64px;
  --hdr-h:       56px;
  --radius:      16px;
  --radius-sm:   10px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Poppins', 'Tajawal', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: var(--nav-h);
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,13,13,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: var(--hdr-h);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 100%;
}
.header-logo { height: 36px; width: auto; object-fit: contain; }

.on-air-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(61,184,0,0.15);
  border: 1px solid var(--green);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 4px 10px;
  border-radius: 20px;
  opacity: 0;
  transition: opacity .4s;
}
.on-air-badge.visible { opacity: 1; }
.on-air-badge .dot {
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50% { opacity:.4; transform:scale(1.4); }
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  padding: 20px 16px 28px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.section-icon { font-size: 28px; }
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
}
.section-sub {
  font-size: 12px;
  color: var(--text2);
  margin-top: 2px;
}

/* ============================================================
   SECTION 1: AUDIO PLAYER
   ============================================================ */
.section-player { padding: 16px; }

.player-card {
  position: relative;
  background: linear-gradient(145deg, #1a2a0a 0%, #0f1f05 40%, #0D0D0D 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 60px rgba(61,184,0,0.08);
}
.player-bg-blur {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 0%, rgba(61,184,0,0.12) 0%, transparent 65%);
  pointer-events: none;
}
.player-content {
  position: relative;
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* Radio info */
.player-radio-info {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}
.radio-logo-wrap {
  position: relative;
  width: 72px; height: 72px;
  flex-shrink: 0;
}
.radio-logo-img {
  width: 72px; height: 72px;
  object-fit: contain;
  border-radius: 14px;
  background: #111;
  padding: 6px;
  position: relative; z-index: 2;
}
.radio-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid var(--green);
  top: 50%; left: 50%;
  transform: translate(-50%,-50%) scale(1);
  opacity: 0;
}
.radio-ring.ring1 { width: 90px; height: 90px; }
.radio-ring.ring2 { width: 110px; height: 110px; }
.radio-ring.ring3 { width: 130px; height: 130px; }
body.playing .radio-ring.ring1 { animation: ringPulse 2s ease-out infinite 0s; }
body.playing .radio-ring.ring2 { animation: ringPulse 2s ease-out infinite .5s; }
body.playing .radio-ring.ring3 { animation: ringPulse 2s ease-out infinite 1s; }
@keyframes ringPulse {
  0% { opacity:.5; transform:translate(-50%,-50%) scale(.8); }
  100% { opacity:0; transform:translate(-50%,-50%) scale(1.4); }
}

.radio-text { flex: 1; min-width: 0; }
.radio-name {
  font-size: 20px; font-weight: 700; color: var(--white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.radio-freq { font-size: 11px; color: var(--green); letter-spacing: .5px; margin-top: 2px; }
.radio-now {
  font-size: 12px; color: var(--text2);
  margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 200px;
}

/* Waveform */
.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 40px;
  width: 100%;
}
.waveform .bar {
  width: 3px;
  border-radius: 2px;
  background: var(--green);
  height: 4px;
  transition: height .2s;
}
body.playing .waveform .bar:nth-child(1)  { animation: wave 1.0s ease-in-out infinite 0.0s; }
body.playing .waveform .bar:nth-child(2)  { animation: wave 1.1s ease-in-out infinite 0.1s; }
body.playing .waveform .bar:nth-child(3)  { animation: wave 0.9s ease-in-out infinite 0.2s; }
body.playing .waveform .bar:nth-child(4)  { animation: wave 1.2s ease-in-out infinite 0.3s; }
body.playing .waveform .bar:nth-child(5)  { animation: wave 1.0s ease-in-out infinite 0.4s; }
body.playing .waveform .bar:nth-child(6)  { animation: wave 0.8s ease-in-out infinite 0.1s; }
body.playing .waveform .bar:nth-child(7)  { animation: wave 1.3s ease-in-out infinite 0.2s; }
body.playing .waveform .bar:nth-child(8)  { animation: wave 1.0s ease-in-out infinite 0.3s; }
body.playing .waveform .bar:nth-child(9)  { animation: wave 0.9s ease-in-out infinite 0.0s; }
body.playing .waveform .bar:nth-child(10) { animation: wave 1.1s ease-in-out infinite 0.4s; }
body.playing .waveform .bar:nth-child(11) { animation: wave 1.0s ease-in-out infinite 0.15s; }
body.playing .waveform .bar:nth-child(12) { animation: wave 0.85s ease-in-out infinite 0.25s; }
body.playing .waveform .bar:nth-child(13) { animation: wave 1.2s ease-in-out infinite 0.35s; }
body.playing .waveform .bar:nth-child(14) { animation: wave 1.0s ease-in-out infinite 0.05s; }
body.playing .waveform .bar:nth-child(15) { animation: wave 0.95s ease-in-out infinite 0.45s; }
body.playing .waveform .bar:nth-child(16) { animation: wave 1.1s ease-in-out infinite 0.1s; }
body.playing .waveform .bar:nth-child(17) { animation: wave 0.9s ease-in-out infinite 0.2s; }
body.playing .waveform .bar:nth-child(18) { animation: wave 1.15s ease-in-out infinite 0.3s; }
body.playing .waveform .bar:nth-child(19) { animation: wave 1.0s ease-in-out infinite 0.4s; }
body.playing .waveform .bar:nth-child(20) { animation: wave 0.8s ease-in-out infinite 0.05s; }
@keyframes wave {
  0%,100% { height: 4px; opacity:.5; }
  50% { height: 32px; opacity: 1; }
}

/* Player Controls */
.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}
.ctrl-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all .2s;
  -webkit-tap-highlight-color: transparent;
}
.ctrl-btn svg { width: 22px; height: 22px; fill: var(--text2); }
.ctrl-btn:active { transform: scale(.92); background: rgba(255,255,255,0.12); }

.play-btn {
  width: 72px; height: 72px;
  background: var(--green);
  border: none;
  box-shadow: 0 0 28px var(--green-glow);
  position: relative;
  overflow: hidden;
  transition: all .2s;
}
.play-btn svg { width: 34px; height: 34px; fill: var(--white); }
.play-btn:active { transform: scale(.94); box-shadow: 0 0 14px var(--green-glow); }
.play-btn.loading { animation: spinGlow 1s linear infinite; }
@keyframes spinGlow {
  0%   { box-shadow: 0 0 28px var(--green-glow); }
  50%  { box-shadow: 0 0 50px rgba(61,184,0,.6); }
  100% { box-shadow: 0 0 28px var(--green-glow); }
}
.play-ripple {
  position: absolute; inset: 0; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transform: scale(0); opacity: 0;
}
.play-btn:active .play-ripple { animation: ripple .4s ease-out; }
@keyframes ripple {
  from { transform: scale(0); opacity:1; }
  to   { transform: scale(2); opacity:0; }
}

/* Volume */
.volume-wrap {
  display: flex; align-items: center; gap: 10px; width: 100%;
}
.vol-icon { width: 18px; height: 18px; fill: var(--text3); flex-shrink:0; }
.vol-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--green) 80%, rgba(255,255,255,.15) 80%);
  outline: none;
}
.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(61,184,0,.5);
  cursor: pointer;
}

.status-bar {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text2);
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--text3); flex-shrink:0;
}
.status-dot.connecting { background: #f0a500; animation: pulse 1s infinite; }
.status-dot.playing    { background: var(--green); animation: pulse 1.5s infinite; }
.status-dot.error      { background: #e74c3c; }

/* ============================================================
   SKELETON LOADERS
   ============================================================ */
.skeleton-card {
  height: 100px; background: var(--card); border-radius: var(--radius);
  margin-bottom: 10px; animation: shimmer 1.5s infinite linear;
  background-image: linear-gradient(90deg, var(--card) 0%, #2a2a2a 50%, var(--card) 100%);
  background-size: 200% 100%;
}
.skeleton-kajian {
  height: 280px; background: var(--card); border-radius: var(--radius);
  width: 220px; flex-shrink: 0;
  animation: shimmer 1.5s infinite linear;
  background-image: linear-gradient(90deg, var(--card) 0%, #2a2a2a 50%, var(--card) 100%);
  background-size: 200% 100%;
}
.skeleton-nasehat {
  height: 400px; background: var(--card); border-radius: var(--radius);
  width: 100%; margin-bottom: 16px;
  animation: shimmer 1.5s infinite linear;
  background-image: linear-gradient(90deg, var(--card) 0%, #2a2a2a 50%, var(--card) 100%);
  background-size: 200% 100%;
}
@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position:  200% 0; }
}

/* ============================================================
   SECTION 2: JADWAL SIARAN
   ============================================================ */
.section-jadwal { background: var(--bg2); }
.jadwal-list { display: flex; flex-direction: column; gap: 10px; }

.jadwal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}
.jadwal-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--green);
  border-radius: 4px 0 0 4px;
}
.jadwal-time {
  font-size: 13px; font-weight: 600; color: var(--green);
  margin-bottom: 6px;
}
.jadwal-program {
  font-size: 15px; font-weight: 600; color: var(--white); margin-bottom: 4px;
}
.jadwal-pemateri {
  font-size: 12px; color: var(--text2); margin-bottom: 3px;
}
.jadwal-tema {
  font-size: 12px; color: var(--text3);
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================
   SECTION 3: KAJIAN
   ============================================================ */
.kajian-tabs {
  display: flex; gap: 8px; margin-bottom: 16px;
  overflow-x: auto; padding-bottom: 2px;
}
.kajian-tabs::-webkit-scrollbar { display: none; }
.ktab {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 13px; font-weight: 500;
  font-family: 'Poppins', sans-serif;
  background: var(--card);
  transition: all .2s;
  -webkit-tap-highlight-color: transparent;
}
.ktab.active {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
  font-weight: 600;
}

.kajian-panel { display: none; }
.kajian-panel.active { display: block; }

.panel-title {
  font-size: 14px; font-weight: 600; color: var(--green);
  margin-bottom: 14px;
  padding: 10px 14px;
  background: rgba(61,184,0,0.08);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--green);
}

.kajian-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
.kajian-scroll::-webkit-scrollbar { height: 3px; }
.kajian-scroll::-webkit-scrollbar-track { background: transparent; }
.kajian-scroll::-webkit-scrollbar-thumb { background: var(--green); border-radius: 2px; }

.kajian-card {
  flex-shrink: 0;
  width: 220px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.kajian-poster {
  width: 100%;
  aspect-ratio: 9/16;
  max-height: 260px;
  object-fit: cover;
  background: var(--card2);
  display: block;
}
.kajian-poster-placeholder {
  width: 100%; aspect-ratio: 9/16; max-height: 260px;
  background: linear-gradient(135deg, #1a2a0a, #0D0D0D);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px; color: var(--text3); font-size: 12px;
}
.kajian-poster-placeholder span { font-size: 40px; }
.kajian-body { padding: 12px; }
.kajian-jenis {
  font-size: 10px; text-transform: uppercase; letter-spacing: .8px;
  color: var(--green); font-weight: 700; margin-bottom: 6px;
  background: rgba(61,184,0,0.1); display: inline-block;
  padding: 2px 8px; border-radius: 20px;
}
.kajian-waktu {
  font-size: 12px; color: var(--text2); margin-bottom: 5px;
  display: flex; align-items: flex-start; gap: 5px;
}
.kajian-waktu::before { content: '🕐'; font-size: 11px; }
.kajian-pemateri {
  font-size: 13px; font-weight: 600; color: var(--white); margin-bottom: 4px;
  display: flex; align-items: flex-start; gap: 5px;
}
.kajian-pemateri::before { content: '🎤'; font-size: 11px; }
.kajian-tema {
  font-size: 12px; color: var(--text2); margin-bottom: 6px; font-style: italic;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.kajian-lokasi {
  font-size: 11px; color: var(--text3);
  display: flex; align-items: flex-start; gap: 4px; margin-bottom: 8px;
}
.kajian-lokasi::before { content: '📍'; font-size: 10px; }
.kajian-maps {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--green); color: var(--white);
  font-size: 12px; font-weight: 600;
  padding: 8px; border-radius: 8px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.kajian-maps:active { opacity: .85; }

/* ============================================================
   SECTION 4: NASEHAT
   ============================================================ */
.nasehat-container { position: relative; overflow: hidden; }
.nasehat-slide { display: none; }
.nasehat-slide.active { display: block; }
.nasehat-img-wrap {
  width: 100%;
  aspect-ratio: 9/16;
  max-height: 480px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #1a2a0a, #0D0D0D);
}
.nasehat-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.nasehat-img-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px; color: var(--text3);
}
.nasehat-img-placeholder span { font-size: 60px; }
.nasehat-title {
  font-size: 16px; font-weight: 700; color: var(--white); margin-bottom: 8px;
}
.nasehat-text {
  font-size: 14px; color: var(--text2); line-height: 1.7;
}
.nasehat-nav {
  display: flex; justify-content: space-between; align-items: center; margin-top: 16px;
}
.nasehat-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.nasehat-btn:active { background: var(--green); border-color: var(--green); }

.nasehat-dots {
  display: flex; justify-content: center; gap: 6px; margin-top: 12px;
}
.ndot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--text3); transition: all .3s;
}
.ndot.active { background: var(--green); width: 18px; border-radius: 3px; }

/* ============================================================
   SECTION 5: INFO RADIO
   ============================================================ */
.section-info { padding: 20px 16px 36px; }
.info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px 20px;
  text-align: center;
}
.info-logo { width: 120px; margin: 0 auto 16px; }
.info-title { font-size: 22px; font-weight: 700; color: var(--white); margin-bottom: 8px; }
.info-desc { font-size: 13px; color: var(--text2); line-height: 1.6; margin-bottom: 20px; }
.info-divider { height: 1px; background: var(--border); margin: 20px 0; }
.info-sub { font-size: 14px; font-weight: 600; color: var(--green); margin-bottom: 14px; }
.info-links { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.info-btn {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px;
  font-size: 14px; color: var(--text);
  transition: all .2s; -webkit-tap-highlight-color: transparent;
}
.info-btn:active { background: rgba(61,184,0,0.12); border-color: var(--green); }
.info-btn-icon { font-size: 20px; }
.info-btn-arr { margin-left: auto; color: var(--text3); font-size: 18px; }
.info-footer {
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
  font-size: 11px; color: var(--text3);
}
.info-footer code {
  display: block; margin-top: 6px;
  background: var(--bg); padding: 8px 12px;
  border-radius: 8px; font-size: 11px; color: var(--green);
  word-break: break-all;
}

/* ============================================================
   BOTTOM NAV
   ============================================================ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(20,20,20,0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(61,184,0,0.15);
  display: flex;
  z-index: 100;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  color: var(--text3); font-size: 10px; font-weight: 500;
  transition: color .2s; -webkit-tap-highlight-color: transparent;
}
.nav-item svg { width: 22px; height: 22px; fill: currentColor; transition: fill .2s; }
.nav-item.active { color: var(--green); }
.nav-item span { font-family: 'Poppins', sans-serif; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 480px) {
  .player-card { max-width: 480px; margin: 0 auto; }
  .kajian-card { width: 260px; }
  .kajian-poster { max-height: 340px; }
}

/* ============================================================
   INSTALL PROMPT
   ============================================================ */
.install-prompt {
  position: fixed; bottom: calc(var(--nav-h) + 12px); left: 16px; right: 16px;
  background: var(--card);
  border: 1px solid var(--green);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
  z-index: 99; animation: slideUp .4s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.install-prompt p { flex: 1; font-size: 13px; color: var(--text); }
.install-prompt p strong { color: var(--green); }
.install-btn {
  background: var(--green); color: var(--white);
  font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: 8px;
  font-family: 'Poppins', sans-serif;
}
.install-close {
  color: var(--text3); font-size: 20px; padding: 4px;
}
