/* ==========================================================================
   CSS Variables & Theming (Academic Light Theme)
   ========================================================================== */
:root {
    --primary-green: #2e8270; /* Emerald/Teal from Logo */
    --primary-green-dark: #1b5246;
    --primary-gold: #c5a059; /* Classic Academic Gold */
    --primary-gold-hover: #d8b46a;
    
    --bg-main: #ffffff;
    --bg-alt: #f4f7f6; /* Very subtle grey/green tint */
    --text-main: #2d3748; /* Dark slate for high readability */
    --text-muted: #4a5568;
    
    --card-bg: #ffffff;
    --card-border: rgba(46, 130, 112, 0.05);
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 20px 25px -5px rgba(46, 130, 112, 0.1), 0 10px 10px -5px rgba(46, 130, 112, 0.04);
    
    --font-heading: 'Playfair Display', serif; /* Academic, traditional */
    --font-body: 'Inter', sans-serif; /* Clean, modern, highly readable */
    --font-quote: 'Amiri', serif;
    
    --transition-fast: 0.25s ease-out;
    --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden;
}

/* Animated Mesh Background */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -3;
    background-color: var(--bg-main);
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.7;
    animation: blobFloat 20s infinite alternate ease-in-out;
}

.blob-1 {
    top: -10%; left: -10%;
    width: 55vw; height: 55vw;
    background: rgba(197, 160, 89, 0.35); /* Gold */
    animation-delay: 0s;
}

.blob-2 {
    bottom: -20%; right: -10%;
    width: 65vw; height: 65vw;
    background: rgba(46, 130, 112, 0.25); /* Emerald */
    animation-delay: -5s;
    animation-duration: 25s;
}

.blob-3 {
    top: 40%; left: 50%;
    width: 45vw; height: 45vw;
    background: rgba(255, 235, 190, 0.4); /* Light Cream */
    animation-delay: -10s;
    animation-duration: 18s;
}

@keyframes blobFloat {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); }
    33% { transform: translate(15%, 20%) scale(1.1) rotate(10deg); }
    66% { transform: translate(-15%, -10%) scale(0.9) rotate(-5deg); }
    100% { transform: translate(0, 0) scale(1) rotate(0deg); }
}



/* Cinematic Noise Overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9998;
    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.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Custom Premium Cursor */
@media (pointer: fine) {
    body {
        cursor: none;
    }
    a, button, input, select, .glass-card, .faq-question {
        cursor: none !important;
    }
}

.cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 48px;
    height: 48px;
    background-image: url('rawdat logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.2s ease, opacity 0.2s ease;
    filter: drop-shadow(1px 1px 0 #fff) 
            drop-shadow(-1px -1px 0 #fff) 
            drop-shadow(1px -1px 0 #fff) 
            drop-shadow(-1px 1px 0 #fff);
}

.cursor-dot-hover {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.8;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--primary-green-dark);
}

.section-title {
    font-size: 3.2rem;
    margin-bottom: 3.5rem;
    position: relative;
    display: inline-block;
    color: var(--primary-green-dark);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary-gold);
    border-radius: 2px;
}

.text-center {
    text-align: center;
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.container-narrow {
    max-width: 800px;
}

.section {
    padding: 7rem 0;
}

.section:nth-child(even) {
    background-color: var(--bg-alt);
}

.page-header {
    padding: 11rem 0 6rem;
    text-align: center;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--card-border);
}

.page-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--primary-green-dark);
}

.page-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    font-family: var(--font-body);
}

/* ==========================================================================
   Components
   ========================================================================== */
/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 12px; /* Soft UI Evolution */
    font-weight: 600;
    font-family: var(--font-body);
    transition: all var(--transition-fast);
    cursor: pointer;
    border: 2px solid transparent;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--primary-gold);
    color: #fff;
    box-shadow: 0 4px 6px rgba(197, 160, 89, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-gold-hover);
    transform: translateY(-3px) scale(1.02); /* Motion-Driven */
    box-shadow: 0 10px 15px rgba(197, 160, 89, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-green);
    border-color: var(--primary-green);
}

.btn-secondary:hover {
    background-color: rgba(46, 130, 112, 0.05);
    transform: translateY(-3px) scale(1.02); /* Motion-Driven */
}

/* True Glassmorphism Cards */
.glass-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px; /* Ultra smooth */
    padding: 3.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    transition: transform var(--transition-slow), box-shadow var(--transition-slow);
    position: relative;
    overflow: hidden;
}

/* Expensive Interactive Glow */
.glass-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        600px circle at var(--mouse-x, 0) var(--mouse-y, 0),
        rgba(197, 160, 89, 0.08), /* Subtle gold glow */
        transparent 40%
    );
    border-radius: inherit;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.glass-card:hover::before {
    opacity: 1;
}

.glass-card > * {
    position: relative;
    z-index: 1;
}

.glass-card:hover {
    transform: translateY(-8px) scale(1.01); /* Motion-Driven Microinteraction */
    box-shadow: var(--shadow-hover);
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--primary-gold);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a88344;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: all var(--transition-fast);
    padding: 1.5rem 0;
    background: transparent;
    border-bottom: 1px solid transparent;
}

/* For pages other than home, make navbar solid immediately if needed, 
   but JavaScript handles scroll. To ensure visibility on non-hero pages: */
body:not(:has(.hero)) .navbar {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
body:not(:has(.hero)) .nav-links a { color: var(--text-main); }
body:not(:has(.hero)) .hamburger { color: var(--text-main); }

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    border-bottom: 1px solid var(--card-border);
}

.nav-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-img {
    height: 85px;
    width: auto;
    transition: transform var(--transition-fast);
}

.logo-img:hover {
    transform: scale(1.02);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    font-weight: 500;
    position: relative;
    padding-bottom: 5px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: #fff; /* White by default for hero overlay */
    transition: color var(--transition-fast);
}

.navbar.scrolled .nav-links a {
    color: var(--text-main);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gold);
    transition: width var(--transition-fast);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover,
.navbar.scrolled .nav-links a:hover,
.nav-links a.active,
.navbar.scrolled .nav-links a.active {
    color: var(--primary-gold);
}

.hamburger {
    display: none;
    font-size: 2rem;
    cursor: pointer;
    color: #fff;
}

.navbar.scrolled .hamburger {
    color: var(--text-main);
}

/* Cinematic Mobile Menu Overlay */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 1001;
    padding: 6rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.mobile-menu.active {
    opacity: 1;
    pointer-events: auto;
}

.close-menu {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 2.5rem;
    cursor: pointer;
    color: var(--primary-green-dark);
    transition: transform 0.3s ease;
}

.close-menu:hover {
    transform: rotate(90deg);
}

.mobile-links {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    align-items: center;
}

.mobile-links a {
    color: var(--primary-green-dark);
    font-size: 2rem;
    font-weight: 600;
    font-family: var(--font-heading);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-menu.active .mobile-links a {
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu.active .mobile-links a:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.active .mobile-links a:nth-child(2) { transition-delay: 0.15s; }
.mobile-menu.active .mobile-links a:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu.active .mobile-links a:nth-child(4) { transition-delay: 0.25s; }
.mobile-menu.active .mobile-links a:nth-child(5) { transition-delay: 0.3s; }
.mobile-menu.active .mobile-links a:nth-child(6) { transition-delay: 0.35s; }
.mobile-menu.active .mobile-links a:nth-child(7) { transition-delay: 0.4s; }
.mobile-menu.active .mobile-links a:nth-child(8) { transition-delay: 0.45s; }

/* ==========================================================================
   Hero Section (index.html)
   ========================================================================== */
.hero {
    height: 100vh;
    min-height: 700px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: transparent; /* Allow aura to shine through if needed */
    overflow: hidden;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    /* Mesmerizing fade into the next section */
    -webkit-mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
}

/* Dark overlay to ensure white text remains readable on image/video */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(27, 82, 70, 0.7) 0%, rgba(10, 20, 18, 0.8) 100%);
    z-index: 1;
    -webkit-mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 0 20px;
}

.hero-title {
    font-size: 4.5rem;
    margin-bottom: 1.5rem;
    color: #fff;
    letter-spacing: 1px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.quran-quote {
    margin-bottom: 3.5rem;
}

.quran-quote .arabic {
    font-family: var(--font-quote);
    font-size: 2.8rem;
    color: var(--primary-gold);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.quran-quote .english {
    font-size: 1.2rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
}

.quran-quote .reference {
    font-size: 1rem;
    color: var(--primary-gold);
}

.hero-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

/* ==========================================================================
   Mission Section
   ========================================================================== */
.mission-card {
    color: var(--text-muted);
}

.mission-card p {
    font-size: 1.35rem;
    color: var(--text-main);
    line-height: 1.9;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.mission-card p:last-child {
    margin-bottom: 0;
}

.mission-card strong {
    color: var(--primary-green-dark);
    font-weight: 600;
}

/* ==========================================================================
   Gallery Section (history.html)
   ========================================================================== */
.history-text {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 4rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    aspect-ratio: 4/3;
    box-shadow: var(--shadow-soft);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem 1.5rem 1.5rem;
    background: linear-gradient(to top, rgba(27, 82, 70, 0.9), transparent);
    color: #fff;
    opacity: 0;
    transform: translateY(10px);
    transition: all var(--transition-fast);
}

.gallery-overlay h4 {
    color: #fff;
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 500;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Team Section (team.html)
   ========================================================================== */
.team-intro {
    max-width: 800px;
    margin: 0 auto 4rem;
    font-size: 1.15rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 3rem;
}

.team-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    aspect-ratio: 3/4;
    background: var(--bg-main);
    box-shadow: var(--shadow-soft);
    transition: transform var(--transition-slow), box-shadow var(--transition-slow);
    padding: 0;
    text-align: left;
}

.team-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.team-img-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.team-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.team-card:hover .team-img-wrapper img {
    transform: scale(1.08);
}

.team-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(15, 30, 26, 0.95) 0%, rgba(15, 30, 26, 0.6) 60%, transparent 100%);
    z-index: 2;
    transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.team-card:hover::after {
    height: 100%;
    background: linear-gradient(to top, rgba(15, 30, 26, 0.98) 0%, rgba(15, 30, 26, 0.8) 100%);
}

.team-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    z-index: 3;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.team-card h3 {
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
    color: #fff;
    font-family: var(--font-heading);
    transform: translateY(0);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.team-role {
    color: var(--primary-gold);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0;
    transform: translateY(0);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), margin-bottom 0.5s;
}

.team-card:hover h3,
.team-card:hover .team-role {
    transform: translateY(-8px);
}

.team-card:hover .team-role {
    margin-bottom: 1rem;
}

.team-details-slide {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(20px);
}

.team-card:hover .team-details-slide {
    max-height: 250px;
    opacity: 1;
    transform: translateY(0);
}

.team-details-slide p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.5rem;
}

.team-social {
    display: flex;
    gap: 0.8rem;
}

.team-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.2rem;
    transition: all var(--transition-fast);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.team-social a:hover {
    background: var(--primary-gold);
    transform: translateY(-3px);
    color: #fff;
}

.team-details i {
    color: var(--primary-gold);
    margin-top: 2px;
    font-size: 1.3rem;
}

.team-effort {
    font-size: 1rem;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.7;
    margin-top: 1.5rem;
    padding: 0 1rem;
}

/* ==========================================================================
   Curriculum Section (curriculum.html)
   ========================================================================== */
.curriculum-card {
    position: relative;
    padding: 3rem 2.5rem;
    background: var(--bg-main);
    border-radius: 16px;
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
    text-align: left;
    display: flex;
    flex-direction: column;
}

.curriculum-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(197, 160, 89, 0.15);
    border-color: rgba(197, 160, 89, 0.3);
}

.curriculum-card .watermark {
    position: absolute;
    bottom: -20px;
    right: -20px;
    font-size: 10rem;
    color: var(--primary-gold);
    opacity: 0.05;
    transform: rotate(-15deg);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    z-index: 0;
}

.curriculum-card:hover .watermark {
    transform: rotate(0deg) scale(1.1);
    opacity: 0.1;
}

.curriculum-card .curr-icon {
    width: 60px;
    height: 60px;
    background: rgba(197, 160, 89, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--primary-gold);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.curriculum-card h3 {
    font-size: 1.6rem;
    color: var(--primary-green-dark);
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.curriculum-card p {
    color: var(--text-muted);
    line-height: 1.8;
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   FAQ Section (faq.html)
   ========================================================================== */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 1.5rem;
    border-radius: 12px;
    background: var(--bg-main);
    border: 1px solid var(--card-border);
    border-left: 4px solid transparent;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    transition: all 0.4s ease;
    overflow: hidden;
}

.faq-item:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

.faq-item.active {
    border-left: 4px solid var(--primary-gold);
    box-shadow: 0 10px 30px rgba(197, 160, 89, 0.15);
    border-color: rgba(197, 160, 89, 0.2);
}

.faq-question {
    padding: 1.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--primary-green-dark);
    transition: background 0.4s ease, color 0.4s ease;
}

.faq-question:hover {
    background: rgba(197, 160, 89, 0.03);
}

.faq-question i {
    font-size: 1.5rem;
    color: var(--primary-gold);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), color 0.4s ease;
}

.faq-item.active .faq-question {
    color: var(--primary-gold);
    background: rgba(197, 160, 89, 0.05);
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 2rem;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1), padding 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    color: var(--text-muted);
    line-height: 1.8;
}

.faq-item.active .faq-answer {
    padding: 0 2rem 1.8rem;
    max-height: 500px;
    opacity: 1;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    background: var(--primary-green-dark);
    padding: 5rem 0 2rem;
    color: rgba(255, 255, 255, 0.8);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 4rem;
}

.footer-brand .logo-img {
    height: 90px;
    margin-bottom: 1rem;
    /* Optional: If the logo has dark text, you might need brightness filter here, but assuming it's the standard logo */
    background: transparent;
    padding: 0;
    border-radius: 4px;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    max-width: 300px;
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.contact-item i {
    color: var(--primary-green-dark);
    font-size: 1.5rem;
    background: var(--primary-gold);
    padding: 10px;
    border-radius: 50%;
}

.contact-item a {
    color: rgba(255, 255, 255, 0.8);
}

.contact-item a:hover {
    color: var(--primary-gold);
}

.footer-bottom {
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 0.9rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ==========================================================================
   Language Toggle
   ========================================================================== */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.language-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #fff;
    font-weight: 600;
}

body:not(:has(.hero)) .language-toggle,
.navbar.scrolled .language-toggle {
    color: var(--text-main);
}

.lang-btn {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 500;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.lang-btn:hover, .lang-btn.active-lang {
    opacity: 1;
    color: var(--primary-gold);
}

/* ==========================================================================
   Enrollment Form
   ========================================================================== */
.enrollment-form {
    text-align: left;
}

.floating-group {
    margin-bottom: 2rem;
    position: relative;
}

.floating-group input, .floating-group select {
    width: 100%;
    padding: 1.2rem 1rem 0.8rem;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    transition: all var(--transition-fast);
}

.floating-group input:focus, .floating-group select:focus {
    outline: none;
    border-color: var(--primary-gold);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 15px rgba(197, 160, 89, 0.2);
}

.floating-group label {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    font-weight: 500;
    color: var(--text-muted);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: left top;
}

.floating-group input:focus ~ label,
.floating-group input:not(:placeholder-shown) ~ label,
.floating-group label.active {
    top: 0;
    transform: translateY(-50%) scale(0.85);
    background: var(--bg-main);
    padding: 0 5px;
    color: var(--primary-gold);
    border-radius: 4px;
}

/* ==========================================================================
   Interactive Calendar
   ========================================================================== */
.calendar-wrapper {
    padding: 2rem;
}

.calendar-header {
    text-align: center;
    margin-bottom: 2rem;
}

.calendar-header h2 {
    font-family: var(--font-heading);
    color: var(--primary-green-dark);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    color: var(--primary-gold);
    margin-bottom: 1rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.calendar-day {
    aspect-ratio: 1;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    padding: 0.5rem;
    position: relative;
    background: var(--bg-alt);
}

.calendar-day.empty {
    background: transparent;
    border: none;
}

.calendar-day .date {
    font-weight: 600;
    color: var(--text-muted);
}

.calendar-day.has-event {
    background: #fff;
    border-color: var(--primary-green);
}

.event-chip {
    font-size: 0.75rem;
    background: rgba(46, 130, 112, 0.1);
    color: var(--primary-green-dark);
    padding: 2px 5px;
    border-radius: 4px;
    margin-top: 5px;
    text-align: center;
}

.event-chip.highlight {
    background: var(--primary-gold);
    color: #fff;
}

/* ==========================================================================
   Animations
   ========================================================================== */
.fade-up {
    opacity: 0;
    transform: translateY(50px) scale(0.98);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.delay-1 { transition-delay: 0.15s; }
.delay-2 { transition-delay: 0.3s; }
.delay-3 { transition-delay: 0.45s; }

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 900px) {
    .nav-links, .nav-donate {
        display: none;
    }
    
    .hamburger {
        display: block;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .quran-quote .arabic {
        font-size: 2rem;
    }
    
    .page-title {
        font-size: 2.8rem;
    }
}

@media (max-width: 600px) {
    .hero-title {
        font-size: 2.2rem;
    }
    
    .quran-quote .arabic {
        font-size: 1.5rem;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .section {
        padding: 4rem 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .team-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Premium Loading Screen
   ========================================================================== */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-main);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    position: relative;
}

.loader-calligraphy {
    font-family: var(--font-quote);
    font-size: 5rem;
    color: var(--primary-gold);
    display: block;
    margin-bottom: 20px;
    animation: pulse 2s infinite ease-in-out;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(46, 130, 112, 0.2);
    border-top-color: var(--primary-green-dark);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes pulse {
    0%, 100% { opacity: 0.7; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* ==========================================================================
   Events Section (events.html)
   ========================================================================== */
.calendar-wrapper {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.05);
    border: 1px solid rgba(197, 160, 89, 0.2);
    max-width: 1000px;
    margin: 0 auto;
}

.calendar-header {
    text-align: center;
    margin-bottom: 2rem;
}

.calendar-header h2 {
    font-size: 2rem;
    color: var(--primary-green-dark);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.calendar-day {
    background: #fff;
    min-height: 120px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: 0 2px 10px rgba(0,0,0,0.01);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.calendar-day:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.calendar-day.empty {
    background: transparent;
    border: none;
    box-shadow: none;
}

.calendar-day .date {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-green-dark);
    margin-bottom: 8px;
}

.event-chip {
    font-size: 0.8rem;
    padding: 6px 10px;
    background: rgba(197, 160, 89, 0.1);
    color: var(--primary-gold);
    border-radius: 6px;
    margin-bottom: 4px;
    font-weight: 500;
    border-left: 3px solid var(--primary-gold);
    transition: background 0.3s ease;
    cursor: pointer;
}

.event-chip:hover {
    background: rgba(197, 160, 89, 0.2);
}

.event-chip.highlight {
    background: var(--primary-green);
    color: #fff;
    border-left: 3px solid var(--primary-green-dark);
}

.event-chip.highlight:hover {
    background: var(--primary-green-dark);
}

/* ==========================================================================
   History Section (history.html)
   ========================================================================== */
.history-timeline {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.timeline-card {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    border-left: 4px solid var(--primary-gold);
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.timeline-card:nth-child(even) {
    flex-direction: row-reverse;
    border-left: none;
    border-right: 4px solid var(--primary-green);
    text-align: right;
}

.timeline-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
}

.timeline-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: rgba(197, 160, 89, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-gold);
}

.timeline-card:nth-child(even) .timeline-icon {
    background: rgba(46, 130, 112, 0.1);
    color: var(--primary-green-dark);
}

.timeline-card p {
    font-size: 1.15rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin: 0;
    padding-top: 5px;
}

@media (max-width: 768px) {
    .timeline-card, .timeline-card:nth-child(even) {
        flex-direction: column;
        align-items: center;
        text-align: center;
        border: none;
        border-top: 4px solid var(--primary-gold);
        gap: 1.5rem;
    }
    .timeline-card:nth-child(even) {
        border-top: 4px solid var(--primary-green);
    }
}

/* ==========================================================================
   Home Page Enhancements (index.html)
   ========================================================================== */
.mission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
}

.mission-card {
    padding: 3rem 2.5rem;
    text-align: left;
    border-radius: 20px;
    border: 1px solid rgba(197, 160, 89, 0.15);
    background: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(255,255,255,0.6));
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.mission-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(197, 160, 89, 0.1);
}

.mission-icon {
    width: 70px;
    height: 70px;
    background: var(--primary-green-dark);
    color: var(--primary-gold);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(46, 130, 112, 0.3);
}

.mission-card:nth-child(even) .mission-icon {
    background: var(--primary-gold);
    color: #fff;
    box-shadow: 0 5px 15px rgba(197, 160, 89, 0.3);
}

.mission-card p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-muted);
}

/* Animated CTA Gradient */
.cta-animated-card {
    background: linear-gradient(135deg, var(--primary-green-dark), var(--primary-green), #1a4f43);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    border-radius: 24px;
    padding: 4rem 2rem;
    box-shadow: 0 20px 50px rgba(46, 130, 112, 0.2);
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(197, 160, 89, 0.3);
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.cta-animated-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(197, 160, 89, 0.15), transparent 40%);
    pointer-events: none;
}

.btn-cta-light {
    background: #fff;
    color: var(--primary-green-dark);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.btn-cta-light:hover {
    background: var(--primary-gold);
    color: #fff;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* ==========================================================================
   Premium Islamic Ornaments & Calligraphy
   ========================================================================== */
.bismillah-header {
    font-family: var(--font-quote);
    font-size: 2.8rem;
    color: var(--primary-gold);
    margin-bottom: 0.2rem;
    line-height: 1;
    display: block;
    text-align: center;
    opacity: 0.9;
    text-shadow: 0 4px 15px rgba(197, 160, 89, 0.3);
}

.arabesque-divider {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 4rem auto;
    width: 100%;
    opacity: 0.9;
}

.arabesque-divider::before {
    content: '';
    display: block;
    width: 300px;
    height: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 40'%3E%3Cpath d='M0 20 L 120 20 L 130 10 L 150 30 L 170 10 L 180 20 L 300 20' fill='none' stroke='%23c5a059' stroke-width='2'/%3E%3Ccircle cx='150' cy='20' r='6' fill='%232e8270'/%3E%3Ccircle cx='130' cy='20' r='3' fill='%232e8270'/%3E%3Ccircle cx='170' cy='20' r='3' fill='%232e8270'/%3E%3Cpath d='M150 10 L 160 20 L 150 30 L 140 20 Z' fill='%23c5a059' opacity='0.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.page-header {
    position: relative;
    overflow: hidden;
}

.page-header > .container {
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   Aesthetic Refinements (Glassmorphism & Gold Accents)
   ========================================================================== */
.immersive-calligraphy {
    position: fixed;
    font-family: var(--font-quote);
    color: var(--primary-gold);
    opacity: 0.12; /* Beautifully visible */
    z-index: -3; /* Behind everything */
    pointer-events: none;
    animation: immersiveDrift infinite alternate ease-in-out;
    white-space: nowrap;
    user-select: none;
    text-shadow: 0 0 40px rgba(197, 160, 89, 0.5);
    filter: blur(1px); /* Soft, dreamy feel */
}

@keyframes immersiveDrift {
    0% { transform: translate(0, 0) rotate(-2deg) scale(0.98); }
    100% { transform: translate(80px, -100px) rotate(2deg) scale(1.02); }
}

/* Premium Gold Glows on Hover */
.mission-card:hover,
.team-card:hover,
.gallery-item:hover,
.timeline-card:hover,
.curriculum-card:hover {
    box-shadow: 0 15px 40px rgba(197, 160, 89, 0.18) !important;
    border-color: rgba(197, 160, 89, 0.4) !important;
}

/* Base borders for premium feel */
.mission-card,
.team-card,
.gallery-item,
.curriculum-card {
    border: 1px solid rgba(197, 160, 89, 0.1) !important;
}
