/* ==========================================================================
   MIRATH (ميراث) - ISLAMIC LUXURY GOLD & OBSIDIAN DESIGN SYSTEM
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Amiri+Quran&family=Amiri:ital,wght@0,400;0,700;1,400;1,700&family=Cinzel:wght@400;600;700;800;900&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Scheherazade+New:wght@400;600;700&display=swap');

:root {
  --bg-deep: #07080a;
  --bg-card: rgba(18, 20, 26, 0.75);
  --bg-card-hover: rgba(26, 29, 38, 0.85);
  --bg-elevated: #161922;
  
  --gold-primary: #D4AF37;
  --gold-light: #F6E27A;
  --gold-bright: #FFDF73;
  --gold-muted: #AA771C;
  --gold-dark: #664608;
  --gold-glow: rgba(212, 175, 55, 0.25);
  --gold-glow-strong: rgba(212, 175, 55, 0.45);
  --gold-border: rgba(212, 175, 55, 0.22);
  --gold-border-hover: rgba(212, 175, 55, 0.55);

  --text-main: #F1F1F3;
  --text-muted: #A2A8B8;
  --text-dim: #686F82;
  --emerald-accent: #10B981;
  --emerald-glow: rgba(16, 185, 129, 0.2);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Cinzel', Georgia, serif;
  --font-arabic: 'Amiri Quran', 'Scheherazade New', 'Amiri', 'Traditional Arabic', serif;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(212, 175, 55, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(170, 119, 28, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(16, 185, 129, 0.04) 0%, transparent 45%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l7.071 22.929L60 30l-22.929 7.071L30 60l-7.071-22.929L0 30l22.929-7.071z' fill='%23d4af37' fill-opacity='0.018' fill-rule='evenodd'/%3E%3C/svg%3E");
  background-attachment: fixed;
}

/* Typography styles */
.font-cinzel {
  font-family: var(--font-serif);
}

.font-arabic {
  font-family: var(--font-arabic);
  direction: rtl;
  text-align: right;
  letter-spacing: 0 !important; /* CRITICAL: Never space individual Arabic cursive letters */
  line-height: 2.5;
  font-feature-settings: "cv01", "cv02", "locl", "liga", "clig", "calt", "mkmk", "mark";
  font-variant-ligatures: contextual common-ligatures discretionary-ligatures;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Dedicated Quran Verse Typography */
.quran-ayah-text,
.quran-text {
  font-family: 'Amiri Quran', 'Scheherazade New', 'Amiri', 'Traditional Arabic', serif !important;
  direction: rtl;
  text-align: right;
  letter-spacing: 0 !important;
  word-spacing: 0.22em; /* Generous breathing room between distinct words */
  line-height: 2.75 !important; /* Generous vertical headroom for stacked Uthmani diacritics/tashkeel */
  padding: 0.35rem 0;
  font-feature-settings: "cv01", "cv02", "locl", "liga", "clig", "calt", "mkmk", "mark";
  font-variant-ligatures: contextual common-ligatures discretionary-ligatures;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
  word-break: normal;
}

/* Quranic Ayah Number Badge */
.ayah-number-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin: 0 0.5rem;
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 9999px;
  vertical-align: middle;
  line-height: 1.2;
  white-space: nowrap;
  letter-spacing: 0 !important;
  user-select: none;
}

/* Luxury Metallic Gold Gradients */
.gold-text {
  background: linear-gradient(135deg, #FFF0B8 0%, #D4AF37 45%, #F4D35E 70%, #AA771C 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.gold-gradient-bg {
  background: linear-gradient(135deg, #F3E5AB 0%, #D4AF37 50%, #B38728 100%);
  color: #07080a;
}

.gold-gradient-bg-subtle {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(170, 119, 28, 0.05) 100%);
}

.gold-border {
  border: 1px solid var(--gold-border);
}

.gold-border-glow {
  border: 1px solid var(--gold-border);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.12);
}

.gold-border-glow:hover {
  border-color: var(--gold-border-hover);
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.25);
}

/* Glassmorphism Card System */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--gold-border);
  border-radius: 1rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold-border-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(212, 175, 55, 0.15);
}

.glass-pill {
  background: rgba(25, 28, 36, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(212, 175, 55, 0.2);
  transition: all 0.2s ease;
}

.glass-pill:hover, .glass-pill.active {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #090a0d;
}
::-webkit-scrollbar-thumb {
  background: #2a2e3d;
  border-radius: 4px;
  border: 1px solid rgba(212, 175, 55, 0.15);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold-muted);
}

/* Arabesque Ornaments */
.arabesque-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2.5rem 0;
  opacity: 0.7;
}

.arabesque-divider::before,
.arabesque-divider::after {
  content: '';
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
}

/* Islamic Rub el Hizb (8-pointed star) badge */
.rub-el-hizb {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Hifdh Memorization Tool Styles */
.hifdh-masked-word {
  cursor: pointer;
  display: inline-block;
  margin: 0 3px;
  padding: 2px 6px;
  border-radius: 6px;
  transition: all 0.25s ease;
  user-select: none;
  letter-spacing: 0 !important;
  line-height: inherit;
}

.hifdh-mask-active {
  background: rgba(212, 175, 55, 0.15);
  color: transparent !important;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
  border-bottom: 2px dashed var(--gold-primary);
}

.hifdh-mask-active:hover,
.hifdh-mask-revealed {
  background: rgba(212, 175, 55, 0.22);
  color: #F8ECD1 !important;
  text-shadow: none;
}

.blur-translation {
  filter: blur(6px);
  user-select: none;
  transition: filter 0.3s ease;
}

.blur-translation:hover {
  filter: blur(0px);
}

/* Digital Tasbih luxury counter */
.tasbih-ring-container {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto;
}

.tasbih-btn {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, #252a36 0%, #12141a 100%);
  border: 3px solid var(--gold-primary);
  box-shadow: 0 0 35px rgba(212, 175, 55, 0.25), inset 0 0 20px rgba(212, 175, 55, 0.15);
  color: var(--gold-light);
  cursor: pointer;
  transition: all 0.15s ease-out;
  outline: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tasbih-btn:active {
  transform: scale(0.94);
  box-shadow: 0 0 50px rgba(212, 175, 55, 0.4), inset 0 0 30px rgba(212, 175, 55, 0.3);
  border-color: #FFF0B8;
}

/* Golden button styles */
.btn-gold {
  background: linear-gradient(135deg, #DFC15D 0%, #D4AF37 50%, #9F721B 100%);
  color: #08080a;
  font-weight: 700;
  border: 1px solid #FFE58F;
  border-radius: 0.75rem;
  padding: 0.65rem 1.4rem;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-gold:hover {
  background: linear-gradient(135deg, #EFE08B 0%, #DFC15D 50%, #B58525 100%);
  box-shadow: 0 6px 25px rgba(212, 175, 55, 0.45);
  transform: translateY(-1px);
}

.btn-outline-gold {
  background: rgba(18, 20, 26, 0.6);
  color: var(--gold-light);
  border: 1px solid var(--gold-border);
  border-radius: 0.75rem;
  padding: 0.65rem 1.4rem;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-outline-gold:hover {
  background: rgba(212, 175, 55, 0.12);
  border-color: var(--gold-primary);
  color: #FFF;
}

/* Floating Audio Bar */
.audio-bar-fixed {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  max-width: 900px;
  z-index: 90;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(12, 14, 19, 0.92);
  border: 1px solid var(--gold-border);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(212, 175, 55, 0.2);
  border-radius: 1.25rem;
}

/* Animations */
@keyframes goldShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.gold-shimmer-effect {
  background: linear-gradient(90deg, rgba(212,175,55,0) 0%, rgba(212,175,55,0.2) 50%, rgba(212,175,55,0) 100%);
  background-size: 200% 100%;
  animation: goldShimmer 4s infinite linear;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(212, 175, 55, 0.15); }
  50% { box-shadow: 0 0 35px rgba(212, 175, 55, 0.35); }
}

.pulse-glow {
  animation: pulseGlow 3s infinite ease-in-out;
}

/* Modal styling */
.modal-backdrop {
  background: rgba(5, 6, 8, 0.85);
  backdrop-filter: blur(12px);
}

/* Range input gold styling */
input[type=range] {
  accent-color: var(--gold-primary);
}

/* Qibla Compass Luxury Styling */
.compass-housing {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle, #1a1e28 0%, #0d0f15 70%, #08090d 100%);
  border: 4px solid var(--gold-primary);
  box-shadow: 0 0 35px rgba(212, 175, 55, 0.25), inset 0 0 30px rgba(0, 0, 0, 0.9);
}

@media (min-width: 640px) {
  .compass-housing {
    width: 320px;
    height: 320px;
  }
}

.compass-dial-plate {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.compass-needle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 220px;
  margin-top: -110px;
  margin-left: -4px;
  transform-origin: center center;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

/* ==========================================================================
   INTERACTIVE CARD MICRO-INTERACTIONS & DETAIL MODAL
   ========================================================================== */
.interactive-card {
  cursor: pointer;
  position: relative;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.28s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.28s ease;
}

.interactive-card:hover {
  transform: translateY(-4px);
  border-color: rgba(212, 175, 55, 0.65) !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.75), 0 0 28px rgba(212, 175, 55, 0.22);
  background: var(--bg-card-hover);
}

.interactive-card:active {
  transform: translateY(-1px);
}

.card-click-hint {
  opacity: 0.75;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.interactive-card:hover .card-click-hint {
  opacity: 1;
  transform: translateX(3px);
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-enter {
  animation: modalSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-4 {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

