/* ============================
   QURAN RECITATION WITH Z-H-H
   style.css
   ============================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Naskh+Arabic:wght@400;500;600;700&family=Noto+Nastaliq+Urdu:wght@400;600;700&family=Inter:wght@400;600;700&display=swap');

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

:root {
  --green-950: #022c22;
  --green-900: #064e3b;
  --green-800: #065f46;
  --green-700: #047857;
  --green-600: #059669;
  --green-500: #10b981;
  --green-400: #34d399;
  --green-300: #6ee7b7;
  --green-200: #a7f3d0;
  --gold-400:  #fbbf24;
  --gold-500:  #f59e0b;
  --gold-600:  #d97706;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --white:     #ffffff;
  --font-arabic: 'Noto Naskh Arabic', 'Traditional Arabic', serif;
  --font-urdu:   'Noto Nastaliq Urdu', serif;
  --font-sans:   'Inter', sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: linear-gradient(180deg, #011a13 0%, #022c22 40%, #011a13 100%);
  color: var(--white);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  direction: rtl;
  overflow-x: hidden;
}

/* ========== HEADER ========== */
header {
  text-align: center;
  padding: 3rem 1rem 2rem;
  position: relative;
}

header::after {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(251,191,36,0.5), transparent);
  margin-top: 2rem;
}

.header-moon {
  font-size: 2.8rem;
  opacity: 0.85;
  display: block;
  margin-bottom: 0.8rem;
  color: var(--gold-400);
}

.site-title {
  font-family: var(--font-sans);
  font-size: clamp(1.4rem, 5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: 0.05em;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  word-break: break-word;
}

.site-title .gold { color: var(--gold-400); }
.site-title .white { color: var(--white); }

.divider-line {
  width: 8rem;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-400), transparent);
  margin: 1rem auto;
  border: none;
}

.header-urdu {
  font-family: var(--font-urdu);
  font-size: clamp(1rem, 3vw, 1.3rem);
  color: var(--green-200);
  margin-bottom: 0.4rem;
}

.header-qari {
  font-family: var(--font-urdu);
  font-size: clamp(0.85rem, 2.5vw, 1.1rem);
  color: var(--green-300);
  margin-bottom: 1.2rem;
}

.header-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(6,95,70,0.5);
  border: 1px solid rgba(5,150,105,0.3);
  border-radius: 999px;
  padding: 0.5rem 1.5rem;
  font-family: var(--font-urdu);
  font-size: clamp(0.75rem, 2vw, 0.95rem);
  color: var(--green-200);
  backdrop-filter: blur(4px);
}

.header-pill span { color: var(--gold-400); font-size: 0.75rem; }

/* ========== MAIN WRAPPER ========== */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

/* ========== AUDIO PLAYER ========== */
#player-section {
  display: none;
  margin-bottom: 2.5rem;
}

#player-section.visible {
  display: block;
}

.player-card {
  background: linear-gradient(135deg, rgba(6,78,59,0.8), rgba(2,44,34,0.9));
  border: 1px solid rgba(5,150,105,0.35);
  border-radius: 1.25rem;
  padding: 1.75rem 1.5rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.player-title-arabic {
  font-family: var(--font-arabic);
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: var(--gold-400);
  text-align: center;
  margin-bottom: 0.3rem;
}

.player-title-urdu {
  font-family: var(--font-urdu);
  font-size: clamp(0.85rem, 2.5vw, 1.1rem);
  color: var(--green-300);
  text-align: center;
  margin-bottom: 0.2rem;
}

.player-qari {
  font-size: 0.8rem;
  color: rgba(110,231,183,0.6);
  text-align: center;
  margin-bottom: 1.5rem;
  font-family: var(--font-urdu);
}

.player-error {
  background: rgba(127,29,29,0.5);
  border: 1px solid rgba(239,68,68,0.4);
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
  font-family: var(--font-urdu);
  font-size: 0.9rem;
  color: #fca5a5;
  text-align: center;
  display: none;
}

.player-error.visible { display: block; }

/* progress bar */
.progress-wrapper {
  margin-bottom: 0.5rem;
  position: relative;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(6,95,70,0.5);
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-500), var(--amber-400));
  border-radius: 999px;
  width: 0%;
  transition: width 0.1s linear;
  pointer-events: none;
}

.progress-input {
  position: absolute;
  top: -8px;
  left: 0;
  width: 100%;
  height: 22px;
  opacity: 0;
  cursor: pointer;
  margin: 0;
}

.progress-times {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--green-400);
  font-family: monospace;
  direction: ltr;
  margin-bottom: 1.2rem;
}

/* controls */
.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.play-btn {
  width: 3.8rem;
  height: 3.8rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-400), var(--amber-500));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #022c22;
  box-shadow: 0 6px 24px rgba(251,191,36,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}

.play-btn:hover { transform: scale(1.07); box-shadow: 0 8px 30px rgba(251,191,36,0.5); }
.play-btn:active { transform: scale(0.95); }
.play-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.play-btn svg { width: 1.6rem; height: 1.6rem; }

.volume-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  direction: ltr;
}

.volume-control svg {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--green-400);
  flex-shrink: 0;
}

input[type="range"].volume-slider {
  width: 6rem;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(6,95,70,0.5);
  border-radius: 999px;
  cursor: pointer;
  outline: none;
}

input[type="range"].volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--gold-400);
  cursor: pointer;
}

input[type="range"].volume-slider::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--gold-400);
  cursor: pointer;
  border: none;
}

/* spinner */
.spinner {
  width: 1.6rem;
  height: 1.6rem;
  border: 3px solid rgba(2,44,34,0.4);
  border-top-color: #022c22;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ========== TABS ========== */
.tabs-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.tabs {
  display: flex;
  background: rgba(6,78,59,0.45);
  border: 1px solid rgba(5,150,105,0.35);
  border-radius: 0.9rem;
  padding: 0.3rem;
  gap: 0;
}

.tab-btn {
  padding: 0.7rem 2rem;
  border-radius: 0.65rem;
  border: none;
  font-family: var(--font-urdu);
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  color: var(--green-200);
  background: transparent;
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--gold-400), var(--amber-500));
  color: #022c22;
  box-shadow: 0 4px 15px rgba(251,191,36,0.3);
}

.tab-btn:not(.active):hover {
  background: rgba(5,150,105,0.3);
  color: var(--white);
}

/* ========== PARA GRID ========== */
#para-panel, #surah-panel {
  display: none;
}

#para-panel.active, #surah-panel.active {
  display: block;
}

.section-title {
  font-family: var(--font-urdu);
  font-size: clamp(1rem, 3vw, 1.4rem);
  color: var(--gold-400);
  text-align: center;
  margin-bottom: 1.5rem;
}

.para-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.65rem;
}

@media (max-width: 700px) {
  .para-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 420px) {
  .para-grid { grid-template-columns: repeat(2, 1fr); }
}

.para-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 0.5rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(5,150,105,0.35);
  background: rgba(6,78,59,0.35);
  cursor: pointer;
  transition: all 0.25s;
  text-align: center;
  position: relative;
}

.para-card:hover {
  background: rgba(5,150,105,0.45);
  border-color: rgba(52,211,153,0.5);
  transform: scale(1.04);
}

.para-card:active { transform: scale(0.97); }

.para-card.selected {
  background: linear-gradient(135deg, var(--gold-400), var(--amber-500));
  border-color: var(--gold-400);
  color: #022c22;
  box-shadow: 0 6px 20px rgba(251,191,36,0.4);
}

.para-num {
  font-family: var(--font-arabic);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-400);
  margin-bottom: 0.2rem;
}

.para-card.selected .para-num { color: #022c22; }

.para-arabic {
  font-family: var(--font-arabic);
  font-size: 0.72rem;
  color: var(--green-300);
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.para-card.selected .para-arabic { color: rgba(2,44,34,0.75); }

.para-label {
  font-family: var(--font-urdu);
  font-size: 0.7rem;
  color: var(--green-400);
}

.para-card.selected .para-label { color: rgba(2,44,34,0.8); }

.playing-badge {
  position: absolute;
  top: -5px;
  left: -5px;
  width: 18px;
  height: 18px;
  background: #022c22;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.playing-badge svg { width: 10px; height: 10px; color: var(--gold-400); }

/* ========== SURAH SEARCH ========== */
.search-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.search-input {
  width: 100%;
  max-width: 28rem;
  background: rgba(6,78,59,0.5);
  border: 1px solid rgba(5,150,105,0.45);
  border-radius: 0.9rem;
  padding: 0.75rem 1.2rem;
  color: var(--white);
  font-family: var(--font-urdu);
  font-size: 1rem;
  text-align: right;
  direction: rtl;
  outline: none;
  transition: border-color 0.2s;
}

.search-input::placeholder { color: var(--green-400); }
.search-input:focus { border-color: rgba(251,191,36,0.6); }

/* ========== SURAH LIST ========== */
.surah-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

@media (max-width: 900px) {
  .surah-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
  .surah-grid { grid-template-columns: 1fr; }
}

.surah-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(5,150,105,0.3);
  background: rgba(6,78,59,0.35);
  cursor: pointer;
  transition: all 0.22s;
  direction: rtl;
  text-align: right;
}

.surah-card:hover {
  background: rgba(5,150,105,0.45);
  border-color: rgba(52,211,153,0.45);
  transform: scale(1.02);
}

.surah-card:active { transform: scale(0.98); }

.surah-card.selected {
  background: linear-gradient(135deg, var(--gold-400), var(--amber-500));
  border-color: var(--gold-400);
  box-shadow: 0 4px 15px rgba(251,191,36,0.3);
}

.surah-num-badge {
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: rgba(5,150,105,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold-400);
}

.surah-card.selected .surah-num-badge {
  background: rgba(2,44,34,0.4);
}

.surah-info { flex: 1; min-width: 0; }

.surah-name-arabic {
  font-family: var(--font-arabic);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  display: block;
}

.surah-card.selected .surah-name-arabic { color: #022c22; }

.surah-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.2rem;
}

.surah-name-urdu {
  font-family: var(--font-urdu);
  font-size: 0.75rem;
  color: var(--green-300);
}

.surah-card.selected .surah-name-urdu { color: rgba(2,44,34,0.75); }

.surah-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-family: var(--font-urdu);
}

.surah-badge.makki {
  background: rgba(120,53,15,0.5);
  color: #fcd34d;
}

.surah-badge.madani {
  background: rgba(30,58,138,0.5);
  color: #93c5fd;
}

.surah-card.selected .surah-badge {
  background: rgba(2,44,34,0.4);
  color: #022c22;
}

.no-results {
  text-align: center;
  padding: 3rem 1rem;
  font-family: var(--font-urdu);
  color: var(--green-400);
  font-size: 1rem;
}

/* ========== FOOTER ========== */
footer {
  border-top: 1px solid rgba(5,150,105,0.3);
  margin-top: 4rem;
  padding: 3rem 1rem;
  text-align: center;
}

.whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: var(--white);
  text-decoration: none;
  padding: 1rem 2rem;
  border-radius: 1.1rem;
  font-family: var(--font-urdu);
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  font-weight: 700;
  transition: all 0.25s;
  box-shadow: 0 8px 24px rgba(34,197,94,0.3);
  margin-bottom: 2.5rem;
}

.whatsapp-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 32px rgba(34,197,94,0.45);
}

.whatsapp-btn:active { transform: scale(0.97); }

.whatsapp-btn svg {
  width: 1.8rem;
  height: 1.8rem;
  flex-shrink: 0;
}

.brand-section { margin-top: 0; }

.brand-name {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 0.3em;
  color: var(--gold-400);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

.brand-name span.star { font-size: 0.85rem; color: var(--gold-400); }

.brand-dev {
  font-family: var(--font-urdu);
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  color: var(--green-300);
  margin-bottom: 0.4rem;
}

.brand-dev-en {
  font-size: 0.85rem;
  color: var(--green-500);
  margin-bottom: 1rem;
}

.brand-divider {
  width: 4rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(5,150,105,0.5), transparent);
  margin: 0.8rem auto;
}

.copyright {
  font-family: var(--font-urdu);
  font-size: 0.8rem;
  color: var(--green-700);
  margin-bottom: 0.3rem;
}

.copyright-en {
  font-size: 0.72rem;
  color: rgba(5,150,105,0.4);
}

/* ========== RESPONSIVE TWEAKS ========== */
@media (max-width: 480px) {
  header { padding: 2rem 1rem 1.5rem; }
  .tab-btn { padding: 0.6rem 1.2rem; font-size: 0.9rem; }
  .player-card { padding: 1.2rem 1rem; }
  .whatsapp-btn { padding: 0.85rem 1.4rem; }
  .para-card { padding: 0.7rem 0.3rem; }
  .para-num { font-size: 1.25rem; }
}
