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

/* --- Theme Variables --- */
:root {
  --font-en: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-ar: 'Tajawal', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Light Mode Values */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-accent: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-accent: #0d9488; /* Teal 600 */
  --text-accent-hover: #0f766e; /* Teal 700 */
  --border-color: #e2e8f0;
  --shadow-primary: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-border: rgba(226, 232, 240, 0.8);
  --glow-color: rgba(13, 148, 136, 0.05);
}

/* Dark Mode Overrides */
html.dark {
  --bg-primary: #090d16; /* Deep Rich Space Navy */
  --bg-secondary: #0f1524;
  --bg-accent: #172033;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-accent: #2dd4bf; /* Teal 400 */
  --text-accent-hover: #14b8a6; /* Teal 500 */
  --border-color: #1e293b;
  --shadow-primary: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --card-bg: rgba(15, 21, 36, 0.75);
  --card-border: rgba(30, 41, 59, 0.6);
  --glow-color: rgba(45, 212, 191, 0.03);
}

/* --- Base Typography & Font Binding --- */
html[lang="en"] {
  font-family: var(--font-en);
}

html[lang="ar"] {
  font-family: var(--font-ar);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  overflow-x: hidden;
}

/* --- Custom Transitions --- */
.theme-transition {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

/* --- Language Visibility Toggles --- */
html.lang-en .lang-ar {
  display: none !important;
}

html.lang-ar .lang-en {
  display: none !important;
}

/* --- Scroll Progress Indicator --- */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background: linear-gradient(90deg, var(--text-accent), #3b82f6);
  z-index: 100;
  transition: width 0.1s ease-out;
}

/* RTL layout scroll progress mirror */
html[lang="ar"] #scroll-progress {
  left: auto;
  right: 0;
  background: linear-gradient(270deg, var(--text-accent), #3b82f6);
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-accent);
}

/* --- Glassmorphism Overlays --- */
.glass-panel {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
}

.glass-nav {
  background: rgba(var(--bg-primary) == #ffffff ? '255, 255, 255' : '9, 13, 22', 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
}

/* --- Floating Animation --- */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0px); }
}

.animate-float {
  animation: float 4s ease-in-out infinite;
}

/* --- Swiper Custom styling --- */
.swiper-pagination-bullet {
  background: var(--text-secondary) !important;
  opacity: 0.4;
  transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
  background: var(--text-accent) !important;
  opacity: 1 !important;
  width: 24px !important;
  border-radius: 4px !important;
}

.swiper-button-next,
.swiper-button-prev {
  color: var(--text-accent) !important;
  transition: all 0.3s ease;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
  transform: scale(1.1);
}

/* --- Dynamic FAQ Height Animation --- */
.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.active .faq-content {
  max-height: 300px; /* arbitrary large value */
}

/* --- Pulsing Glow Effect --- */
.accent-glow {
  position: relative;
}

.accent-glow::after {
  content: '';
  position: absolute;
  inset: -10px;
  background: radial-gradient(circle, var(--text-accent) 0%, transparent 70%);
  opacity: 0.15;
  filter: blur(20px);
  z-index: -1;
  pointer-events: none;
}
