/* ═══════════════════════════════════════════════════════════════
   السيرة النبوية — style-enhanced.css
   التأثيرات المتقدمة والأنماط الإسلامية
   ═══════════════════════════════════════════════════════════════ */

/* ─── Arabesque / Islamic Geometric Patterns via CSS ─────────── */
.arabesque-top {
  position: relative;
}
.arabesque-top::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--gold-dark) 20%,
    var(--gold) 50%,
    var(--gold-dark) 80%,
    transparent 100%
  );
  opacity: 0.6;
}

/* ─── Parallax Hero Stars ─────────────────────────────────────── */
.hero-stars {
  position: absolute; inset: 0;
  overflow: hidden; pointer-events: none;
}
.star {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  animation: twinkle linear infinite;
  opacity: 0;
}
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  50% { opacity: 0.8; transform: scale(1); }
}

/* Octagonal Islamic star decorations */
.islamic-star {
  position: absolute;
  opacity: 0.04;
  animation: rotate-star 20s linear infinite;
}
.islamic-star svg { fill: var(--gold); }
@keyframes rotate-star {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ─── Glassmorphism Cards ─────────────────────────────────────── */
.glass-card {
  background: rgba(255,255,255,0.08);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-lg);
}

/* ─── Dark Mode Enhanced Styles ──────────────────────────────── */
[data-theme="dark"] .tl-card {
  background: rgba(13,40,22,0.95);
  border-color: rgba(212,175,55,0.20);
}
[data-theme="dark"] .tl-card p { color: var(--text-muted); }
[data-theme="dark"] .tl-dot {
  box-shadow: 0 0 0 5px var(--midnight), var(--shadow-gold);
}

[data-theme="dark"] .ghaz-card {
  background: rgba(10,30,17,0.96);
}
[data-theme="dark"] .ghaz-val { color: var(--text-muted); }

[data-theme="dark"] .shamail-card {
  background: rgba(10,28,16,0.96);
}

[data-theme="dark"] .sahabi-card {
  background: rgba(10,28,16,0.96);
}
[data-theme="dark"] .sahabi-desc { color: var(--text-muted); }

[data-theme="dark"] .daily-card {
  background: rgba(12,35,20,0.98);
  border-color: rgba(212,175,55,0.22);
}
[data-theme="dark"] .daily-text { color: var(--text-dark); }

[data-theme="dark"] .search-big {
  background: rgba(12,35,20,0.96);
}
[data-theme="dark"] .search-big input { color: var(--text-dark); }

[data-theme="dark"] .result-item {
  background: rgba(12,35,20,0.96);
}
[data-theme="dark"] .result-text { color: var(--text-muted); }

[data-theme="dark"] footer {
  background: linear-gradient(160deg, #02090503 0%, #040e07 100%);
}

[data-theme="dark"] nav {
  background: rgba(3,10,5,0.99);
  border-bottom-color: rgba(212,175,55,0.18);
}

[data-theme="dark"] #section-badge { color: var(--gold-light); }

[data-theme="dark"] #listen { background: #062112; }
[data-theme="dark"] .station-card {
  background: rgba(255,255,255,0.05);
}

/* ─── Scroll Reveal Animations ───────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.75s cubic-bezier(0.4,0,0.2,1),
              transform 0.75s cubic-bezier(0.4,0,0.2,1);
}
.reveal.left  { transform: translateX(-36px); }
.reveal.right { transform: translateX(36px); }
.reveal.scale { transform: scale(0.92); }
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ─── Hover Glow Effects ─────────────────────────────────────── */
.glow-hover {
  transition: var(--transition);
}
.glow-hover:hover {
  box-shadow: 0 0 20px var(--gold-glow), var(--shadow-md);
}

/* ─── Gold Text Decoration ───────────────────────────────────── */
.text-gold { color: var(--gold); }
.text-emerald { color: var(--emerald); }
[data-theme="dark"] .text-emerald { color: var(--emerald-light); }

/* ─── Section Ornament Dividers ─────────────────────────────── */
.ornament-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin: 0 auto 1.5rem;
  max-width: 300px;
}
.ornament-divider::before,
.ornament-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,175,55,0.5));
}
.ornament-divider::after {
  background: linear-gradient(90deg, rgba(212,175,55,0.5), transparent);
}
.ornament-divider-icon {
  color: var(--gold);
  font-size: 1.2rem;
  line-height: 1;
}

/* ─── Arabesque Background Pattern ──────────────────────────── */
.arabesque-bg {
  position: relative;
  overflow: hidden;
}
.arabesque-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5 L35 20 L50 20 L39 29 L43 44 L30 36 L17 44 L21 29 L10 20 L25 20Z' fill='none' stroke='rgba(212,175,55,0.06)' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* ─── Neon Gold Borders ─────────────────────────────────────── */
.gold-border-glow {
  border: 1px solid var(--gold);
  box-shadow: 0 0 12px rgba(212,175,55,0.3), inset 0 0 12px rgba(212,175,55,0.05);
}

/* ─── Card Hover Lift ──────────────────────────────────────── */
.card-lift {
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 0.35s ease,
              border-color 0.35s ease;
}
.card-lift:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--shadow-lg);
}

/* ─── Floating Labels (Section Category Tags) ──────────────── */
.floating-label {
  position: absolute;
  top: -12px; right: 1.5rem;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #0a1a08;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  font-family: 'Tajawal', sans-serif;
  letter-spacing: 1px;
}

/* ─── Pulse Rings (for active elements) ────────────────────── */
.pulse-ring {
  position: relative;
}
.pulse-ring::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  animation: pulse-ring-anim 2s cubic-bezier(0.4,0,0.2,1) infinite;
}
@keyframes pulse-ring-anim {
  0%   { transform: scale(0.95); opacity: 0.8; }
  70%  { transform: scale(1.15); opacity: 0; }
  100% { transform: scale(0.95); opacity: 0; }
}

/* ─── Skeleton Loader ───────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg,
    rgba(212,175,55,0.06) 25%,
    rgba(212,175,55,0.12) 50%,
    rgba(212,175,55,0.06) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-load 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-load {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Fade in up stagger ─────────────────────────────────── */
.stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.stagger > *.visible { opacity: 1; transform: none; }
.stagger > *:nth-child(1) { transition-delay: 0.05s; }
.stagger > *:nth-child(2) { transition-delay: 0.10s; }
.stagger > *:nth-child(3) { transition-delay: 0.15s; }
.stagger > *:nth-child(4) { transition-delay: 0.20s; }
.stagger > *:nth-child(5) { transition-delay: 0.25s; }
.stagger > *:nth-child(6) { transition-delay: 0.30s; }
.stagger > *:nth-child(7) { transition-delay: 0.35s; }
.stagger > *:nth-child(8) { transition-delay: 0.40s; }
.stagger > *:nth-child(9) { transition-delay: 0.45s; }
.stagger > *:nth-child(10){ transition-delay: 0.50s; }
.stagger > *:nth-child(11){ transition-delay: 0.55s; }
.stagger > *:nth-child(12){ transition-delay: 0.60s; }

/* ─── Reading Mode Overlay ──────────────────────────────────── */
#reading-mode-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 800;
  background: rgba(7,26,16,0.55);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}
#reading-mode-overlay.active { display: block; }

/* ─── Nav Active Underline ──────────────────────────────────── */
.nav-links a.active {
  background: rgba(212,175,55,0.18);
  color: var(--gold-light);
  position: relative;
}

/* ─── Back to Top ───────────────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 90px; left: 1.5rem;
  z-index: 950;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border: none;
  color: #0a1a08;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(212,175,55,0.35);
  opacity: 0; visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition);
}
#back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
#back-to-top:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(212,175,55,0.5); }

/* ─── Section Transition Dividers ──────────────────────────── */
.wave-divider {
  position: relative;
  height: 0;
  overflow: visible;
  z-index: 1;
}
.wave-divider svg {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  width: 100%;
}

/* ─── Hadith Card Quote Decoration ─────────────────────────── */
.hadith-card .quote-open {
  position: absolute;
  top: 12px; right: 14px;
  font-family: 'Amiri', serif;
  font-size: 3rem;
  color: rgba(212,175,55,0.15);
  line-height: 1;
  pointer-events: none;
}

/* ─── Timeline Phase Labels ─────────────────────────────────── */
.tl-phase-label {
  text-align: center;
  padding: 0.5rem 0 1.5rem;
  font-family: 'Amiri', serif;
  font-size: 1.1rem;
  color: var(--gold);
  letter-spacing: 2px;
  opacity: 0.7;
}
.tl-phase-label::before,
.tl-phase-label::after {
  content: ' ◆ ';
  font-size: 0.7rem;
  opacity: 0.5;
}

/* ─── Sahabi Expanded Card Detail Modal ─────────────────────── */
#sahabi-modal {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  opacity: 0; visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
#sahabi-modal.open { opacity: 1; visibility: visible; }

.modal-card {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  max-width: 560px; width: 100%;
  border: 1px solid rgba(212,175,55,0.3);
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
  overflow: hidden;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
#sahabi-modal.open .modal-card { transform: scale(1) translateY(0); }

.modal-header {
  background: linear-gradient(135deg, var(--emerald), var(--emerald-light));
  padding: 2rem 2rem 1.5rem;
  text-align: center;
}
.modal-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(212,175,55,0.15);
  border: 2px solid rgba(212,175,55,0.5);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem;
  margin: 0 auto 0.8rem;
}
.modal-name {
  font-family: 'Amiri', serif;
  color: var(--gold);
  font-size: 1.6rem;
  margin-bottom: 4px;
}
.modal-nickname {
  color: rgba(255,255,255,0.55);
  font-size: 0.85rem;
  font-family: 'Tajawal', sans-serif;
}
.modal-body { padding: 2rem; }
.modal-desc {
  font-family: 'Tajawal', sans-serif;
  font-size: 0.95rem;
  color: var(--text-mid);
  line-height: 1.9;
  margin-bottom: 1.5rem;
}
[data-theme="dark"] .modal-desc { color: var(--text-muted); }
.modal-quote {
  background: rgba(13,74,47,0.06);
  border-right: 3px solid var(--gold);
  padding: 1rem 1.2rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: 'Amiri', serif;
  font-size: 1rem;
  color: var(--emerald);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}
[data-theme="dark"] .modal-quote {
  background: rgba(212,175,55,0.06);
  color: var(--gold-light);
}
.modal-close {
  width: 100%;
  background: var(--emerald);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px;
  font-family: 'Cairo', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.modal-close:hover { background: var(--emerald-light); }
[data-theme="dark"] .modal-card {
  background: rgba(10,28,16,0.98);
}

/* ─── Stats Counter Animation ──────────────────────────────── */
.counter { display: inline-block; }

/* ─── Mobile-first Mini Player Adjustments ─────────────────── */
@media (max-width: 480px) {
  #mini-player { gap: 0.6rem; }
  .mp-artwork { width: 38px; height: 38px; font-size: 1.1rem; }
  .mp-btn { width: 34px; height: 34px; font-size: 0.85rem; }
  .mp-btn.main { width: 40px; height: 40px; }
  .mp-name { font-size: 0.8rem; }
  #back-to-top { bottom: 80px; }
  .toast-container { right: 0.8rem; }
}

/* ─── Print Styles ──────────────────────────────────────────── */
@media print {
  nav, .welcome-overlay, #mini-player, #back-to-top, .toast-container { display: none !important; }
  section { padding: 20px 0; }
  .tl-card, .ghaz-card, .shamail-card, .hadith-card { box-shadow: none; break-inside: avoid; }
}

/* ─── Timeline Expansion Details ────────────────────────────── */
.tl-card {
  cursor: pointer;
}
.tl-details {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.5s ease;
  margin-top: 0;
  color: var(--text-mid);
  font-size: 0.95rem;
  line-height: 1.8;
}
.tl-card.expanded .tl-details {
  max-height: 500px;
  opacity: 1;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(212,175,55,0.2);
}
[data-theme="dark"] .tl-details {
  color: var(--text-muted);
}
