/* ============================================
   Alkhidmat Foundation - Modern 2026 Design
   ============================================ */

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
    /* Colors - Official Alkhidmat Blue Theme */
    --primary-blue: #0052A5;
    --primary-dark: #003875;
    --primary-light: #1E6BBF;
    --accent-gold: #d4af37;
    --accent-orange: #FF6B35;
    --neutral-dark: #1a1a1a;
    --neutral-gray: #666;
    --neutral-light: #f5f5f5;
    --white: #fff;

    /* Dark Mode Variables */
    --bg-dark-body: #121212;
    --bg-dark-card: #1e1e1e;
    --text-dark-primary: #e0e0e0;
    --text-dark-muted: #b0b0b0;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0052A5 0%, #003875 100%);
    --gradient-gold: linear-gradient(135deg, #d4af37 0%, #b8941f 100%);
    --gradient-hero: linear-gradient(135deg, rgba(0, 56, 117, 0.95) 0%, rgba(0, 82, 165, 0.9) 100%);

    /* Fluid Typography (2026 Mobile-First) */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-size-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
    --font-size-h1: clamp(2.5rem, 5vw + 1rem, 4.5rem);
    --font-size-h2: clamp(2rem, 4vw + 0.5rem, 3.5rem);
    --font-size-h3: clamp(1.5rem, 3vw + 0.25rem, 2.25rem);

    /* Fluid Spacing */
    --space-xs: clamp(0.25rem, 1vw, 0.5rem);
    --space-sm: clamp(0.5rem, 2vw, 1rem);
    --space-md: clamp(1rem, 3vw, 1.5rem);
    --space-lg: clamp(1.5rem, 4vw, 2.5rem);
    --space-xl: clamp(2.5rem, 6vw, 4rem);
    --space-2xl: clamp(4rem, 8vw, 6rem);
    --space-3xl: clamp(6rem, 12vw, 9rem);

    /* Shadows & Transitions */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.12);
    --transition: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Reset & Base
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--neutral-dark);
    background: var(--white);
    overflow-x: hidden;
}

/* ============================================
   Typography
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

/* ============================================
   Container
   ============================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* ============================================
   Header & Navigation
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) 0;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-img {
    height: 50px;
    width: auto;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: var(--space-lg);
}

.nav-link {
    color: var(--neutral-dark);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-blue);
}

.nav-link:hover::after {
    width: 100%;
}

.btn-donate-nav {
    background: var(--gradient-gold);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-donate-nav:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

/* Mobile Menu */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
}

.menu-toggle span {
    width: 28px;
    height: 3px;
    background: var(--neutral-dark);
    border-radius: 3px;
    transition: var(--transition);
}

/* ============================================
   Hero Section - 3D Interactive
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #003875 0%, #0052A5 100%);
    padding-top: 80px;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/hero_humanitarian_work_1769859411641.png');
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 56, 117, 0.9) 0%, rgba(0, 82, 165, 0.85) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: white;
    max-width: 800px;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 5rem);
    margin-bottom: var(--space-md);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s forwards 0.3s;
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    margin-bottom: var(--space-xl);
    opacity: 0;
    font-weight: 300;
    transform: translateY(30px);
    animation: fadeInUp 1s forwards 0.6s;
}

.hero-cta {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s forwards 0.9s;
}

.btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-family: var(--font-heading);
}

.btn-primary {
    background: var(--gradient-gold);
    color: white;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 30px rgba(212, 175, 55, 0.6);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: var(--primary-green);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Stats Counter - Advanced 3D
   ============================================ */
.stats {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: var(--space-3xl) 0;
    margin-top: -50px;
    position: relative;
    z-index: 10;
    perspective: 1500px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.stat-card {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    perspective: 1000px;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: -1;
}

.stat-card:hover {
    transform: translateY(-20px) rotateX(5deg) rotateY(2deg) scale(1.05);
    box-shadow:
        0 30px 80px rgba(0, 82, 165, 0.2),
        0 10px 30px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.stat-card:hover::before {
    opacity: 0.03;
}

.stat-card:hover .stat-number {
    transform: translateZ(30px) scale(1.1);
    text-shadow:
        0 10px 30px rgba(0, 82, 165, 0.3),
        0 0 40px rgba(0, 82, 165, 0.1);
}

.stat-card:hover .stat-label {
    transform: translateZ(15px);
    color: var(--primary-blue);
}

.stat-number {
    font-size: clamp(1.75rem, 2.8vw, 2.5rem);
    font-weight: 900;
    background: linear-gradient(135deg, #00aaff 0%, #0052A5 50%, #d4af37 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-md);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-style: preserve-3d;
    line-height: 1;
    letter-spacing: -0.02em;
    position: relative;
    animation: shimmer 3s ease-in-out infinite;
    text-shadow:
        0 0 30px rgba(0, 170, 255, 0.5),
        0 0 60px rgba(0, 82, 165, 0.3);
    filter: drop-shadow(0 0 20px rgba(0, 170, 255, 0.6));
    width: 100%;
    max-width: 100%;
    overflow: visible;
    white-space: nowrap;
    padding: 0;
}

.stat-label {
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: var(--neutral-gray);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

/* ============================================
   Programs Section
   ============================================ */
.programs {
    padding: var(--space-3xl) 0;
    background: var(--neutral-light);
}

.section-title {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.section-subtitle {
    text-align: center;
    color: var(--neutral-gray);
    max-width: 600px;
    margin: 0 auto var(--space-2xl);
}

.programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
}

.program-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
}

.program-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.program-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.program-content {
    padding: var(--space-lg);
}

.program-title {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
    color: var(--primary-green);
}

.program-desc {
    color: var(--neutral-gray);
    margin-bottom: var(--space-md);
}

.program-link {
    color: var(--primary-green);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.program-link:hover {
    gap: 1rem;
}

/* ============================================
   Scroll Reveal Animations
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: white;
        flex-direction: column;
        padding: var(--space-xl);
        transition: var(--transition);
    }

    .nav-links.active {
        left: 0;
    }

    .hero-cta {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Accessibility
   ============================================ */
*:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   Image Optimization - Lazy Load Fade-in
   ============================================ */
img[data-lazy] {
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

img[data-lazy].loaded {
    opacity: 1;
}

*:focus-visible {
    outline: 3px solid var(--primary-green);
    outline-offset: 2px;
}