/* ==========================================================================
   تطبيق هُدْهُد | Hudhud - ملف التنسيقات الأساسي (Main Stylesheet)
   هوية فاخرة: زمرد قرآني عميق، لمسات ذهبية متوهجة، وزجاج مصقول
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Amiri+Quran&family=Exo+2:wght@700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Readex+Pro:wght@300;400;500;600;700;800&display=swap');

:root {
  /* الألوان الأساسية - النمط الداكن الزمردي الملكي */
  --bg-primary: #041411;
  --bg-secondary: #07221d;
  --bg-card: rgba(9, 41, 35, 0.75);
  --bg-card-hover: rgba(13, 56, 48, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --border-glass: rgba(16, 185, 129, 0.18);
  --border-gold: rgba(245, 158, 11, 0.3);

  /* الألوان الوظيفية */
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-400: #34d399;
  --gold-500: #f59e0b;
  --gold-600: #d97706;
  --gold-300: #fcd34d;
  --ruby-500: #ef4444;
  --cyan-400: #22d3ee;

  /* النصوص والطباعة */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-gold: #fbbf24;

  /* الخطوط */
  --font-arabic: 'Readex Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-quran: 'Amiri Quran', serif;
  --font-latin: 'Plus Jakarta Sans', sans-serif;

  /* الظلال والتوهج */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-emerald: 0 0 35px rgba(16, 185, 129, 0.25);
  --shadow-gold: 0 0 30px rgba(245, 158, 11, 0.25);

  /* الانتقالات والانحناءات */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* النمط الفاتح النقي والمتقن (Light Mode) */
[data-theme="light"] {
  --bg-primary: #f6faf8;
  --bg-secondary: #ebf4f1;
  --bg-card: #ffffff;
  --bg-card-hover: #f7fcf9;
  --bg-glass: rgba(255, 255, 255, 0.75);
  --border-glass: rgba(16, 185, 129, 0.24);
  --border-gold: rgba(217, 119, 6, 0.35);

  /* الألوان الوظيفية للوضع الفاتح بتباين عالي وسهل القراءة */
  --emerald-500: #059669;
  --emerald-600: #047857;
  --emerald-400: #047857;
  --gold-500: #d97706;
  --gold-600: #b45309;
  --gold-300: #b45309;
  --ruby-500: #dc2626;
  --cyan-400: #0284c7;

  /* نصوص واضحة ومتباينة بالكامل */
  --text-primary: #08231e;
  --text-secondary: #21433b;
  --text-muted: #526e67;
  --text-gold: #92400e;

  --shadow-sm: 0 2px 8px rgba(10, 35, 31, 0.06);
  --shadow-md: 0 8px 24px rgba(10, 35, 31, 0.09);
  --shadow-lg: 0 16px 40px rgba(10, 35, 31, 0.12);
  --shadow-emerald: 0 4px 20px rgba(16, 185, 129, 0.12);
  --shadow-gold: 0 4px 20px rgba(217, 119, 6, 0.12);
}

/* التصفير والقواعد العامة */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-arabic);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  direction: rtl;
  text-align: right;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* خلفية النجوم والزخارف الهندسية التفاعلية */
.ambient-background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-glow-1 {
  position: absolute;
  top: -10%;
  right: -5%;
  width: 650px;
  height: 650px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.18) 0%, rgba(16, 185, 129, 0) 70%);
  filter: blur(80px);
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.ambient-glow-2 {
  position: absolute;
  top: 40%;
  left: -10%;
  width: 550px;
  height: 550px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.12) 0%, rgba(245, 158, 11, 0) 70%);
  filter: blur(90px);
  animation: floatOrb 22s ease-in-out infinite alternate-reverse;
}

.ambient-glow-3 {
  position: absolute;
  bottom: 5%;
  right: 15%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(5, 150, 105, 0.15) 0%, rgba(5, 150, 105, 0) 70%);
  filter: blur(85px);
}

.islamic-pattern-overlay {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(16, 185, 129, 0.07) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.6;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.08); }
  100% { transform: translate(-30px, 50px) scale(0.95); }
}

/* الحاوية والشبكة (Container) */
.container {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
  position: relative;
  z-index: 1;
}

/* شريط التنقل العلوي الفاخر (Navbar) */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 84px;
  z-index: 1000;
  transition: var(--transition);
  background: rgba(4, 20, 17, 0.7);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-glass);
}

[data-theme="light"] .navbar {
  background: rgba(245, 249, 248, 0.85);
}

.navbar.scrolled {
  height: 74px;
  background: rgba(4, 20, 17, 0.92);
  border-bottom-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .navbar.scrolled {
  background: rgba(245, 249, 248, 0.95);
  box-shadow: 0 10px 30px rgba(10, 35, 31, 0.08);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* شعار الموقع (Brand Logo) */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text-primary);
}

.nav-brand-img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
  border: 1.5px solid rgba(245, 158, 11, 0.5);
  transition: var(--transition-bounce);
}

.nav-brand:hover .nav-brand-img {
  transform: rotate(-4deg) scale(1.05);
}

.nav-brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #ffffff 40%, var(--emerald-400) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .brand-title {
  background: linear-gradient(135deg, #063c32 40%, #059669 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-title-en {
  font-family: var(--font-latin);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold-500);
  -webkit-text-fill-color: var(--gold-500);
}

.brand-tagline {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* روابط التنقل المريحة */
.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 12px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.96rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  position: relative;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: var(--bg-glass);
}

.nav-link.active {
  color: var(--emerald-400);
  font-weight: 600;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  right: 16px;
  left: 16px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-500), var(--emerald-400));
  border-radius: 2px;
}

/* أدوات الهيدر (الأزرار والتبديل) */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.theme-toggle-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.15rem;
}

.theme-toggle-btn:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--emerald-500);
  transform: rotate(15deg);
}

/* زر القائمة للشاشات الصغيرة */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 6px;
}

/* تنسيق العناوين والأقسام العامة */
.section {
  padding: 100px 0;
  position: relative;
  z-index: 1;
}

.section-header {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 60px auto;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--emerald-400);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.section-tag.gold {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.25);
  color: var(--gold-300);
}

.section-title {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 18px;
  color: var(--text-primary);
}

.section-title span.highlight-emerald {
  background: linear-gradient(135deg, var(--emerald-400), #a7f3d0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-title span.highlight-gold {
  background: linear-gradient(135deg, var(--gold-500), #fde68a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* الفوتر الفاخر (Footer) */
.site-footer {
  background: rgba(2, 12, 10, 0.95);
  border-top: 1px solid var(--border-glass);
  padding: 80px 0 30px 0;
  position: relative;
  z-index: 1;
}

[data-theme="light"] .site-footer {
  background: #e2edea;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1.1fr 1.1fr 1.2fr;
  gap: 40px;
  margin-bottom: 60px;
}

.footer-brand-info {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.footer-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.8;
  max-width: 360px;
}

/* شارة استوديو التقنية Qynae في الفوتر */
.qynae-brand-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(0, 240, 255, 0.25);
  margin-top: 14px;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}

.qynae-brand-box:hover {
  background: rgba(0, 240, 255, 0.06);
  border-color: #00f0ff;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 240, 255, 0.25);
}

.qynae-logo-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid #00f0ff;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.4);
  object-fit: cover;
  background-color: #080c14;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.qynae-brand-box:hover .qynae-logo-circle {
  transform: rotate(8deg) scale(1.06);
}

.qynae-brand-details {
  display: flex;
  flex-direction: column;
}

.qynae-brand-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.qynae-name {
  font-size: 1.3rem;
  font-weight: 900;
  font-family: 'Exo 2', 'Space Grotesk', var(--font-latin);
  background: linear-gradient(90deg, #5f55f7 0%, #3b82f6 35%, #00f0ff 75%, #a5f3fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.qynae-tagline {
  font-size: 0.76rem;
  color: #38bdf8;
  font-weight: 600;
  font-family: var(--font-latin);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

[data-theme="light"] .qynae-brand-box {
  background: #ffffff;
  border-color: rgba(2, 132, 199, 0.3);
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.08);
}

[data-theme="light"] .qynae-brand-box:hover {
  background: #f0f9ff;
  border-color: #0284c7;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.16);
}

[data-theme="light"] .qynae-tagline {
  color: #0284c7;
}

/* تنسيق قسم التبديل البديل */
.section-alt {
  background: rgba(4, 20, 17, 0.4);
}

[data-theme="light"] .section-alt {
  background: rgba(16, 185, 129, 0.04);
}

.footer-col-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 22px;
  position: relative;
  display: inline-block;
}

.footer-col-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 0;
  width: 28px;
  height: 3px;
  background: var(--gold-500);
  border-radius: 2px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-link:hover {
  color: var(--emerald-400);
  transform: translateX(-4px);
}

.footer-link.highlight {
  color: var(--gold-300);
  font-weight: 600;
}

.footer-bottom {
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-bottom a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}

.footer-bottom a:hover {
  color: var(--emerald-400);
}
