@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@200;300;400;500;600;700;800&family=Tajawal:wght@200;300;400;500;700;800;900&family=El+Messiri:wght@400;600;700&family=Cormorant+Garamond:wght@500;600;700&display=swap');

:root {
    /* --- BRAND COLORS --- */
    --primary: #84cc16;
    --primary-glow: rgba(132, 204, 22, 0.4);
    
    /* --- FORCED LIGHT MODE COLORS --- */
    --bg-core: #ffffff; 
    --bg-card: #ffffff;
    --text-main: #111827;   /* Almost Black */
    --text-muted: #6b7280;  /* Gray */
    --text-soft: #9ca3af;
    
    /* --- GLASS --- */
    --glass-border: rgba(132, 204, 22, 0.3); 
    --glass-surface: rgba(0, 0, 0, 0.02);
    
    /* --- FONTS --- */
    --font-en: 'Outfit', sans-serif;
    --font-ar: 'Tajawal', sans-serif;
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

/* --- 1. GLOBAL RESET & TYPOGRAPHY --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-core);
    color: var(--text-main);
    font-family: var(--font-ar), var(--font-en), sans-serif; /* Default to Arabic font preference */
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* Force RTL Direction for Arabic */
html[dir="rtl"] { direction: rtl; text-align: right; }

html[dir="rtl"] body, html[dir="rtl"] h1, html[dir="rtl"] h2, 
html[dir="rtl"] h3, html[dir="rtl"] h4, html[dir="rtl"] p, 
html[dir="rtl"] span, html[dir="rtl"] a, html[dir="rtl"] button {
    font-family: var(--font-ar) !important;
}

/* --- 2. NAVBAR (Fixed Visibility) --- */
header#navbar {
    position: fixed;
    top: 0; left: 0; width: 100%; z-index: 1000;
    padding: 1.5rem;
    transition: all 0.4s ease;
    background: transparent;
}

/* Top State: Transparent BG + White Text */
header#navbar .glass-panel {
    background: rgba(0, 0, 0, 0.2) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

header#navbar a, 
header#navbar span, 
header#navbar i,
header#navbar .fa-bars {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Scrolled State: White BG + Dark Text */
header#navbar.scrolled {
    padding-top: 0.5rem; padding-bottom: 0.5rem;
}

header#navbar.scrolled .glass-panel {
    background: rgba(255, 255, 255, 0.95) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

header#navbar.scrolled a, 
header#navbar.scrolled span, 
header#navbar.scrolled i,
header#navbar.scrolled .fa-bars {
    color: #111827 !important;
    text-shadow: none;
}

header#navbar a:hover, 
header#navbar .text-\[\#84cc16\] {
    color: #84cc16 !important;
}

/* --- 3. HERO & TYPEWRITER --- */
#hero-title-slider, 
#hero-desc-slider {
    color: #ffffff !important;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
    min-height: 120px;
    display: block;
}

.gradient-text {
    background: linear-gradient(135deg, #fbfcfb 0%, #ffffff 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.typing-active::after {
    content: '|';
    color: #84cc16;
    animation: blink 0.9s infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* --- 4. GLASS COMPONENTS --- */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}

.glass-card {
    background: linear-gradient(145deg, var(--glass-surface) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    transition: all 0.5s var(--ease-out-expo);
}

.glass-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 30px var(--primary-glow);
    transform: translateY(-5px);
}

/* --- 5. STATS CONTAINER --- */
.stats-container {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 2rem; margin: 4rem auto; position: relative; z-index: 20;
}

.stat-item {
    background: rgba(250, 249, 249, 0.8);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 24px;
    padding: 2.5rem 3rem;
    text-align: center;
    min-width: 240px;
    transition: all 0.4s var(--ease-out-expo);
}

/* --- 6. BACKGROUND & NOISE --- */
#webgl-canvas, #glass-canvas {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
}

.noise-overlay {
    position: fixed; inset: 0; z-index: 9998; pointer-events: none; opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* --- 7. BUTTONS --- */
.btn-magnetic {
    position: relative; display: inline-flex; align-items: center; padding: 1rem 2.5rem; 
    border: 1px solid var(--primary); border-radius: 100px; color: var(--primary);
    text-decoration: none; overflow: hidden; transition: all 0.4s ease;
}
.btn-magnetic:hover { color: #000 !important; box-shadow: 0 0 30px var(--primary-glow); }
.btn-magnetic::before {
    content: ''; position: absolute; top: 0; left: 0; width: 0%; height: 100%;
    background: var(--primary); z-index: -1; transition: width 0.4s var(--ease-out-expo);
}
.btn-magnetic:hover::before { width: 100%; }

/* --- 8. MATERIAL MODAL (Vertical Animation) --- */
/* Base Modal Container */
.modal-backdrop {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); /* Darker backdrop */
    backdrop-filter: blur(8px);
    z-index: 99999;
    
    /* Animation States */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    
    /* Layout */
    display: flex; align-items: center; justify-content: center;
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.material-modal {
    position: relative; width: 100%; max-width: 1200px;
    z-index: 100000;
}

.material-modal-transparent {
    width: 100%; display: flex; flex-wrap: wrap; 
    justify-content: center; gap: 24px;
}

/* Close Button */
.modal-close-btn {
    position: fixed; top: 30px; right: 30px; z-index: 100001;
    width: 50px; height: 50px;
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%; color: white; font-size: 1.5rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.3s ease; backdrop-filter: blur(10px);
}
.modal-close-btn:hover { background: #ef4444; border-color: #ef4444; transform: rotate(90deg); }

/* Glass Slices - Vertical Opening */
.glass-slice {
    position: relative;
    width: 280px; height: 400px;
    border-radius: 20px; overflow: hidden;
    background-size: cover; background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.4s ease;
    cursor: pointer;
    
    /* Vertical Animation Setup */
    opacity: 0;
    transform: scaleY(0);
    transform-origin: top;
    animation: openVertical 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.glass-slice:hover {
    transform: scaleY(1) translateY(-10px) scale(1.02);
    border-color: #84cc16;
    box-shadow: 0 0 20px rgba(132, 204, 22, 0.4);
}

.glass-slice::before {
    content: ''; position: absolute; inset: 0;
    background-image: inherit; background-size: cover; background-position: center;
    transition: transform 0.7s ease; z-index: 0;
}
.glass-slice:hover::before { transform: scale(1.1); }

/* Glass Overlay Text */
.glass-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%; padding: 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    animation: fadeInText 0.5s ease 0.3s forwards;
    z-index: 2;
}

.glass-overlay h4 { color: white; font-size: 1.2rem; font-weight: bold; margin-bottom: 5px; }
.glass-overlay p { color: #ccc; font-size: 0.9rem; }

/* Animations */
@keyframes openVertical {
    0% { opacity: 0; transform: scaleY(0); }
    100% { opacity: 1; transform: scaleY(1); }
}
@keyframes fadeInText { to { opacity: 1; } }

/* Stagger Delays */
.slice-delay-1 { animation-delay: 0.1s; }
.slice-delay-2 { animation-delay: 0.2s; }
.slice-delay-3 { animation-delay: 0.3s; }
.slice-delay-4 { animation-delay: 0.4s; }

/* --- 9. CONTACT MODAL (Light Mode Fixes) --- */
#contact-modal .material-modal {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}
#contact-modal h3, #contact-modal h4 { color: #111827 !important; }
#contact-modal p, #contact-modal span { color: #555555 !important; }
#contact-modal .fa-xmark { color: #333 !important; }
#contact-modal a {
    background: #f3f4f6 !important; border: 1px solid #e5e7eb !important;
}
#contact-modal a:hover {
    background: rgba(132, 204, 22, 0.1) !important; border-color: #84cc16 !important;
}

/* --- 10. MOBILE MENU (Clean) --- */
@media (max-width: 768px) {
    h1 { font-size: 2.5rem !important; line-height: 1.2; }
    h2 { font-size: 2rem !important; }

    #mobile-menu {
        position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
        background: rgba(5, 5, 5, 0.95); backdrop-filter: blur(20px);
        z-index: 9999; display: flex; flex-direction: column;
        align-items: center; justify-content: center; gap: 1.5rem;
        opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
    }
    
    #mobile-menu.active { opacity: 1; pointer-events: all; }
    
    #mobile-menu a {
        font-size: 1.2rem; color: white; font-weight: 700;
        text-transform: uppercase; letter-spacing: 0.1em; text-decoration: none;
        background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.01));
        border: 1px solid rgba(255, 255, 255, 0.15);
        padding: 1rem 0; width: 80%; max-width: 300px;
        text-align: center; border-radius: 50px;
        transform: translateY(20px); transition: all 0.3s ease;
    }

    #mobile-menu.active a { transform: translateY(0); }
    #mobile-menu a:hover { background: rgba(255, 255, 255, 0.2); border-color: #84cc16; }
}

@media (min-width: 768px) {
    #mobile-menu, .fa-bars, button[onclick="toggleMobileMenu()"] { display: none !important; }
}
/* --- RAMADAN HOSTING EXPERIENCE --- */
body.ramadan-mode {
    /* Deep charcoal/navy evening palette */
    --bg-core: #0b0f19; 
    --bg-card: rgba(15, 23, 42, 0.6);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    /* Warm amber/gold highlights */
    --primary: #d4af37; 
    --primary-glow: rgba(212, 175, 55, 0.25);
    --glass-border: rgba(212, 175, 55, 0.15);
}

/* Galaxy dust overlay (no geometric squares) */
body.ramadan-mode .noise-overlay {
    opacity: 0.12;
    background-image:
        radial-gradient(circle at 18% 24%, rgba(255, 255, 255, 0.08), transparent 26%),
        radial-gradient(circle at 82% 16%, rgba(196, 212, 236, 0.06), transparent 28%),
        radial-gradient(circle at 62% 72%, rgba(255, 245, 225, 0.05), transparent 24%);
    background-size: 145% 145%, 150% 150%, 130% 130%;
    mix-blend-mode: screen;
}

body.ramadan-mode .gradient-text {
    background: linear-gradient(135deg, #fef08a 0%, #d4af37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.ramadan-mode .glass-panel, 
body.ramadan-mode .glass-card {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.7) 0%, rgba(15, 23, 42, 0.4) 100%);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}
/* --- AMBIENT RAMADAN MOVEMENT --- */

/* Show the ambient background only in Ramadan mode */
body.ramadan-mode #ramadan-ambient {
    opacity: 1 !important;
}

/* Nebula drift */
body.ramadan-mode .noise-overlay {
    animation: nebula-shift 48s ease-in-out infinite alternate;
}

@keyframes nebula-shift {
    0% { background-position: 0% 0%, 100% 0%, 50% 100%; }
    100% { background-position: 8% 9%, 94% 10%, 54% 88%; }
}

/* The soft glowing light orbs */
.ambient-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px); /* Makes it look like soft light, not a solid circle */
    background: radial-gradient(circle, rgba(212, 175, 55, 0.15) 0%, rgba(212, 175, 55, 0) 70%);
    animation: drift 26s ease-in-out infinite alternate;
}

/* Position and size the distinct lights */
.glow-1 {
    width: 600px; height: 600px;
    top: -10%; left: -10%;
    animation-duration: 28s;
}

.glow-2 {
    width: 400px; height: 400px;
    bottom: 20%; right: -5%;
    background: radial-gradient(circle, rgba(180, 140, 40, 0.12) 0%, rgba(212, 175, 55, 0) 70%);
    animation-duration: 32s;
    animation-delay: -10s;
}

.glow-3 {
    width: 500px; height: 500px;
    top: 40%; left: 40%;
    background: radial-gradient(circle, rgba(255, 220, 100, 0.08) 0%, rgba(212, 175, 55, 0) 70%);
    animation-duration: 36s;
    animation-delay: -5s;
}

/* The drifting movement */
@keyframes drift {
    0% { transform: translate(0, 0) scale(1); opacity: 0.8; }
    33% { transform: translate(5%, 10%) scale(1.1); opacity: 1; }
    66% { transform: translate(-5%, 5%) scale(0.9); opacity: 0.7; }
    100% { transform: translate(10%, -10%) scale(1.05); opacity: 0.9; }
}

/* Ramadan draggable moon + light */
#ramadan-ambient {
    --moon-x: 82vw;
    --moon-y: 18vh;
    --decor-shift-x: 0px;
    --decor-shift-y: 0px;
    --pointer-x: 50%;
    --pointer-y: 25%;
    --pointer-active: 0;
    pointer-events: none;
}

/* Subtle moving planets */
#ramadan-planets {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.planet {
    position: absolute;
    border-radius: 50%;
    opacity: 0.12;
    filter: blur(0.7px);
    will-change: transform;
}

.planet-1 {
    width: 150px;
    height: 150px;
    top: 14%;
    left: 11%;
    background:
        radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.2), rgba(169, 177, 192, 0.22) 40%, rgba(78, 84, 96, 0.22) 72%, rgba(78, 84, 96, 0.04) 100%);
    box-shadow: 0 0 24px rgba(180, 196, 220, 0.08);
    animation: planet-drift-1 72s ease-in-out infinite alternate;
}

.planet-2 {
    width: 92px;
    height: 92px;
    top: 64%;
    right: 16%;
    background:
        radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.18), rgba(149, 165, 184, 0.2) 48%, rgba(69, 80, 94, 0.2) 78%, rgba(69, 80, 94, 0.04) 100%);
    box-shadow: 0 0 20px rgba(184, 204, 224, 0.07);
    animation: planet-drift-2 64s ease-in-out infinite alternate;
}

.planet-3 {
    width: 62px;
    height: 62px;
    top: 33%;
    right: 42%;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.16), rgba(178, 170, 152, 0.16) 50%, rgba(102, 96, 84, 0.14) 84%, rgba(102, 96, 84, 0.03) 100%);
    box-shadow: 0 0 14px rgba(212, 201, 182, 0.06);
    animation: planet-drift-3 58s ease-in-out infinite alternate;
}

.planet-4 {
    width: 44px;
    height: 44px;
    top: 58%;
    left: 36%;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.12), rgba(184, 187, 198, 0.14) 52%, rgba(90, 94, 106, 0.1) 86%, rgba(90, 94, 106, 0.02) 100%);
    box-shadow: 0 0 10px rgba(205, 214, 226, 0.05);
    animation: planet-drift-4 66s ease-in-out infinite alternate;
}

.planet-5 {
    width: 26px;
    height: 26px;
    top: 22%;
    right: 28%;
    background:
        radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.1), rgba(172, 158, 130, 0.14) 54%, rgba(82, 74, 62, 0.1) 86%, rgba(82, 74, 62, 0.02) 100%);
    box-shadow: 0 0 8px rgba(216, 200, 168, 0.05);
    animation: planet-drift-5 74s ease-in-out infinite alternate;
}

.planet-6 {
    width: 36px;
    height: 36px;
    top: 44%;
    left: 72%;
    background:
        radial-gradient(circle at 28% 28%, rgba(255, 255, 255, 0.12), rgba(162, 177, 193, 0.15) 52%, rgba(78, 91, 108, 0.1) 86%, rgba(78, 91, 108, 0.02) 100%);
    box-shadow: 0 0 10px rgba(196, 214, 234, 0.05);
    animation: planet-drift-6 62s ease-in-out infinite alternate;
}

.planet-7 {
    width: 20px;
    height: 20px;
    top: 68%;
    left: 24%;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1), rgba(178, 171, 158, 0.12) 56%, rgba(88, 82, 74, 0.1) 88%, rgba(88, 82, 74, 0.02) 100%);
    box-shadow: 0 0 8px rgba(221, 207, 188, 0.04);
    animation: planet-drift-7 78s ease-in-out infinite alternate;
}

@keyframes planet-drift-1 {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(28px, -16px, 0); }
}

@keyframes planet-drift-2 {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-22px, 20px, 0); }
}

@keyframes planet-drift-3 {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(18px, -12px, 0); }
}

@keyframes planet-drift-4 {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-14px, 10px, 0); }
}

@keyframes planet-drift-5 {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(12px, -8px, 0); }
}

@keyframes planet-drift-6 {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-10px, 14px, 0); }
}

@keyframes planet-drift-7 {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(9px, -7px, 0); }
}

body.ramadan-mode #ramadan-ambient::before {
    content: "";
    position: absolute;
    inset: -10%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.19;
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, 0.95) 0.9px, transparent 1.3px),
        radial-gradient(circle, rgba(228, 236, 248, 0.72) 0.9px, transparent 1.3px),
        radial-gradient(circle, rgba(248, 244, 236, 0.62) 0.8px, transparent 1.2px);
    background-size: 36px 36px, 54px 54px, 72px 72px;
    background-position: 0 0, 20px 30px, 14px 44px;
    animation: star-stream 44s linear infinite;
}

#ramadan-decor {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

#ramadan-decor::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(180px circle at var(--pointer-x) var(--pointer-y), rgba(255, 246, 214, 0.12), rgba(255, 246, 214, 0));
    opacity: var(--pointer-active);
    transition: opacity 220ms ease;
}

.ramadan-stars,
.ramadan-hangings,
.ramadan-arches {
    transition: transform 260ms ease-out;
    will-change: transform;
}

.ramadan-stars {
    transform: translate3d(calc(var(--decor-shift-x) * 0.5), calc(var(--decor-shift-y) * 0.45), 0);
}

.ramadan-hangings {
    transform: translate3d(calc(var(--decor-shift-x) * 0.22), calc(var(--decor-shift-y) * 0.18), 0);
}

.ramadan-arches {
    transform: translate3d(calc(var(--decor-shift-x) * -0.18), calc(var(--decor-shift-y) * -0.08), 0);
}

.ramadan-stars span {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #f5f8ff;
    opacity: 0.28;
    box-shadow: 0 0 6px rgba(220, 234, 255, 0.3);
    animation: star-twinkle var(--twinkle-speed, 3.6s) ease-in-out infinite;
    transition: transform 220ms ease, box-shadow 220ms ease, opacity 220ms ease;
}

.ramadan-stars span:nth-child(1) { top: 8%; left: 12%; --twinkle-speed: 3.2s; }
.ramadan-stars span:nth-child(2) { top: 14%; left: 28%; --twinkle-speed: 4.1s; }
.ramadan-stars span:nth-child(3) { top: 10%; left: 42%; --twinkle-speed: 3.4s; }
.ramadan-stars span:nth-child(4) { top: 18%; left: 58%; --twinkle-speed: 4.4s; }
.ramadan-stars span:nth-child(5) { top: 9%; left: 75%; --twinkle-speed: 3.1s; }
.ramadan-stars span:nth-child(6) { top: 16%; left: 88%; --twinkle-speed: 4.2s; }
.ramadan-stars span:nth-child(7) { top: 30%; left: 18%; --twinkle-speed: 3.7s; }
.ramadan-stars span:nth-child(8) { top: 26%; left: 36%; --twinkle-speed: 4.6s; }
.ramadan-stars span:nth-child(9) { top: 32%; left: 54%; --twinkle-speed: 3.5s; }
.ramadan-stars span:nth-child(10) { top: 28%; left: 72%; --twinkle-speed: 4.3s; }
.ramadan-stars span:nth-child(11) { top: 34%; left: 84%; --twinkle-speed: 3.9s; }
.ramadan-stars span:nth-child(12) { top: 24%; left: 7%; --twinkle-speed: 4.8s; }

.ramadan-hangings {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40vh;
    opacity: 0.16;
}

.hanging-lantern {
    position: absolute;
    width: 34px;
    height: 54px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255, 232, 166, 0.92), rgba(226, 164, 62, 0.82));
    border: 1px solid rgba(255, 238, 190, 0.7);
    box-shadow: 0 0 35px rgba(235, 185, 82, 0.4);
    animation: lantern-swing var(--lantern-speed, 5.8s) ease-in-out infinite;
}

.hanging-lantern::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    width: 2px;
    height: 95px;
    transform: translateX(-50%);
    background: linear-gradient(to top, rgba(255, 229, 166, 0.58), rgba(255, 229, 166, 0.1));
}

.hanging-lantern::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 16px;
    width: 17px;
    height: 17px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 250, 234, 0.95), rgba(255, 218, 117, 0.2));
}

.hanging-lantern:nth-child(1) {
    left: 12%;
    top: 62px;
    --lantern-speed: 6.2s;
}

.hanging-lantern:nth-child(2) {
    left: 50%;
    top: 28px;
    --lantern-speed: 5.4s;
}

.hanging-lantern:nth-child(3) {
    right: 12%;
    top: 72px;
    --lantern-speed: 6.6s;
}

.ramadan-arches {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 32vh;
    opacity: 0.24;
    background:
        linear-gradient(to top, rgba(6, 12, 26, 0.96), rgba(6, 12, 26, 0.26) 66%, rgba(6, 12, 26, 0)),
        repeating-linear-gradient(90deg, rgba(228, 192, 93, 0.08) 0 1px, rgba(0, 0, 0, 0) 1px 64px);
    -webkit-mask-image: radial-gradient(40px 38px at 32px 100%, #000 98%, transparent 102%);
    -webkit-mask-size: 64px 100%;
    -webkit-mask-repeat: repeat-x;
    mask-image: radial-gradient(40px 38px at 32px 100%, #000 98%, transparent 102%);
    mask-size: 64px 100%;
    mask-repeat: repeat-x;
}

#ramadan-moonlight {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(250px circle at var(--moon-x) var(--moon-y), rgba(255, 248, 225, 0.28) 0%, rgba(240, 220, 160, 0.17) 32%, rgba(240, 220, 160, 0.06) 56%, rgba(240, 220, 160, 0) 78%),
        radial-gradient(860px circle at var(--moon-x) calc(var(--moon-y) + 60px), rgba(218, 198, 142, 0.14) 0%, rgba(218, 198, 142, 0.08) 43%, rgba(218, 198, 142, 0) 74%);
    mix-blend-mode: screen;
}

#ramadan-moon {
    z-index: 80 !important;
}

#ramadan-moon {
    position: absolute;
    left: var(--moon-x);
    top: var(--moon-y);
    width: 112px;
    height: 112px;
    transform: translate(-50%, -50%);
    border: 0;
    border-radius: 50%;
    cursor: grab;
    pointer-events: auto;
    touch-action: none;
    background: radial-gradient(circle at 32% 35%, #fffef8 0%, #f6e7bf 60%, #ddaf55 100%);
    box-shadow:
        0 0 46px rgba(255, 227, 138, 0.78),
        0 0 120px rgba(236, 194, 84, 0.56),
        0 0 220px rgba(236, 194, 84, 0.28);
    z-index: 6;
    animation: moon-hover 6.8s ease-in-out infinite;
}

#ramadan-moon::before {
    content: "";
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 237, 179, 0.55);
    opacity: 0.8;
    animation: moon-halo 3.8s ease-in-out infinite;
}

#ramadan-moon::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at 36% 38%, rgba(195, 142, 62, 0.2) 0 8px, transparent 9px),
        radial-gradient(circle at 63% 58%, rgba(195, 142, 62, 0.18) 0 6px, transparent 7px),
        radial-gradient(circle at 48% 70%, rgba(195, 142, 62, 0.14) 0 5px, transparent 6px);
    opacity: 0.85;
}

#ramadan-moon.is-dragging {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.03);
    animation-play-state: paused;
}

@keyframes star-twinkle {
    0%, 100% { opacity: 0.35; transform: scale(0.88); }
    50% { opacity: 1; transform: scale(1.14); }
}

@keyframes lantern-swing {
    0%, 100% { transform: rotate(0deg) translateY(0); }
    25% { transform: rotate(2.5deg) translateY(-3px); }
    75% { transform: rotate(-2.5deg) translateY(2px); }
}

@keyframes moon-hover {
    0%, 100% { transform: translate(-50%, -50%); }
    50% { transform: translate(-50%, -52%); }
}

@keyframes moon-halo {
    0%, 100% { opacity: 0.72; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.06); }
}

@keyframes star-stream {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-90px, 130px, 0); }
}

/* --- RAMADAN REDESIGN OVERRIDES --- */
:root {
    --font-en: 'Cormorant Garamond', serif;
    --font-ar: 'El Messiri', sans-serif;
}

body.ramadan-mode {
    --bg-core: #05070d;
    --bg-card: rgba(9, 12, 20, 0.72);
    --text-main: #f8f3e8;
    --text-muted: #b5b0a7;
    --text-soft: #8e8a82;
    --primary: #e4c05d;
    --primary-glow: rgba(228, 192, 93, 0.35);
    --glass-border: rgba(228, 192, 93, 0.24);
    --glass-surface: rgba(14, 18, 28, 0.65);
    position: relative;
    background:
        radial-gradient(circle at 14% 20%, rgba(255, 255, 255, 0.07), transparent 30%),
        radial-gradient(circle at 78% 18%, rgba(180, 196, 220, 0.08), transparent 32%),
        radial-gradient(circle at 52% 75%, rgba(255, 228, 174, 0.06), transparent 28%),
        linear-gradient(170deg, #030406 0%, #05070d 46%, #070a12 100%);
}

body.ramadan-mode::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.42;
    background-image:
        radial-gradient(circle at 20% 16%, rgba(255, 255, 255, 0.8) 1px, transparent 1.5px),
        radial-gradient(circle at 74% 26%, rgba(228, 236, 248, 0.68) 1px, transparent 1.4px),
        radial-gradient(circle at 40% 72%, rgba(255, 221, 195, 0.55) 1px, transparent 1.3px),
        radial-gradient(circle at 84% 66%, rgba(255, 255, 255, 0.5) 1px, transparent 1.2px);
    background-size: 130px 130px, 170px 170px, 220px 220px, 280px 280px;
    animation: stars-drift 62s linear infinite;
}

@keyframes stars-drift {
    from { transform: translateY(0); }
    to { transform: translateY(-120px); }
}

body.ramadan-mode::after {
    content: "";
    position: fixed;
    inset: -20%;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle at 60% 35%, rgba(255, 255, 255, 0.08), transparent 44%),
        radial-gradient(circle at 44% 62%, rgba(220, 228, 240, 0.06), transparent 40%);
    mix-blend-mode: screen;
    filter: blur(48px);
    opacity: 0.36;
    animation: galaxy-swirl 90s linear infinite;
}

@keyframes galaxy-swirl {
    from { transform: rotate(0deg) scale(1); }
    to { transform: rotate(360deg) scale(1.1); }
}

body.ramadan-mode .video-shadow-overlay {
    background:
        linear-gradient(to top, rgba(4, 8, 16, 0.82), rgba(6, 12, 24, 0.38)),
        radial-gradient(circle at 50% 16%, rgba(228, 192, 93, 0.16), transparent 50%);
}

body.ramadan-mode #hero-title-slider {
    letter-spacing: 0.02em;
    text-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}

body.ramadan-mode #hero-desc-slider {
    color: #ede6d8 !important;
}

body.ramadan-mode .btn-magnetic {
    color: #f8f3e8;
    border-color: var(--primary);
    background: rgba(228, 192, 93, 0.08);
}

body.ramadan-mode .btn-magnetic::before {
    background: linear-gradient(135deg, #f2d57a 0%, #c3922e 100%);
}

body.ramadan-mode .btn-magnetic:hover {
    color: #1a1408 !important;
}

body.ramadan-mode #navbar .glass-panel,
body.ramadan-mode .glass-panel,
body.ramadan-mode .glass-card,
body.ramadan-mode .stat-item,
body.ramadan-mode .spotlight-card {
    background: linear-gradient(160deg, rgba(9, 18, 39, 0.78), rgba(16, 30, 56, 0.56)) !important;
    border: 1px solid rgba(228, 192, 93, 0.22) !important;
    box-shadow: 0 18px 45px rgba(3, 8, 20, 0.45);
}

body.ramadan-mode #navbar .glass-panel {
    background: linear-gradient(160deg, rgba(9, 18, 39, 0.9), rgba(14, 29, 56, 0.75)) !important;
}

body.ramadan-mode header#navbar.scrolled .glass-panel {
    background: linear-gradient(160deg, rgba(8, 16, 35, 0.95), rgba(15, 27, 49, 0.9)) !important;
    border-color: rgba(228, 192, 93, 0.34) !important;
}

body.ramadan-mode header#navbar a,
body.ramadan-mode header#navbar span,
body.ramadan-mode header#navbar i,
body.ramadan-mode header#navbar .fa-bars {
    color: #f3ebdc !important;
    text-shadow: none;
}

body.ramadan-mode .text-\[\#84cc16\],
body.ramadan-mode .text-\[\#84cc16\] * {
    color: var(--primary) !important;
}

body.ramadan-mode .stats-container .counter {
    color: #f0d78f !important;
    text-shadow: 0 0 26px rgba(228, 192, 93, 0.3);
}

body.ramadan-mode .stat-item p,
body.ramadan-mode p,
body.ramadan-mode .text-gray-500,
body.ramadan-mode .text-gray-600,
body.ramadan-mode .text-gray-400 {
    color: var(--text-muted) !important;
}

body.ramadan-mode h1,
body.ramadan-mode h2,
body.ramadan-mode h3,
body.ramadan-mode h4,
body.ramadan-mode .text-theme-main {
    color: var(--text-main) !important;
}

body.ramadan-mode .ramadan-lanterns {
    display: flex;
    justify-content: center;
    gap: 1.3rem;
}

body.ramadan-mode .ramadan-lanterns span {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f8e9bc;
    font-size: 1rem;
    background: linear-gradient(145deg, rgba(244, 202, 97, 0.24), rgba(244, 202, 97, 0.05));
    border: 1px solid rgba(244, 202, 97, 0.45);
    box-shadow: 0 0 25px rgba(228, 192, 93, 0.2);
    animation: lantern-float 4.6s ease-in-out infinite;
}

body.ramadan-mode .ramadan-lanterns span:nth-child(2) { animation-delay: .5s; }
body.ramadan-mode .ramadan-lanterns span:nth-child(3) { animation-delay: 1s; }

@keyframes lantern-float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-9px); }
}

body.ramadan-mode .noise-overlay {
    opacity: 0.12;
    mix-blend-mode: screen;
}

body.ramadan-mode .gradient-text {
    background: linear-gradient(120deg, #fff3ca 10%, #f2cb67 45%, #bf8b2f 90%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.ramadan-mode .material-modal,
body.ramadan-mode #contact-modal .material-modal {
    background: linear-gradient(160deg, rgba(12, 20, 40, 0.95), rgba(16, 32, 57, 0.9)) !important;
    border-color: rgba(228, 192, 93, 0.36) !important;
}

body.ramadan-mode #contact-modal h3,
body.ramadan-mode #contact-modal h4,
body.ramadan-mode #contact-modal p,
body.ramadan-mode #contact-modal span,
body.ramadan-mode #contact-modal i {
    color: #f5eedf !important;
}

/* Keep material-library icons visible in Ramadan mode */
body.ramadan-mode button[onclick^="openMaterialModal"] i {
    color: #ffffff !important;
}

body.ramadan-mode button[onclick^="openMaterialModal"] span {
    color: #f5eedf !important;
}

body.ramadan-mode button[onclick^="openMaterialModal"]:hover i {
    color: #111827 !important;
}

body.ramadan-mode button[onclick^="openMaterialModal"]:hover span {
    color: #111827 !important;
}

@media (max-width: 768px) {
    .planet-1 {
        width: 110px;
        height: 110px;
        opacity: 0.16;
    }

    .planet-2 {
        width: 72px;
        height: 72px;
        opacity: 0.15;
    }

    .planet-3 {
        width: 46px;
        height: 46px;
        opacity: 0.13;
    }

    .planet-4 {
        width: 30px;
        height: 30px;
        opacity: 0.1;
    }

    .planet-5 {
        width: 18px;
        height: 18px;
        opacity: 0.09;
    }

    .planet-6 {
        width: 26px;
        height: 26px;
        opacity: 0.1;
    }

    .planet-7 {
        width: 14px;
        height: 14px;
        opacity: 0.08;
    }

    #ramadan-decor::before {
        background: radial-gradient(120px circle at var(--pointer-x) var(--pointer-y), rgba(245, 213, 124, 0.2), rgba(245, 213, 124, 0));
    }

    .ramadan-stars span {
        width: 2px;
        height: 2px;
    }

    .ramadan-hangings {
        height: 28vh;
    }

    .hanging-lantern {
        width: 24px;
        height: 40px;
    }

    .hanging-lantern::before {
        height: 62px;
    }

    .hanging-lantern:nth-child(2) {
        top: 12px;
    }

    .ramadan-arches {
        height: 22vh;
        opacity: 0.65;
    }

    #ramadan-moon {
        width: 84px;
        height: 84px;
    }

    #ramadan-moonlight {
        background:
            radial-gradient(170px circle at var(--moon-x) var(--moon-y), rgba(255, 242, 196, 0.28) 0%, rgba(236, 203, 104, 0.2) 30%, rgba(236, 203, 104, 0.06) 54%, rgba(236, 203, 104, 0) 78%),
            radial-gradient(500px circle at var(--moon-x) calc(var(--moon-y) + 40px), rgba(223, 180, 82, 0.17) 0%, rgba(223, 180, 82, 0.08) 38%, rgba(223, 180, 82, 0) 72%);
    }

    body.ramadan-mode::before {
        opacity: 0.14;
        background-size: 180px 180px, 180px 180px, 200px 200px;
    }

    body.ramadan-mode .ramadan-lanterns span {
        width: 38px;
        height: 38px;
        font-size: .9rem;
    }
}

/* --- CALMER SPACE BACKGROUND OVERRIDE --- */
body.ramadan-mode {
    background:
        radial-gradient(circle at 50% -20%, rgba(248, 238, 214, 0.08), transparent 34%),
        linear-gradient(180deg, #050608 0%, #07090f 48%, #090c13 100%);
}

body.ramadan-mode .noise-overlay {
    opacity: 0.05 !important;
    animation: none !important;
    background-image:
        radial-gradient(circle at 22% 28%, rgba(255, 255, 255, 0.05), transparent 24%),
        radial-gradient(circle at 78% 16%, rgba(228, 236, 248, 0.04), transparent 26%);
    background-size: 160% 160%, 180% 180%;
}

body.ramadan-mode::before {
    opacity: 0.03 !important;
    animation: stars-drift 180s linear infinite !important;
    background-size: 180px 180px, 260px 260px, 360px 360px, 460px 460px !important;
}

body.ramadan-mode::after {
    display: none !important;
}

#ramadan-decor {
    display: block !important;
}

.ramadan-stars {
    display: none !important;
}

#ramadan-planets {
    opacity: 0.38;
}

.planet {
    opacity: 0.14 !important;
    filter: blur(1px) !important;
}

.ambient-glow {
    opacity: 0.35;
    animation-duration: 40s !important;
}

#ramadan-moonlight {
    background:
        radial-gradient(220px circle at var(--moon-x) var(--moon-y), rgba(255, 246, 219, 0.2) 0%, rgba(243, 228, 178, 0.1) 34%, rgba(243, 228, 178, 0) 76%),
        radial-gradient(760px circle at var(--moon-x) calc(var(--moon-y) + 44px), rgba(220, 204, 160, 0.09) 0%, rgba(220, 204, 160, 0.04) 42%, rgba(220, 204, 160, 0) 72%);
}

.ramadan-toys {
    position: absolute;
    top: 18%;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    pointer-events: none;
    opacity: 0.42;
}

.ramadan-toys .toy {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    position: relative;
    animation: toy-float 8s ease-in-out infinite;
}

.toy-crescent {
    background: radial-gradient(circle at 30% 30%, rgba(255, 244, 213, 0.88), rgba(218, 183, 106, 0.52));
    box-shadow: 0 0 14px rgba(255, 230, 170, 0.28);
}

.toy-crescent::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    top: 5px;
    left: 10px;
    border-radius: 50%;
    background: #07090f;
}

.toy-fanous {
    width: 20px !important;
    height: 34px !important;
    border-radius: 8px !important;
    background: linear-gradient(180deg, rgba(255, 232, 174, 0.88), rgba(205, 148, 64, 0.66));
    box-shadow: 0 0 12px rgba(235, 186, 92, 0.24);
    animation-delay: -1.4s !important;
}

.toy-star {
    border-radius: 0 !important;
    clip-path: polygon(50% 0%, 61% 36%, 100% 36%, 68% 58%, 80% 100%, 50% 74%, 20% 100%, 32% 58%, 0% 36%, 39% 36%);
    background: linear-gradient(180deg, rgba(255, 242, 205, 0.92), rgba(213, 175, 96, 0.62));
    box-shadow: 0 0 12px rgba(255, 226, 164, 0.24);
    animation-delay: -2.8s !important;
}

@keyframes toy-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}
