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

:root {
    --primary: #064e3b;
    --primary-light: #065f46;
    --secondary: #d1fae5;
    --accent: #f59e0b;
    --bg-light: #f7f3f0;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --white: #ffffff;
    --glass: rgba(255, 255, 255, 0.7);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
    --radius: 1rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, .brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

.tagline {
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.9;
    letter-spacing: 0.5px;
}

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

ul {
    list-style: none;
}

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

section {
    padding: 100px 5%;
}

/* Navbar */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: var(--transition);
}

nav .brand, nav .nav-links a {
    color: var(--white);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

nav.scrolled {
    background: var(--glass);
    backdrop-filter: blur(15px);
    padding: 15px 5%;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

nav.scrolled .brand, nav.scrolled .nav-links a {
    color: var(--text-dark);
    text-shadow: none;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a:hover {
    color: var(--accent);
}

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

.menu-header, .menu-footer {
    display: none !important;
}

/* Base rule - Hidden by default */
.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--white);
    transition: var(--transition);
    /* Fix for click issue */
    /* Fix for click issue */
    z-index: 1001; 
    padding: 10px;
    margin-right: -10px; /* Offset padding */
    width: 44px;
    height: 44px;
}

nav.scrolled .mobile-toggle {
    color: var(--text-dark);
}

.btn-donate {
    background: var(--primary);
    color: var(--white);
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
}

.btn-donate:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Hero Section */
.hero {
    height: 100vh;
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('../assets/hero.png');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--white);
    padding-top: 80px;
}

.hero h1 {
    font-size: 4.5rem;
    margin-bottom: 20px;
    max-width: 900px;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 40px;
    max-width: 600px;
    opacity: 0.9;
}

.cta-group {
    display: flex;
    gap: 20px;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    padding: 18px 40px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1.1rem;
}

.btn-secondary {
    background: var(--white);
    color: var(--primary);
    padding: 18px 40px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Missions Section */
.mission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 50px;
}

.mission-card {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.05);
}

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

.mission-card i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 20px;
    display: block;
}

/* Programs Section */
.program-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.program-img {
    height: 250px;
    overflow: hidden;
}

.program-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.program-card:hover .program-img img {
    transform: scale(1.1);
}

.program-content {
    padding: 30px;
}

.program-content h3 {
    margin-bottom: 15px;
}

/* Stats Section */
.stats {
    background: var(--primary);
    color: var(--white);
    display: flex;
    justify-content: space-around;
    padding: 80px 5%;
    text-align: center;
}

.stat-item h2 {
    font-size: 3rem;
    margin-bottom: 5px;
}

/* Contact Section */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
}
.contact-info i {
    width: 40px;
    color: var(--primary);
    font-size: 1.2rem;
}
.contact-form {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}
.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
}
.btn-submit {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
}
.btn-submit:hover {
    background: var(--primary-light);
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.8rem; }
    
    /* Mobile rule - Visible on screens < 768px */
    .mobile-toggle { 
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: var(--white);
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        gap: 0;
        transition: transform 0.6s cubic-bezier(0.85, 0, 0.15, 1);
        z-index: 2000;
        padding: 100px 20px 40px;
        visibility: hidden;
    }

    .nav-links.active {
        left: 0;
        visibility: visible;
        transform: translateX(0);
    }

    .nav-links li {
        width: 100%;
        text-align: center;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.4s ease;
        border: 2px solid var(--primary);
        border-radius: 12px;
        margin-bottom: 15px;
        padding: 12px;
    }

    .nav-links.active li {
        opacity: 1;
        transform: translateY(0);
    }

    /* Staggered entry */
    .nav-links.active li:nth-child(2) { transition-delay: 0.1s; }
    .nav-links.active li:nth-child(3) { transition-delay: 0.2s; }
    .nav-links.active li:nth-child(4) { transition-delay: 0.3s; }
    .nav-links.active li:nth-child(5) { transition-delay: 0.4s; }
    .nav-links.active li:nth-child(6) { transition-delay: 0.5s; }

    .nav-links li a {
        color: var(--primary) !important;
        font-size: 1.4rem;
        font-weight: 600;
        display: block;
        width: 100%;
    }

    .menu-header {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        padding: 20px 5%;
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        opacity: 1 !important;
        transform: none !important;
    }

    .menu-header .brand {
        color: var(--primary);
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .menu-header img {
        height: 40px;
    }

    .close-menu {
        font-size: 2rem;
        color: var(--text-dark);
        cursor: pointer;
    }

    .menu-footer {
        position: absolute;
        bottom: 50px;
        text-align: center;
        width: 100%;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.4s ease 0.6s;
    }

    .nav-links.active .menu-footer {
        display: block !important;
        opacity: 0.7;
        transform: translateY(0);
    }

    .social-links {
        display: flex;
        justify-content: center;
        gap: 30px;
        font-size: 1.5rem;
        margin-top: 15px;
        color: var(--primary);
    }

    .btn-donate {
        display: block !important;
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .stats {
        flex-direction: column;
        gap: 50px;
        padding: 60px 5%;
    }

    .stat-item h2 {
        font-size: 2.5rem;
    }
    
    .contact-container { grid-template-columns: 1fr; }
}

/* Gallery Section */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    cursor: pointer;
    box-shadow: var(--shadow);
    background: #ccc; /* Placeholder color while loading */
    aspect-ratio: 1; /* Square tiles */
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Changed from auto to hidden to rely on flex logic */
    background-color: rgba(0, 0, 0, 0.95);
    
    /* Flexbox attributes to center content */
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    border-radius: 4px;
    animation: zoom 0.3s;
}

@keyframes zoom {
    from {transform:scale(0)}
    to {transform:scale(1)}
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-lightbox:hover,
.close-lightbox:focus {
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
}

.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    -webkit-user-select: none;
    background-color: rgba(0,0,0,0.3);
}

.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.prev {
    left: 0;
    border-radius: 3px 0 0 3px;
}

.prev:hover, .next:hover {
    background-color: rgba(0, 0, 0, 0.8);
    color: var(--accent);
}

@media (max-width: 768px) {
    .lightbox-content {
        width: 100%;
    }
}

/* Marquee Section */
.marquee-container {
    background: var(--accent);
    color: var(--primary);
    padding: 12px 0;
    overflow: hidden;
    position: relative;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.marquee-content {
    display: inline-block;
    animation: scroll-left 30s linear infinite;
    padding-left: 100%;
}

.marquee-content span {
    display: inline-block;
    margin-right: 50px;
    font-size: 1rem;
    font-weight: 600;
}

.marquee-content i {
    color: var(--white);
    margin-right: 10px;
}

@keyframes scroll-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.marquee-container:hover .marquee-content {
    animation-play-state: paused;
}
