@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Amiri:wght@400;700&family=Tajawal:wght@300;400;500;700;800&family=Noto+Naskh+Arabic:wght@400;500;600;700&display=swap');

:root {
  --font-main: 'Cairo', 'Tajawal', sans-serif;
  --font-quran: 'Amiri', 'Noto Naskh Arabic', serif;
  --bg: #020a06;
  --bg-card: rgba(8, 32, 20, 0.55);
  --bg-card-hover: rgba(12, 45, 28, 0.7);
  --border: rgba(16, 185, 129, 0.12);
  --border-gold: rgba(212, 175, 55, 0.25);
  --gold: #d4af37;
  --gold-light: #f0d878;
  --gold-dim: rgba(212, 175, 55, 0.2);
  --gold-glow: rgba(212, 175, 55, 0.35);
  --emerald: #10b981;
  --emerald-light: #34d399;
  --emerald-dim: rgba(16, 185, 129, 0.15);
  --emerald-glow: rgba(16, 185, 129, 0.3);
  --text: #eef2f7;
  --text-dim: #7e8fa6;
  --red: #ef4444;
  --radius: 18px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  direction: rtl;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input, select, textarea { font-family: inherit; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ═══════════ SCROLLBAR ═══════════ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ═══════════ CINEMATIC BACKGROUND ═══════════ */
.cin-bg {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background: radial-gradient(ellipse at 50% 0%, #071f14 0%, #020a06 60%, #000 100%);
}
.cin-bg .orb {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.35;
  animation: orbFloat 20s ease-in-out infinite alternate;
}
.cin-bg .orb-1 { width: 500px; height: 500px; background: var(--emerald); top: -15%; right: -10%; animation-delay: 0s; }
.cin-bg .orb-2 { width: 400px; height: 400px; background: var(--gold); bottom: -10%; left: -8%; animation-delay: -7s; opacity: 0.2; }
.cin-bg .orb-3 { width: 300px; height: 300px; background: #0d9488; top: 50%; left: 30%; animation-delay: -14s; opacity: 0.15; }

.cin-bg .geo-pattern {
  position: absolute; inset: 0; opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M40 0L50 20L70 10L60 30L80 40L60 50L70 70L50 60L40 80L30 60L10 70L20 50L0 40L20 30L10 10L30 20Z' fill='none' stroke='%23d4af37' stroke-width='0.5'/%3E%3C/svg%3E");
  background-size: 80px 80px;
}

.cin-bg .particles {
  position: absolute; inset: 0;
}
.cin-bg .particle {
  position: absolute; width: 3px; height: 3px; background: var(--gold);
  border-radius: 50%; opacity: 0;
  animation: particleDrift 8s ease-in-out infinite;
}
.cin-bg .particle:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
.cin-bg .particle:nth-child(2) { top: 60%; left: 80%; animation-delay: 1.5s; }
.cin-bg .particle:nth-child(3) { top: 40%; left: 50%; animation-delay: 3s; }
.cin-bg .particle:nth-child(4) { top: 80%; left: 20%; animation-delay: 4.5s; }
.cin-bg .particle:nth-child(5) { top: 10%; left: 70%; animation-delay: 6s; }
.cin-bg .particle:nth-child(6) { top: 50%; left: 35%; animation-delay: 2s; width: 2px; height: 2px; }
.cin-bg .particle:nth-child(7) { top: 75%; left: 60%; animation-delay: 5s; width: 4px; height: 4px; }
.cin-bg .particle:nth-child(8) { top: 30%; left: 90%; animation-delay: 7s; }

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.1); }
  100% { transform: translate(-30px, 20px) scale(0.95); }
}
@keyframes particleDrift {
  0%, 100% { opacity: 0; transform: translateY(0) scale(0.5); }
  30% { opacity: 0.8; }
  50% { opacity: 1; transform: translateY(-40px) scale(1); }
  70% { opacity: 0.6; }
}

/* ═══════════ SPLASH SCREEN ═══════════ */
#splash {
  position: fixed; inset: 0; z-index: 9999;
  background: radial-gradient(ellipse at center, #071f14, #020a06);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  transition: opacity 0.8s var(--ease);
}
#splash.hidden { opacity: 0; pointer-events: none; }
#splash .logo-drop {
  width: 120px; height: 120px;
  animation: splashPulse 2s ease-in-out infinite;
}
#splash h1 {
  font-family: var(--font-quran);
  font-size: 3rem; color: var(--gold);
  margin-top: 20px;
  text-shadow: 0 0 30px var(--gold-glow);
}
#splash p {
  font-size: 1rem; color: var(--text-dim);
  margin-top: 8px; font-family: var(--font-quran);
}
.splash-bar {
  width: 200px; height: 3px; background: rgba(255,255,255,0.08);
  border-radius: 3px; margin-top: 30px; overflow: hidden;
}
.splash-bar-fill {
  height: 100%; width: 0%; background: linear-gradient(90deg, var(--emerald), var(--gold));
  border-radius: 3px; transition: width 0.3s;
}
@keyframes splashPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 15px var(--gold-glow)); }
  50% { transform: scale(1.05); filter: drop-shadow(0 0 30px var(--gold-glow)); }
}

/* ═══════════ HEADER ═══════════ */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 12px 24px;
  background: rgba(2, 10, 6, 0.8);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s var(--ease);
}
.header-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
}
.brand svg { width: 36px; height: 36px; flex-shrink: 0; }
.brand h1 {
  font-family: var(--font-quran); font-size: 1.6rem; font-weight: 700;
  background: linear-gradient(135deg, var(--gold-light), var(--gold), #9e7f1b);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.header-nav {
  display: flex; align-items: center; gap: 4px;
}
.header-nav a {
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 0.88rem; font-weight: 500; color: var(--text-dim);
  transition: all 0.3s var(--ease); position: relative;
}
.header-nav a:hover { color: var(--text); background: var(--emerald-dim); }
.header-nav a.active {
  color: var(--gold); background: var(--gold-dim);
}
.header-actions { display: flex; gap: 8px; align-items: center; }
.btn-header {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 20px;
  font-size: 0.8rem; font-weight: 500; color: var(--text-dim);
  border: 1px solid var(--border); background: rgba(255,255,255,0.03);
  transition: all 0.3s var(--ease);
}
.btn-header:hover { color: var(--gold); border-color: var(--gold-dim); background: var(--gold-dim); }
.btn-header svg { width: 16px; height: 16px; }

/* ═══════════ LAYOUT ═══════════ */
.app-container {
  max-width: 1200px; margin: 0 auto;
  padding: 80px 20px 100px;
}
.view { display: none; animation: viewEnter 0.5s var(--ease); }
.view.active { display: block; }
@keyframes viewEnter {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════ GLASS CARD ═══════════ */
.glass {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  transition: all 0.3s var(--ease);
}
.glass:hover { border-color: var(--border-gold); }

/* ═══════════ BUTTONS ═══════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-sm);
  font-size: 0.95rem; font-weight: 600;
  transition: all 0.3s var(--ease); position: relative; overflow: hidden;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold), #b8941e);
  color: #000; box-shadow: 0 4px 20px var(--gold-glow);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 6px 28px var(--gold-glow); }
.btn-emerald {
  background: linear-gradient(135deg, var(--emerald), #059669);
  color: #fff; box-shadow: 0 4px 20px var(--emerald-glow);
}
.btn-emerald:hover { transform: translateY(-2px); box-shadow: 0 6px 28px var(--emerald-glow); }
.btn-outline {
  background: transparent; color: var(--gold);
  border: 1px solid var(--gold-dim);
}
.btn-outline:hover { background: var(--gold-dim); }
.btn-ghost {
  background: rgba(255,255,255,0.05); color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.btn-ghost.active { background: var(--gold-dim); color: var(--gold); border-color: var(--gold-dim); }
.btn-sm { padding: 8px 16px; font-size: 0.82rem; }
.btn-icon-only {
  width: 40px; height: 40px; padding: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* Ripple */
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
  transform: scale(0); opacity: 0; border-radius: inherit;
  transition: transform 0.5s, opacity 0.3s;
}
.btn:active::after { transform: scale(2.5); opacity: 1; transition: 0s; }

/* ═══════════ SELECT ═══════════ */
.select { color: var(--text);
  appearance: none;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px; font-size: 0.9rem;
  color: var(--text); width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b9cb5' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  transition: all 0.3s var(--ease);
}
.select:focus { outline: none; border-color: var(--gold-dim); box-shadow: 0 0 0 3px var(--gold-dim); }

textarea.select { color: var(--text); resize: vertical; min-height: 80px; line-height: 1.8; }

/* ═══════════ SECTION HEADER ═══════════ */
.section-title {
  display: flex; align-items: center; gap: 12px;
  font-size: 1.3rem; font-weight: 700; color: var(--gold);
  margin-bottom: 20px;
}
.section-title svg { width: 24px; height: 24px; stroke: var(--gold); }

/* ═══════════ HOME: HERO ═══════════ */
.hero {
  text-align: center; padding: 60px 20px 40px;
  position: relative;
}
.hero h1 {
  font-family: var(--font-quran); font-size: 2.4rem; font-weight: 700;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  text-shadow: none; margin-bottom: 12px;
  animation: heroGlow 4s ease-in-out infinite alternate;
}
.hero p {
  font-family: var(--font-quran); font-size: 1.2rem;
  color: var(--emerald-light); opacity: 0.8;
}
@keyframes heroGlow {
  0% { filter: drop-shadow(0 0 10px var(--gold-glow)); }
  100% { filter: drop-shadow(0 0 25px var(--gold-glow)); }
}

/* ═══════════ HOME: GRID ═══════════ */
.home-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  margin-top: 20px;
}

/* Radio */
.radio-card .card-top {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
}
.live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 20px;
  background: rgba(239, 68, 68, 0.15); color: #ef4444;
  font-size: 0.75rem; font-weight: 700;
}
.live-dot {
  width: 8px; height: 8px; background: #ef4444; border-radius: 50%;
  animation: livePulse 1.5s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* Prayer Times */
.prayer-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.prayer-item {
  text-align: center; padding: 12px 8px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  transition: all 0.3s var(--ease);
}
.prayer-item:hover { border-color: var(--gold-dim); }
.prayer-item .name { font-size: 0.78rem; color: var(--text-dim); margin-bottom: 4px; }
.prayer-item .time { font-size: 1.05rem; font-weight: 700; color: var(--gold); }
.prayer-item.next { border-color: var(--emerald); background: var(--emerald-dim); }
.prayer-item.next .time { color: var(--emerald-light); }

/* ═══════════ MUSHAF ═══════════ */
.mushaf-controls {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.quran-text-box {
  font-family: var(--font-quran);
  font-size: 1.7rem; line-height: 2.4;
  text-align: justify; direction: rtl;
  min-height: 400px; padding: 30px;
}
.quran-ayah {
  display: inline; cursor: pointer; padding: 4px 6px;
  border-radius: 6px; transition: all 0.3s var(--ease);
}
.quran-ayah:hover { background: var(--gold-dim); }
.quran-ayah.active { background: rgba(212,175,55,0.2); }
.ayah-num {
  color: var(--gold); font-size: 0.85em;
  margin: 0 2px; font-weight: 700;
}

/* ═══════════ ADHKAR ═══════════ */
.adhkar-cats {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 0;
  scrollbar-width: none;
}
.adhkar-cats::-webkit-scrollbar { display: none; }
.adhkar-cat-btn {
  white-space: nowrap; padding: 8px 18px; border-radius: 20px;
  font-size: 0.85rem; font-weight: 600;
  background: rgba(255,255,255,0.05); color: var(--text-dim);
  border: 1px solid var(--border);
  transition: all 0.3s var(--ease); flex-shrink: 0;
}
.adhkar-cat-btn:hover { color: var(--text); background: rgba(255,255,255,0.08); }
.adhkar-cat-btn.active {
  background: var(--gold-dim); color: var(--gold);
  border-color: var(--gold-dim);
}

.adhkar-layout {
  display: grid; grid-template-columns: 1fr 300px; gap: 20px;
  margin-top: 20px;
}
.adhkar-list { display: flex; flex-direction: column; gap: 14px; }

.dhikr-card {
  padding: 20px; position: relative;
  animation: cardSlideIn 0.4s var(--ease);
}
.dhikr-card p {
  font-family: var(--font-quran); font-size: 1.25rem;
  line-height: 2; margin-bottom: 12px;
}
.dhikr-card .meta {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px;
}
.dhikr-card .fadl {
  font-size: 0.8rem; color: var(--emerald-light);
  max-width: 60%;
}
.dhikr-card .source {
  font-size: 0.75rem; color: var(--text-dim);
}
.counter-btn {
  min-width: 60px; height: 42px; border-radius: var(--radius-sm);
  background: var(--gold-dim); color: var(--gold);
  font-size: 1.1rem; font-weight: 800;
  border: 1px solid var(--gold-dim);
  transition: all 0.2s var(--ease);
}
.counter-btn:active { transform: scale(0.92); }
.counter-btn.done { opacity: 0.4; color: var(--emerald-light); }

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

/* Tasbeeh */
.tasbeeh-card { text-align: center; }
.tasbeeh-card h3 {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 1rem; color: var(--gold); margin-bottom: 24px;
}
.tasbeeh-ring {
  width: 140px; height: 140px; border-radius: 50%; margin: 0 auto 20px;
  border: 3px solid var(--gold-dim);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s var(--ease);
  box-shadow: 0 0 25px var(--gold-glow), inset 0 0 25px rgba(212,175,55,0.05);
  position: relative;
}
.tasbeeh-ring::before {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 1px solid var(--gold-dim); opacity: 0.4;
}
.tasbeeh-ring:active { transform: scale(0.93); box-shadow: 0 0 40px var(--gold-glow); }
.tasbeeh-count {
  font-size: 2.8rem; font-weight: 800; color: var(--gold);
}

/* ═══════════ AUDIO LIBRARY ═══════════ */
.audio-controls-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-bottom: 20px;
}
.audio-player-box {
  text-align: center; padding: 30px;
}
.audio-player-box .now-playing {
  font-family: var(--font-quran); font-size: 1.4rem;
  color: var(--gold); margin-bottom: 6px;
}
.audio-player-box .now-reciter {
  font-size: 0.85rem; color: var(--text-dim); margin-bottom: 24px;
}
.audio-main-btn {
  width: 70px; height: 70px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #b8941e);
  color: #000; margin: 0 auto 16px; display: flex;
  align-items: center; justify-content: center;
  box-shadow: 0 4px 25px var(--gold-glow);
  transition: all 0.3s var(--ease);
}
.audio-main-btn:hover { transform: scale(1.08); box-shadow: 0 6px 35px var(--gold-glow); }
.audio-main-btn svg { width: 28px; height: 28px; }
.audio-progress {
  width: 100%; height: 4px; border-radius: 4px;
  background: rgba(255,255,255,0.08); margin-top: 12px;
  overflow: hidden; cursor: pointer;
}
.audio-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--emerald), var(--gold));
  border-radius: 4px; width: 0%; transition: width 0.1s;
}
.audio-time {
  display: flex; justify-content: space-between;
  font-size: 0.75rem; color: var(--text-dim); margin-top: 6px;
}

/* ═══════════ STUDIO ═══════════ */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 50px 30px; text-align: center;
  cursor: pointer; transition: all 0.3s var(--ease);
  position: relative; overflow: hidden;
}
.dropzone::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle, var(--emerald-dim) 0%, transparent 70%);
  opacity: 0; transition: opacity 0.3s;
}
.dropzone:hover, .dropzone.hover {
  border-color: var(--gold-dim);
}
.dropzone:hover::before, .dropzone.hover::before { opacity: 1; }
.dropzone svg { width: 48px; height: 48px; color: var(--gold); margin-bottom: 12px; position: relative; }
.dropzone p { color: var(--text-dim); position: relative; }
.dropzone .sub { font-size: 0.78rem; color: var(--text-dim); opacity: 0.6; margin-top: 6px; display: block; position: relative; }

.studio-options {
  display: flex; gap: 12px; margin: 16px 0; flex-wrap: wrap;
}
.toggle-card {
  flex: 1; min-width: 160px; display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  cursor: pointer; transition: all 0.3s var(--ease);
  font-size: 0.85rem;
}
.toggle-card:has(input:checked) { border-color: var(--emerald); background: var(--emerald-dim); }
.toggle-card input { display: none; }
.toggle-card svg { width: 18px; height: 18px; color: var(--emerald-light); flex-shrink: 0; }

/* Processing */
.processing-ui { text-align: center; padding: 40px 20px; }
.spinner-mandala {
  width: 80px; height: 80px; margin: 0 auto 20px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-right-color: var(--emerald);
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-track {
  width: 100%; max-width: 400px; height: 4px;
  background: rgba(255,255,255,0.06); border-radius: 4px;
  margin: 16px auto; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 4px; width: 0%;
  background: linear-gradient(90deg, var(--emerald), var(--gold));
  transition: width 0.4s var(--ease);
}
.dhikr-rotator {
  font-family: var(--font-quran); font-size: 1rem;
  color: var(--gold); opacity: 0.7; margin-top: 16px;
  animation: fadeInOut 4s ease-in-out infinite;
}
@keyframes fadeInOut {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.9; }
}

/* Mixer */
.studio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mixer-card h4 {
  display: flex; align-items: center; gap: 8px;
  font-size: 1rem; margin-bottom: 12px;
}
.mixer-card h4 svg { width: 18px; height: 18px; }
.mixer-actions { display: flex; gap: 6px; margin-bottom: 12px; }
.waveform-container { width: 100%; min-height: 60px; border-radius: var(--radius-xs); overflow: hidden; }

.slider-row {
  display: flex; align-items: center; gap: 10px; margin-top: 12px;
}
.slider-row svg { width: 16px; height: 16px; color: var(--emerald-light); flex-shrink: 0; }
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 4px;
  background: rgba(255,255,255,0.1); outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px;
  border-radius: 50%; background: var(--gold); cursor: pointer;
  box-shadow: 0 0 8px var(--gold-glow);
}
.vol-val { font-size: 0.8rem; color: var(--gold); min-width: 36px; text-align: center; }

.presets-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.btn-preset {
  padding: 8px 14px; border-radius: 20px; font-size: 0.78rem; font-weight: 600;
  background: rgba(255,255,255,0.04); color: var(--text-dim);
  border: 1px solid var(--border); display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.3s var(--ease);
}
.btn-preset svg { width: 14px; height: 14px; }
.btn-preset:hover { color: var(--text); background: rgba(255,255,255,0.08); }
.btn-preset.active { background: var(--gold-dim); color: var(--gold); border-color: var(--gold-dim); }

/* ═══════════ REELS STUDIO ═══════════ */
.reels-layout {
  display: grid; grid-template-columns: 1fr 350px; gap: 24px;
  align-items: start;
}
.reels-controls-panel { display: flex; flex-direction: column; gap: 16px; }
.reels-controls-panel label {
  display: block; font-size: 0.85rem; color: var(--text-dim);
  margin-bottom: 6px; font-weight: 500;
}
.template-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.template-item {
  aspect-ratio: 9/16; border-radius: var(--radius-sm);
  border: 2px solid var(--border); cursor: pointer;
  overflow: hidden; position: relative;
  transition: all 0.3s var(--ease);
}
.template-item:hover { border-color: var(--gold-dim); }
.template-item.active { border-color: var(--gold); box-shadow: 0 0 15px var(--gold-glow); }
.template-item .tmpl-name {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 6px; text-align: center; font-size: 0.7rem;
  background: rgba(0,0,0,0.7); color: var(--text);
}

.preview-frame {
  width: 100%; max-width: 350px; aspect-ratio: 9/16;
  background: #000; border-radius: var(--radius);
  overflow: hidden; border: 2px solid var(--border-gold);
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  position: sticky; top: 90px;
}
.preview-frame canvas { width: 100%; height: 100%; display: block; }

/* ═══════════ MODALS ═══════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 1; transition: opacity 0.3s var(--ease);
  padding: 20px;
}
.modal-overlay.hidden { opacity: 0; pointer-events: none; }
.modal-card {
  width: 100%; max-width: 520px;
  max-height: 80vh; overflow-y: auto;
  animation: modalIn 0.4s var(--ease);
}
.modal-card .modal-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.modal-card .modal-head h3 {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.15rem; color: var(--gold);
}
.modal-card .modal-head h3 svg { width: 22px; height: 22px; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.05); color: var(--text-dim);
  font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.modal-close:hover { background: rgba(239,68,68,0.15); color: var(--red); }
.modal-card p { color: var(--text-dim); line-height: 1.8; margin-bottom: 12px; }
.modal-card .highlight { color: var(--gold); }
.modal-card .copyright {
  text-align: center; font-size: 0.78rem; color: var(--text-dim);
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
}
.guide-list li {
  margin-bottom: 14px; padding-right: 16px;
  position: relative; line-height: 1.7; color: var(--text-dim);
}
.guide-list li strong { color: var(--gold); }
@keyframes modalIn {
  from { transform: scale(0.92) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

/* ═══════════ BOTTOM NAV ═══════════ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: rgba(2, 10, 6, 0.92); backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-start; padding: 8px 15px 12px; gap: 20px; overflow-x: auto; scrollbar-width: none;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 12px; border-radius: var(--radius-sm);
  font-size: 0.68rem; color: var(--text-dim);
  transition: all 0.3s var(--ease);
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item:hover { color: var(--text); }
.nav-item.active { color: var(--gold); }
.nav-item.active svg { filter: drop-shadow(0 0 6px var(--gold-glow)); }

/* ═══════════ WHATSAPP ═══════════ */
.wa-float {
  position: fixed; bottom: 80px; left: 20px; z-index: 90;
  width: 56px; height: 56px; border-radius: 50%;
  background: #25D366; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,0.4);
  transition: all 0.3s var(--ease);
  animation: waFloat 3s ease-in-out infinite;
}
.wa-float:hover { transform: scale(1.1); box-shadow: 0 6px 30px rgba(37,211,102,0.6); }
.wa-float svg { width: 28px; height: 28px; }
@keyframes waFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ═══════════ UTILITIES ═══════════ */
.gold-text { color: var(--gold); }
.emerald-text { color: var(--emerald-light); }
.text-center { text-align: center; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.gap-12 { gap: 12px; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 768px) {
  .home-grid { grid-template-columns: 1fr; }
  .adhkar-layout { grid-template-columns: 1fr; }
  .studio-grid { grid-template-columns: 1fr; }
  .reels-layout { grid-template-columns: 1fr; }
  .audio-controls-grid { grid-template-columns: 1fr; }
  .preview-frame { position: static; max-width: 100%; }
  .header-nav { display: none; }
  .header-actions .btn-header span { display: none; }
  .hero h1 { font-size: 1.8rem; }
  .quran-text-box { font-size: 1.4rem; padding: 20px; }
  .prayer-grid { grid-template-columns: repeat(3, 1fr); }
  .template-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .prayer-grid { grid-template-columns: repeat(2, 1fr); }
  .app-container { padding: 70px 12px 90px; }
  .glass { padding: 16px; }
}
/* Cinematic Motion Graphics Preloader */
#splash {
  position: fixed;
  inset: 0;
  background: #020a06;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease-in-out, visibility 0.8s;
}
#splash.hidden {
  opacity: 0;
  visibility: hidden;
}
.logo-drop {
  width: 120px;
  height: 120px;
  animation: floatDrop 3s ease-in-out infinite, pulseGlow 2s infinite alternate;
  filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.4));
  margin-bottom: 20px;
}
@keyframes floatDrop {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-15px) scale(1.05); }
}
@keyframes pulseGlow {
  from { filter: drop-shadow(0 0 10px rgba(212,175,55,0.2)); }
  to { filter: drop-shadow(0 0 30px rgba(212,175,55,0.7)); }
}
#splash h1 {
  font-family: 'Amiri', serif;
  font-size: 3rem;
  color: #d4af37;
  margin: 0;
  text-shadow: 0 0 15px rgba(212,175,55,0.5);
  letter-spacing: 2px;
  opacity: 0;
  animation: fadeIn 1s 0.5s forwards;
}
#splash p {
  color: var(--text-dim);
  font-size: 1.1rem;
  margin-top: 5px;
  margin-bottom: 30px;
  opacity: 0;
  animation: fadeIn 1s 0.8s forwards;
}
.splash-bar {
  width: 250px;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  opacity: 0;
  animation: fadeIn 1s 1s forwards;
}
.splash-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #d4af37);
  width: 0%;
  box-shadow: 0 0 10px #10b981;
  transition: width 0.1s linear;
}
@keyframes fadeIn {
  to { opacity: 1; }
}
.spin-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-right-color: currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  vertical-align: middle;
  margin-left: 6px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Spinner Mandala for processing */
.spinner-mandala {
  width: 60px;
  height: 60px;
  border: 3px solid rgba(212, 175, 55, 0.2);
  border-top-color: #d4af37;
  border-bottom-color: #10b981;
  border-radius: 50%;
  animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
  margin: 0 auto 20px auto;
}

/* Fix select options visibility */
.select option {
  background-color: #020a06;
  color: #e0e0e0;
}
.bottom-nav::-webkit-scrollbar { display: none; }
.nav-item { min-width: 60px; flex-shrink: 0; }
