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

:root {
    --primary: #001B5E;       /* Logo Navy */
    --primary-dark: #001446;
    --secondary: #FFD100;     /* Logo Yellow */
    --secondary-dark: #E6BC00;
    --accent: #2D9F43;        /* Logo Green */
    --bg-dark: #001B5E;
    --bg-light: #F8FAFC;
    --bg-white: #FFFFFF;
    --text-main: #1E293B;
    --text-primary: #001B5E;  /* Dynamic Blue/Yellow */
    --text-muted: #64748B;
    --white: #FFFFFF;
    --glass: rgba(255, 255, 255, 0.9);
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Dark Mode Variables */
body.dark-mode {
    --bg-light: #000B26;
    --bg-white: #001233;
    --text-main: #F8FAFC;
    --text-primary: #FFD100;  /* Yellow in Dark Mode for visibility */
    --text-muted: #94A3B8;
    --glass: rgba(0, 18, 51, 0.9);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* --- Preloader Overlay --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999; /* Higher z-index to stay on top of everything */
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader {
  width: 60px;
  aspect-ratio: 1;
  border: 15px solid var(--bg-light);
  border-radius: 50%;
  position: relative;
  transform: rotate(45deg);
}
.loader::before {
  content: "";
  position: absolute;
  inset: -15px;
  border-radius: 50%;
  border: 15px solid var(--primary); /* Brand Navy */
  animation: l18 2s infinite linear;
}
@keyframes l18 {
    0%   {clip-path:polygon(50% 50%,0 0,0    0,0    0   ,0    0   ,0    0   )}
    25%  {clip-path:polygon(50% 50%,0 0,100% 0,100% 0   ,100% 0   ,100% 0   )}
    50%  {clip-path:polygon(50% 50%,0 0,100% 0,100% 100%,100% 100%,100% 100%)}
    75%  {clip-path:polygon(50% 50%,0 0,100% 0,100% 100%,0    100%,0    100%)}
    100% {clip-path:polygon(50% 50%,0 0,100% 0,100% 100%,0    100%,0    0   )}
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: 'Lexend', sans-serif;
    font-weight: 700;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

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

ul {
    list-style: none;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 5rem 0;
}

/* --- Header & Nav --- */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--glass);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: var(--transition);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-main);
    position: relative;
}

.nav-link:hover { color: var(--primary); }

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

.nav-link:hover::after { width: 100%; }

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-block;
    transition: var(--transition);
}

.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 148, 136, 0.3);
}

.btn-outline {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
}

/* --- Floating Actions --- */
.floating-actions {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 999;
}

.float-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    transition: var(--transition);
    border: none;
    text-decoration: none;
}

#back-to-top {
    background: var(--primary);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.whatsapp-btn {
    background: #25D366;
    position: relative;
}

.whatsapp-btn:hover {
    background: #128C7E;
    transform: scale(1.1);
}

.whatsapp-tooltip {
    position: absolute;
    right: 70px;
    background: white;
    color: #333;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.whatsapp-btn:hover .whatsapp-tooltip {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    .floating-actions { 
        bottom: calc(25px + env(safe-area-inset-bottom)); 
        right: calc(20px + env(safe-area-inset-right)); 
        gap: 12px;
    }
    .float-btn { 
        width: 55px; 
        height: 55px; 
        font-size: 1.4rem; 
        box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    }
}

@media (max-width: 1024px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 350px;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2.5rem;
        transition: transform 0.6s cubic-bezier(0.7, 0, 0.3, 1);
        transform-origin: right center;
        transform: perspective(1000px) rotateY(-90deg);
        box-shadow: -10px 0 30px rgba(0,0,0,0.1);
        z-index: 1000;
        visibility: hidden;
    }

    .nav-links.active {
        right: 0;
        transform: perspective(1000px) rotateY(0deg);
        visibility: visible;
    }

    .nav-link {
        font-size: 1.2rem;
    }
}

/* --- Footer --- */
footer {
    background: var(--bg-dark);
    color: var(--white);
    padding: 5rem 0 2rem;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    gap: 4rem;
    flex-wrap: wrap;
}

.footer-info {
    flex: 2;
    min-width: 300px;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 1rem;
}

.footer-text {
    color: #94a3b8;
    font-size: 0.9rem;
}

.footer-links h4 {
    color: var(--white);
    margin-bottom: 1.5rem;
}

.footer-links ul li { margin-bottom: 0.75rem; }
.footer-links ul li a { color: #94a3b8; }
.footer-links ul li a:hover {
    color: var(--primary);
    padding-left: 5px;
}

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

/* --- Shared Components --- */
.card {
    background: var(--white);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover { transform: translateY(-10px); }

.animate-fade-in {
    animation: fadeIn 0.8s ease forwards;
}

/* --- Utilities --- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--secondary); }
.text-white { color: var(--white); }

.bg-white { background-color: var(--white); }
.bg-light { background-color: var(--bg-light); }
.bg-dark { background-color: var(--bg-dark); }

.grid { display: grid; gap: 2rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important; }

/* Force single column on mobile for ALL grids */
@media (max-width: 1024px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    /* Partner cards - ensure they scale full width */
    .partner-card {
        min-width: 100%;
    }
    
    /* Partner card images and icons - responsive scaling */
    .partner-card img,
    .partner-card i {
        max-width: 50%;
        width: 40px;
        height: 40px;
    }
    
    .partner-card i {
        font-size: 2rem;
    }
    
    /* Take Action pages - Volunteer & Get Involved responsiveness */
    /* Volunteer page - stack the 2-column grid */
    .grid[style*="grid-template-columns: 2fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Ensure cards in take-action pages are full width */
    .card {
        width: 100%;
    }
    
    /* Volunteer page - sticky sidebar should stack below on mobile */
    .card.text-center.sticky {
        position: relative !important;
        top: auto !important;
    }
}

@media (max-width: 768px) {

.flex { display: flex; gap: 1rem; align-items: center; }
.flex-center { justify-content: center; }
.flex-column { flex-direction: column; }

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

/* ===== Form loading / submit spinner ===== */
.form-loading-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    background: rgba(0, 27, 94, 0.55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    z-index: 99999;
    color: #fff;
}
.form-loading-overlay.active { display: flex; }
.form-loading-overlay .form-spinner {
    width: 52px;
    height: 52px;
    border: 5px solid rgba(255, 255, 255, 0.25);
    border-top-color: #ffd100;
    border-radius: 50%;
    animation: formSpin 0.8s linear infinite;
}
.form-loading-overlay .form-loading-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-size: 1rem;
}
@keyframes formSpin { to { transform: rotate(360deg); } }

.btn-spinner {
    display: inline-block;
    width: 1.05em;
    height: 1.05em;
    border: 2.5px solid rgba(255, 255, 255, 0.4);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: btnSpin 0.75s linear infinite;
    vertical-align: -0.2em;
    margin-right: 0.5em;
}
@keyframes btnSpin { to { transform: rotate(360deg); } }
button.btn-loading,
input[type="submit"].btn-loading { color: #fff; pointer-events: none; }

button:disabled, input[type="submit"]:disabled { opacity: 0.7; cursor: not-allowed; }
