:root {
    /* Marshall Green */
    --primary-color: #00592D;
    --primary-light: #008141;
    --primary-lighter: #00A956;
    --primary-subtle: rgba(0, 89, 45, 0.1);
    --primary-dark: #003D1F;

    /* Malawi Flag Green - Softer Emerald */
    --secondary-color: #1E824C;
    --secondary-light: #2ECC71;
    --secondary-subtle: rgba(30, 130, 76, 0.1);

    /* Malawi Flag Red */
    --accent-color: #CE1126;
    --accent-light: #EA1F34;
    --accent-subtle: rgba(206, 17, 38, 0.1);

    /* Neutrals */
    --bg-color: #FCFDFD;
    --bg-white: #ffffff;
    --text-dark: #2D3436;
    --text-muted: #636E72;
    --text-light: #ffffff;
    --border-color: rgba(0, 0, 0, 0.05);

    /* Layout Constants */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.05);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s ease-in-out;
    --radius-lg: 24px;
    --radius-md: 16px;
}

/* Bootstrap Overrides & Utilities */
.text-primary {
    color: var(--primary-color) !important;
}

.text-secondary {
    color: var(--secondary-color) !important;
}

.text-accent {
    color: var(--accent-color) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-secondary {
    background-color: var(--secondary-color) !important;
}

.bg-light {
    background-color: var(--bg-color) !important;
}

.bg-primary-subtle {
    background-color: var(--primary-subtle) !important;
}

.bg-secondary-subtle {
    background-color: var(--secondary-subtle) !important;
}

.bg-accent-subtle {
    background-color: var(--accent-subtle) !important;
}

.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-primary:hover {
    background-color: var(--primary-light) !important;
    border-color: var(--primary-light) !important;
}

.btn-outline-primary {
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

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

.badge.bg-primary {
    background-color: var(--primary-color) !important;
}

.badge.bg-secondary {
    background-color: var(--secondary-color) !important;
}

.border-primary {
    border-color: var(--secondary-color) !important;
}

.border-accent {
    border-color: var(--accent-color) !important;
}


html,
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: clip;
    /* Extra safety for mobile overflow */
}

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

a:hover {
    color: var(--primary-color);
}




*:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 4px;
}

/* Glassmorphism Navigation */
.navbar {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
    transition: var(--transition-slow);
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary-color) !important;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.nav-link {
    color: var(--text-dark) !important;
    font-weight: 500;
    margin: 0 10px;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Hero Section */
.hero-section {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, rgba(0, 89, 45, 0.85) 0%, rgba(30, 130, 76, 0.8) 100%), url('assets/compressed/malawi_sunset.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: 0;
    width: 100%;
    height: 100px;
    background: var(--bg-color);
    transform: skewY(-2deg);
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

@media (min-width: 992px) {
    .hero-section {
        text-align: left;
    }
}

/* Hero Stats */
.stat-card {
    transition: var(--transition-base);
    backdrop-filter: blur(8px);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-card:hover {
    transform: translateY(-5px);
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
}

.stat-card i {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    display: block;
    opacity: 0.8;
}

.stat-card.as-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.stats-hero-grid {
    max-width: 800px;
    margin-left: 0;
}

@media (max-width: 992px) {
    .stats-hero-grid {
        margin: 0 auto;
    }
}


/* Buttons */
.btn-custom-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    box-shadow: 0 4px 15px rgba(0, 89, 45, 0.3);
    text-decoration: none;
    display: inline-block;
}

.btn-custom-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 89, 45, 0.2);
    color: white;
}

.hero-section .btn-custom-primary {
    border: 2px solid var(--accent-light);
}

/* Carousel Styling */
#aboutGallery .carousel-item img {
    border-radius: 0;
    /* Container handles radius */
}

#aboutGallery .carousel-control-prev,
#aboutGallery .carousel-control-next {
    width: 5%;
    opacity: 0.7;
}

#aboutGallery .carousel-control-prev-icon,
#aboutGallery .carousel-control-next-icon {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    padding: 2rem;
    background-size: 50%;
    backdrop-filter: blur(2px);
}

#aboutGallery .carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin: 0 4px;
    background-color: white;
    opacity: 0.7;
    border: none;
}

#aboutGallery .carousel-indicators .active {
    background-color: var(--accent);
    opacity: 1;
    transform: scale(1.2);
}

/* Gallery Extras */
.backdrop-blur {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.gallery-img {
    transition: transform 0.3s ease;
}

#aboutGallery .carousel-item:hover .gallery-img {
    transform: scale(1.02);
}

/* Waterfall Hero */
.waterfall-hero {
    position: relative;
    height: 600px;
    overflow: hidden;
    background: #f8f9fa;
}

.waterfall-container {
    display: flex;
    gap: 1rem;
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%) rotate(-5deg);
    /* Slight angle for style */
    width: 120%;
    height: 140%;
    opacity: 0.6;
    /* Fade images so text pops */
    mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
}

.waterfall-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Different speeds for columns */
.waterfall-col:nth-child(1) {
    animation: scrollUp 40s linear infinite;
}

.waterfall-col:nth-child(2) {
    animation: scrollDown 50s linear infinite;
}

.waterfall-col:nth-child(3) {
    animation: scrollUp 45s linear infinite;
}

.waterfall-col:nth-child(4) {
    animation: scrollDown 55s linear infinite;
}

.waterfall-col img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

@keyframes scrollUp {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-50%);
    }
}

@keyframes scrollDown {
    0% {
        transform: translateY(-50%);
    }

    100% {
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .waterfall-hero {
        height: 400px;
        /* Reduced from 600px for better mobile fit */
    }

    .waterfall-col:nth-child(3),
    .waterfall-col:nth-child(4) {
        display: none;
    }

    .waterfall-container {
        width: 150%;
        /* Wider container to compensate for fewer columns filling width */
    }
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.9) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 10;
}

/* Lightbox Controls */
#galleryModal .btn-link {
    transition: opacity 0.2s;
}

#galleryModal .btn-link:hover {
    color: var(--accent) !important;
}

.btn-custom-outline {
    background: transparent;
    color: white;
    border: 2px solid white;
    padding: 10px 28px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
}

.btn-custom-outline:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
}

/* Cards */
.custom-card {
    background: white;
    border-radius: 20px;
    border: none;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: 0.3s;
}

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

/* Photo Placeholders */
.photo-placeholder {
    background-color: var(--primary-subtle);
    border: 2px dashed var(--primary-lighter);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    position: relative;
    overflow: hidden;
    transition: var(--transition-base);
}

.photo-placeholder i {
    font-size: 3rem;
    opacity: 0.5;
    margin-bottom: 1rem;
}

.photo-placeholder::after {
    content: 'Photo Template';
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
}

.aspect-ratio-16-9 {
    aspect-ratio: 16 / 9;
    width: 100%;
}

.aspect-ratio-3-2 {
    aspect-ratio: 3 / 2;
    width: 100%;
}

/* Feature Grid for Hero */
.hero-feature-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--primary-color);
    transition: var(--transition-base);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hero-feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    border-left-color: var(--secondary-color);
}

.hero-feature-card:hover .icon-box {
    background: var(--secondary-subtle);
    color: var(--secondary-color);
    transform: scale(1.1) rotate(-5deg);
}


.icon-box {
    width: 64px;
    height: 64px;
    background: var(--primary-subtle);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--primary-color);
    margin-bottom: 24px;
    transition: var(--transition-base);
    flex-shrink: 0;
}

.mx-auto .icon-box,
.text-center .icon-box {
    margin-left: auto;
    margin-right: auto;
}



/* Section Styling */
.section-padding {
    padding: 60px 0;
}

.section-title {
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 50px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* Donate Section */
.donate-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 30px;
    padding: 80px 40px;
    margin-bottom: 100px;
    box-shadow: 0 20px 40px rgba(0, 89, 45, 0.15);
    position: relative;
    overflow: hidden;
}

.donate-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* Footer */
footer {
    padding: 60px 0 20px;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.social-links a {
    color: var(--text-dark);
    font-size: 1.25rem;
    margin-right: 15px;
    transition: 0.3s;
}

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

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

@media (max-width: 768px) {
    .border-md-last-0 {
        border-right: none !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

    /* Condense vertical space for mobile */
    .hero-section {
        padding: 100px 0 140px;
    }

    .hero-title {
        font-size: 2.25rem;
        margin-bottom: 1rem;
    }

    .hero-lead {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }

    .section-padding {
        padding: 40px 0;
    }

    .custom-card {
        padding: 24px;
    }

    .donate-section {
        padding: 40px;
        margin-bottom: 60px;
    }

    .hero-feature-card {
        flex-direction: row;
        align-items: center;
        text-align: left;
        padding: 1rem;
        gap: 1.25rem;
        height: auto;
    }

    .hero-feature-card .icon-box {
        width: 52px;
        height: 52px;
        font-size: 1.5rem;
        margin-bottom: 0;
        margin-left: 0;
        margin-right: 0;
        flex-shrink: 0;
    }

    .hero-feature-card h6 {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }

    .hero-feature-card p {
        font-size: 0.85rem;
    }

    footer {
        padding: 40px 0 20px;
    }

    .faq-item {
        padding: 1.25rem;
    }

    /* Adjust section title spacing for mobile */
    .section-title {
        margin-bottom: 0.75rem;
    }
}

/* FAQ Styling */
.faq-item {
    background: white;
    padding: 2rem;
    border-radius: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: 0.3s;
}

.faq-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Subtitle Backgrounds - Already covered in utilities but keeping for specificity if needed */
.bg-primary-subtle {
    background-color: var(--primary-subtle) !important;
}

.bg-secondary-subtle {
    background-color: var(--secondary-subtle) !important;
}

.bg-accent-subtle {
    background-color: var(--accent-subtle) !important;
}

.text-accent {
    color: var(--accent-color) !important;
}

.divider-top {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Donation Interactive Components */
.btn-amount {
    border: 2px solid var(--border-color);
    background: white;
    color: var(--text-dark);
    font-weight: 600;
    border-radius: 50px;
    padding: 8px 20px;
    transition: all 0.2s ease;
}

.btn-amount:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-subtle);
}

.btn-amount.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(0, 89, 45, 0.2);
}

.btn-venmo {
    background-color: #3D95CE;
    color: white;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: none;
}

.btn-venmo:hover {
    background-color: #2a7db3;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(61, 149, 206, 0.3);
}

.btn-paypal {
    background-color: #FFC439;
    color: #003087;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: none;
}

.btn-paypal:hover {
    background-color: #f2ba32;
    color: #003087;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 196, 57, 0.3);
}

.form-select,
.form-control {
    border-radius: 12px;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 0.95rem;
}

.form-select:focus,
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem var(--primary-subtle);
}

/* Custom Dropdown Styling for Donation Cause */
.dropdown-custom-toggle {
    text-align: left;
    white-space: normal;
    height: auto;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background-color: #fff;
    width: 100%;
    color: var(--text-dark);
    transition: all 0.2s ease;
}

.dropdown-custom-toggle:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem var(--primary-subtle);
    outline: none;
}

.dropdown-custom-toggle::after {
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.dropdown-menu-custom {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 8px;
    width: 100%;
    max-height: 400px;
    overflow-y: auto;
}

.dropdown-item-custom {
    border-radius: 8px;
    padding: 10px 16px;
    white-space: normal;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.dropdown-item-custom:hover {
    background-color: var(--primary-subtle);
    color: var(--primary-color);
}

.dropdown-item-custom.active {
    background-color: var(--primary-color);
    color: white;
}

.dropdown-header-custom {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    padding: 12px 16px 4px;
}


#googleFormLink:hover {
    text-decoration: underline !important;
}

.btn-sponsorship {
    text-align: left;
    transition: var(--transition-base);
    border-radius: 12px !important;
    margin-bottom: 8px;
    border: 1px solid transparent !important;
}

.btn-sponsorship:hover {
    background-color: var(--primary-subtle) !important;
    border-color: var(--primary-color) !important;
    transform: translateX(5px);
}

.btn-sponsorship h6 {
    transition: var(--transition-base);
}

.btn-sponsorship:hover h6 {
    color: var(--secondary-color) !important;
}


/* Minimal Hero Header for Subpages */
.hero-header-minimal {
    padding: 60px 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    position: relative;
}

.hero-header-minimal h1 {
    font-size: 2.5rem;
}

.address-block {
    background: #f8f9fa;
    border-left: 4px solid var(--secondary-color);
}

.btn-sponsorship {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    padding: 1.5rem !important;
    border-radius: 20px !important;
    background-color: white !important;
    border: 1px solid var(--border-color) !important;
    margin-bottom: 0.75rem;
}

.btn-sponsorship:hover {
    transform: scale(1.02) translateX(5px);
    border-color: var(--primary-color) !important;
    background-color: var(--primary-subtle) !important;
    box-shadow: 0 10px 25px rgba(0, 89, 45, 0.1);
    z-index: 1;
}

.btn-sponsorship .badge {
    transition: all 0.2s ease;
}

.btn-sponsorship:hover .badge {
    transform: scale(1.1);
}


@media (max-width: 768px) {
    .hero-header-minimal {
        padding: 40px 0;
    }

    .hero-header-minimal h1 {
        font-size: 2rem;
    }
}