/* Base Styles */
:root {
    --primary-color: #00a8c7;
    --secondary-color: #f8b500;
    --accent-color: #ff6b6b;
    --dark-color: #333333;
    --light-color: #f5f5f5;
    --text-color: #444444;
    --light-text: #777777;
    --background: #FFFFFF;
    --light-background: #F7FAFC;
    --border-color: #E2E8F0;
    --success-color: #48BB78;
    --container-width: 1200px;
    --header-height: 80px;
    --placeholder-bg: #F7FAFC;
    --placeholder-text: #718096;
    --placeholder-border: #E2E8F0;
    --mobile-menu-bg: rgba(255, 255, 255, 0.98);
    --mobile-menu-blur: 10px;
    --mobile-menu-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --z-header: 1000;
    --logo-width: 150px;
    --logo-height: 60px;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --breakpoint-xl: 1200px;
    --breakpoint-lg: 992px;
    --breakpoint-md: 768px;
    --breakpoint-sm: 480px;
    --container-max-width: 1200px;
    --container-padding: 1rem;
    --section-padding: 5rem 0;
    --header-height-mobile: 60px;
    --z-modal: 2000;
    --z-tooltip: 3000;
    --footer-bg: #222222;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    
    /* Add smooth scrolling */
    scroll-behavior: smooth;
    
    /* Font display settings */
    --font-display: swap;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--background);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-display: var(--font-display);
}

/* Page content wrapper */
.page-content {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar-active .page-content {
    transform: translateX(var(--sidebar-width));
}

.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-color);
}

h1 { 
    font-size: 3.5rem; 
    margin-bottom: 1.5rem;
}

h2 { 
    font-size: 2.5rem; 
    margin-bottom: 1.25rem;
}

h3 { 
    font-size: 1.75rem; 
    margin-bottom: 1rem;
}

h4 { 
    font-size: 1.5rem; 
    margin-bottom: 0.75rem;
}

/* Standardized text styles */
.lead-text {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--light-text);
    margin-bottom: 1.5rem;
}

/* Section headers standardization */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    margin-bottom: 1rem;
}

.section-header .lead-text {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.section-divider {
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 1rem auto 1.5rem;
}

/* Consistent spacing */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.py-1 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2 { padding-top: 1rem; padding-bottom: 1rem; }
.py-3 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-4 { padding-top: 2rem; padding-bottom: 2rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }

.px-1 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-2 { padding-left: 1rem; padding-right: 1rem; }
.px-3 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-4 { padding-left: 2rem; padding-right: 2rem; }
.px-5 { padding-left: 3rem; padding-right: 3rem; }

/* Mobile typography */
@media (max-width: var(--breakpoint-lg)) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2.25rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    
    .lead-text {
        font-size: 1.15rem;
    }
}

@media (max-width: var(--breakpoint-md)) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.35rem; }
    h4 { font-size: 1.15rem; }
    
    .lead-text {
        font-size: 1.1rem;
    }
    
    .section-header {
        margin-bottom: 2.5rem;
    }
}

@media (max-width: var(--breakpoint-sm)) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    
    .lead-text {
        font-size: 1rem;
    }
    
    .section-header {
        margin-bottom: 2rem;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.btn i {
    margin-left: 8px;
}

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

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-primary.active {
    background: var(--secondary-color);
    color: white;
}

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

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

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

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

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: rgba(255, 255, 255, 0.98);
    @supports (backdrop-filter: blur(10px)) {
        background: rgba(255, 255, 255, 0.7);
    }
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: var(--z-header);
    transition: all 0.3s ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo img {
    height: 60px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    z-index: var(--z-modal);
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    position: relative;
    transition: color 0.3s ease;
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

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

.nav-links a.active {
    font-weight: 600;
}

.btn-primary.active {
    background-color: var(--secondary-color);
}

.btn.donate-btn.active {
    background-color: var(--secondary-color);
}

.sidebar-nav-items a.active {
    color: var(--secondary-color);
    font-weight: 600;
}

.sidebar-nav-items a.btn.active {
    color: white;
    background-color: var(--secondary-color);
}

/* Navigation for mobile/tablet */
@media (max-width: var(--breakpoint-lg)) {
    .mobile-menu-toggle,
    .hamburger-menu {
        display: flex;
    }
    
    .nav-links {
        display: none;
    }
    
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
}

@media (max-width: var(--breakpoint-sm)) {
    .navbar {
        height: var(--header-height-mobile);
    }
    
    .logo img {
        height: 40px;
    }
}

/* Donate button styles */
.donate-btn {
    padding: 12px 24px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-fixed.donate-btn {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 28px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 900;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-active .mobile-fixed.donate-btn {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 20px);
}

@media (max-width: var(--breakpoint-lg)) {
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block;
    }
    
    .mobile-fixed.donate-btn {
        display: block;
    }
}

/* Hero Section - Standardized for all pages */
.hero, .page-hero, .donate-hero {
    position: relative;
    min-height: 60vh;
    height: auto;
    display: flex;
    align-items: center;
    color: white;
    overflow: hidden;
    padding-top: calc(var(--header-height) + 2rem); /* Consistent spacing from navbar */
    padding-bottom: 3rem;
    background-attachment: fixed; /* Parallax effect */
    text-align: center;
    background-position: center center !important; /* Force center positioning for all hero backgrounds */
}

.hero {
    height: 100vh;
    min-height: 600px;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.7)),
                url('../images/heroes/hero-home.webp') center/cover no-repeat;
}

/* Add subtle movement to hero background for devices that support it */
@media (hover: hover) {
    .hero:hover, .page-hero:hover, .donate-hero:hover {
        background-position: center 10%;
        transition: background-position 8s ease-out;
    }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    color: white !important; /* Ensure text is always white */
}

.hero-content h1,
.hero-content p,
.hero-content .lead-text {
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-quote {
    font-size: 1.25rem;
    margin: 2rem 0;
}

.verse {
    display: block;
    font-style: italic;
    margin-top: 0.5rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Mobile responsiveness for hero sections */
@media (max-width: var(--breakpoint-md)) {
    .hero, .page-hero, .donate-hero {
        padding-top: calc(var(--header-height-mobile) + 2rem);
        padding-bottom: 2rem;
        background-attachment: scroll; /* Disable parallax on mobile */
    }
    
    .hero {
        min-height: 50vh;
        height: auto;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-quote {
        font-size: 1rem;
        margin: 1.5rem 0;
    }
}

@media (max-width: var(--breakpoint-sm)) {
    .hero, .page-hero, .donate-hero {
        padding-top: calc(var(--header-height-mobile) + 1.5rem);
        padding-bottom: 1.5rem;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
}

/* Sections */
.section-padding {
    padding: 5rem 0;
}

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

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.stats-section {
    background: var(--primary-color);
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    color: white;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.stat-label {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
}

.about-image img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Ministries Section */
.ministries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.ministry-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

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

.ministry-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.learn-more {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    text-decoration: none;
    margin-top: 1rem;
    font-weight: 500;
}

.learn-more i {
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.learn-more:hover i {
    transform: translateX(5px);
}

/* Projects Section */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.project-image {
    height: 200px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.project-content {
    padding: 1.5rem;
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
}

.contact-info {
    display: grid;
    gap: 2rem;
}

.contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.contact-item i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

input,
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: white;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 168, 199, 0.1);
}

/* Form validation styles */
.error {
    border-color: #E53E3E !important;
}

.error-message {
    color: #E53E3E;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.success-message {
    color: var(--success-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Mobile form styles */
@media (max-width: var(--breakpoint-md)) {
    input,
    textarea,
    select {
        font-size: 16px; /* Prevent iOS zoom on focus */
        padding: 14px;
    }

    .form-group {
        margin-bottom: 1.25rem;
    }

    .textarea {
        min-height: 100px;
    }

    /* Larger touch targets for checkboxes and radio buttons */
    input[type="checkbox"],
    input[type="radio"] {
        width: 20px;
        height: 20px;
        margin-right: 8px;
    }

    /* Style submit buttons */
    button[type="submit"] {
        width: 100%;
        min-height: 48px;
        margin-top: 1rem;
    }
}

@media (max-width: var(--breakpoint-sm)) {
    input,
    textarea,
    select {
        padding: 12px;
    }

    .form-group {
        margin-bottom: 1rem;
    }
}

/* Newsletter form specific styles */
.newsletter-form {
    display: flex;
    gap: 1rem;
    max-width: 500px;
}

.newsletter-form input {
    flex: 1;
}

@media (max-width: var(--breakpoint-md)) {
    .newsletter-form {
        flex-direction: column;
        gap: 0.75rem;
    }

    .newsletter-form input,
    .newsletter-form button {
        width: 100%;
    }
}

/* Footer */
.footer {
    background: var(--primary-color);
    color: white;
    padding: 4rem 0 2rem;
    margin-top: 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2.5rem;
}

.footer-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-logo {
    display: block;
    width: var(--logo-width);
    height: var(--logo-height);
    margin-bottom: 1.5rem;
    filter: brightness(0) invert(1);
    object-fit: contain;
    object-position: left;
    transition: opacity 0.3s ease;
    background: transparent;
}

.footer-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: left;
}

.footer-info p {
    margin-bottom: 1.5rem;
    opacity: 0.9;
    line-height: 1.6;
    font-size: 0.95rem;
}

.social-links {
    display: flex;
    gap: 1.25rem;
    margin-top: 0.5rem;
}

.social-links a {
    color: white;
    font-size: 1.25rem;
    opacity: 0.9;
    transition: opacity 0.3s ease, transform 0.3s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.social-links a:hover {
    opacity: 1;
    transform: translateY(-2px);
    background: var(--secondary-color);
}

.footer-links h4,
.footer-newsletter h4 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    color: #fff;
}

.footer-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-left: 0;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.9;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    position: relative;
    padding-left: 0;
    display: inline-block;
}

.footer-links a:hover {
    opacity: 1;
    padding-left: 5px;
    color: var(--secondary-color);
}

.footer-newsletter p {
    margin-bottom: 1.25rem;
    opacity: 0.9;
    font-size: 0.95rem;
    line-height: 1.6;
}

.newsletter-form {
    display: flex;
    gap: 0.75rem;
}

.newsletter-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.95rem;
}

.newsletter-form input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.newsletter-form input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

.newsletter-form .btn {
    padding: 0.75rem 1.5rem;
    white-space: nowrap;
    background: white;
    color: var(--primary-color);
    border: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.newsletter-form .btn:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    opacity: 0.8;
    font-size: 0.9rem;
}

@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }

    .footer-info {
        grid-column: 1 / -1;
        max-width: 500px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .footer {
        padding: 3rem 0 1.5rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .footer-info {
        align-items: center;
        text-align: center;
    }

    .footer-logo {
        width: 120px;
        height: 48px;
        margin: 0 auto 1.25rem;
        object-position: center;
    }

    .social-links {
        margin: 1rem auto 0;
        justify-content: center;
    }

    .footer-links,
    .footer-newsletter {
        text-align: center;
        max-width: 500px;
        margin: 0 auto;
    }

    .newsletter-form {
        flex-direction: column;
        max-width: 300px;
        margin: 0 auto;
    }

    .newsletter-form input,
    .newsletter-form .btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .footer {
        padding: 2.5rem 0 1rem;
    }

    .footer-grid {
        gap: 2rem;
    }

    .footer-logo {
        width: 100px;
        height: 40px;
    }

    .social-links {
        gap: 0.75rem;
    }

    .social-links a {
        font-size: 1.1rem;
        width: 32px;
        height: 32px;
    }
    
    .footer-links h4,
    .footer-newsletter h4 {
        font-size: 1.1rem;
        margin-bottom: 1.25rem;
    }
    
    .footer-bottom {
        padding-top: 1.25rem;
    }
    
    .footer-bottom p {
        font-size: 0.85rem;
    }
}

/* Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* Ensure no element stays invisible for more than 1.5 seconds, even if animation fails */
    animation: force-visible 1.5s forwards;
}

/* Animation to ensure elements are visible eventually regardless of JS */
@keyframes force-visible {
    0% {
        opacity: 0;
    }
    99% {
        opacity: 0;
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
    animation: none; /* Stop the force-visible animation if class is applied */
}

/* Utility Classes */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

/* Visibility Classes */
.mobile-only {
    display: none !important;
}

.mobile-fixed {
    display: none !important;
}

@media (max-width: var(--breakpoint-md)) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    .mobile-fixed {
        display: flex !important;
    }
}

/* Video Modal Styles */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.video-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal-container {
    position: relative;
    width: 90%;
    max-width: 800px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    z-index: 2001;
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.3s ease;
}

.video-modal.active .modal-container {
    transform: scale(1);
    opacity: 1;
}

.modal-close {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--primary-color);
    color: white;
    transform: rotate(90deg);
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

@media (max-width: var(--breakpoint-md)) {
    .modal-container {
        width: 95%;
        padding: 15px;
    }

    .modal-close {
        top: -50px;
        right: 0;
    }
}

/* Image Placeholders */
.image-placeholder {
    position: relative;
    background: var(--placeholder-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--placeholder-text);
    font-size: 0.875rem;
    text-align: center;
    padding: 2rem;
    border: 1px solid var(--placeholder-border);
    border-radius: 8px;
    min-height: 200px;
    transition: all 0.3s ease;
}

.image-placeholder::before {
    content: attr(alt);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    white-space: pre-wrap;
    text-align: center;
    line-height: 1.4;
}

.image-placeholder[src$=".webp"],
.image-placeholder[src$=".webp"],
.image-placeholder[src$=".gif"] {
    background: none;
    padding: 0;
}

.image-placeholder[src$=".webp"]::before,
.image-placeholder[src$=".webp"]::before,
.image-placeholder[src$=".gif"]::before {
    display: none;
}

/* Responsive Image Handling */
img {
    max-width: 100%;
    height: auto;
    display: block;
    aspect-ratio: attr(width) / attr(height);
    object-fit: cover;
}

/* Responsive image container */
.img-container {
    position: relative;
    overflow: hidden;
    /* Fallback for aspect-ratio */
    padding-bottom: 56.25%;
    height: 0;
}

@supports (aspect-ratio: 16/9) {
    .img-container {
        padding-bottom: 0;
        height: auto;
        aspect-ratio: 16/9;
    }
}

.img-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hero Images */
.hero-image {
    width: 100%;
    height: 60vh;
    min-height: 400px;
    object-fit: cover;
}

/* Team Images */
.team-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
}

/* About Images */
.about-image img {
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 12px;
}

/* Volunteer Images */
.volunteer-image {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    border-radius: 8px;
}

/* Mobile Responsiveness Improvements */
@media (max-width: var(--breakpoint-md)) {
    .container {
        width: 95%;
        padding: 0 15px;
    }

    .hero {
        background-attachment: scroll;
        min-height: 60vh;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero .hero-quote {
        font-size: 1rem;
    }

    .about-image img {
        aspect-ratio: 4/3;
    }

    .team-image {
        aspect-ratio: 3/4;
    }

    .grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    .hero-content {
        padding: 2rem 1rem;
    }

    .section-padding {
        padding: 3rem 0;
    }
}

@media (max-width: var(--breakpoint-sm)) {
    .container {
        padding: 0 0.75rem;
    }

    .hero-content h1 {
        font-size: 1.75rem;
    }

    .section-padding {
        padding: 3rem 0;
    }

    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }

    .nav-links {
        padding: 1.5rem;
    }

    .nav-links li {
        margin: 0.75rem 0;
    }

    .footer {
        padding: 2rem 0;
    }

    input,
    select,
    textarea {
        font-size: 16px !important; /* Prevent zoom on iOS */
        -webkit-appearance: none;
        border-radius: 8px;
    }
    
    .btn:not(.donate-btn) {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 16px;
    }
    
    .donate-btn.btn {
        width: auto;
        padding: 12px 24px;
    }
}

/* Improved Mobile Menu */
@media (max-width: var(--breakpoint-md)) {
    .nav-links {
        padding-top: 1rem;
        height: calc(100vh - var(--header-height));
        overflow-y: auto;
    }

    .nav-links li {
        width: 100%;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.3s ease;
        transition-delay: calc(var(--item-index) * 0.1s);
    }

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

    .nav-links a {
        width: 100%;
        padding: 1rem;
        text-align: center;
    }
}

/* Prevent Horizontal Scroll */
body {
    overflow-x: hidden;
    width: 100%;
}

/* Improved Form Responsiveness */
@media (max-width: var(--breakpoint-md)) {
    input,
    textarea,
    select {
        font-size: 16px;
        padding: 12px;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    button[type="submit"] {
        width: 100%;
        padding: 1rem;
    }
}

/* Placeholder Image Styles */
.placeholder {
    background-color: var(--gray-100);
    position: relative;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

.placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    animation: loading 1.5s infinite;
}

@keyframes loading {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(100%);
    }
}

.loaded {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Responsive Image Styles */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.logo, .footer-logo {
    width: auto;
    height: auto;
    max-height: 60px;
}

/* Responsive Styles */
/* Extra large devices (large desktops) */
@media (max-width: var(--breakpoint-xl)) {
    .container {
        max-width: calc(var(--breakpoint-xl) - 2rem);
        padding: 0 var(--container-padding);
    }

    .hero-content h1 {
        font-size: 3rem;
    }

    .section-padding {
        padding: 4.5rem 0;
    }
}

/* Large devices (desktops) */
@media (max-width: var(--breakpoint-lg)) {
    .container {
        max-width: calc(var(--breakpoint-lg) - 2rem);
    }

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

    .section-padding {
        padding: 4rem 0;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Medium devices (tablets) */
@media (max-width: var(--breakpoint-md)) {
    .container {
        max-width: 100%;
        padding: 0 1rem;
    }

    .navbar {
        height: var(--header-height-mobile);
    }

    .nav-menu {
        position: fixed;
        top: var(--header-height-mobile);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--header-height-mobile));
        background: var(--background);
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-links {
        flex-direction: column;
        padding: 2rem;
    }

    .nav-links li {
        margin: 1rem 0;
    }

    .mobile-menu-toggle {
        display: block;
    }

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

    .section-padding {
        padding: 3.5rem 0;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Small devices (phones) */
@media (max-width: var(--breakpoint-sm)) {
    .container {
        padding: 0 0.75rem;
    }

    .hero-content h1 {
        font-size: 1.75rem;
    }

    .section-padding {
        padding: 3rem 0;
    }

    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }

    .nav-links {
        padding: 1.5rem;
    }

    .nav-links li {
        margin: 0.75rem 0;
    }

    .footer {
        padding: 2rem 0;
    }

    input,
    select,
    textarea {
        font-size: 16px !important; /* Prevent zoom on iOS */
        -webkit-appearance: none;
        border-radius: 8px;
    }
    
    .btn:not(.donate-btn) {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 16px;
    }
    
    .donate-btn.btn {
        width: auto;
        padding: 12px 24px;
    }
}

/* Issue: Low contrast in footer */
.footer-links a {
    color: white; /* On --primary-color background */
    /* Contrast ratio: 3.2:1 (needs 4.5:1) */
}

.nav-links {
    z-index: var(--z-modal);
}

.mobile-fixed.donate-btn {
    z-index: calc(var(--z-modal) - 1);
}

.volunteer-grid {
    display: flex;
    flex-wrap: wrap;
    @supports (display: grid) {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Remove Firefox's red shadow on invalid inputs */
:invalid {
    box-shadow: none;
}

/* Fix select arrow in Firefox */
select {
    -moz-appearance: none;
    text-indent: 1px;
    text-overflow: '';
}

/* Add to leadership styles */
.director-card {
    display: grid;
    gap: 2rem;
    background: var(--background);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 2rem;
    grid-template-columns: 1fr 2fr;
}

.director-image {
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
}

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

.team-member {
    background: var(--background);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.team-member:hover {
    transform: translateY(-5px);
}

/* Section spacing standardization */
.section-padding {
    padding: 5rem 0;
}

/* Other section types - ensure consistent spacing */
.about-section,
.ministries-section,
.projects-section,
.contact-section,
.donate-section,
.gallery-section,
.volunteer-section,
.team-section,
.mission-section,
.purpose-section {
    padding: 5rem 0; /* Standard section padding */
}

/* First section after hero should have reduced top padding */
.page-hero + section,
.hero + section,
.donate-hero + section {
    padding-top: 3rem;
}

/* Last section before footer should have consistent bottom spacing */
section:last-of-type {
    padding-bottom: 5rem;
}

/* Section spacing for mobile */
@media (max-width: var(--breakpoint-md)) {
    .section-padding,
    .about-section,
    .ministries-section,
    .projects-section,
    .contact-section,
    .donate-section,
    .gallery-section,
    .volunteer-section,
    .team-section,
    .mission-section,
    .purpose-section {
        padding: 3.5rem 0;
    }
    
    .page-hero + section,
    .hero + section,
    .donate-hero + section {
        padding-top: 2.5rem;
    }
    
    section:last-of-type {
        padding-bottom: 3.5rem;
    }
}

@media (max-width: var(--breakpoint-sm)) {
    .section-padding,
    .about-section,
    .ministries-section,
    .projects-section,
    .contact-section,
    .donate-section,
    .gallery-section,
    .volunteer-section,
    .team-section,
    .mission-section,
    .purpose-section {
        padding: 3rem 0;
    }
    
    .page-hero + section,
    .hero + section,
    .donate-hero + section {
        padding-top: 2rem;
    }
    
    section:last-of-type {
        padding-bottom: 3rem;
    }
}

/* ===== Spacing and layout audit fixes ===== */
/* Keep footer tight to preceding section spacing, but push to bottom on short pages */
.footer {
    margin-top: auto;
}

@media (max-width: var(--breakpoint-lg)) {
    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-image {
        order: -1;
    }
}

/* Improve vertical rhythm and prevent cramped card stacks on phones */
@media (max-width: var(--breakpoint-md)) {
    .section-header {
        margin-bottom: 2rem;
    }

    .project-grid,
    .ministries-grid {
        gap: 1.5rem;
    }

    .project-content,
    .ministry-card {
        padding: 1.25rem;
    }

    /* Home page Get in Touch spacing and controls */
    .contact-grid {
        gap: 1.5rem;
    }

    .contact-form {
        padding: 1.25rem;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    #contact .form-group {
        margin-bottom: 1rem;
    }

    #contact .btn.btn-primary {
        width: 100%;
        justify-content: center;
        min-height: 48px;
    }
}

@media (max-width: var(--breakpoint-sm)) {
    .contact-form {
        padding: 1rem;
    }

    .contact-item h3 {
        margin-bottom: 0.5rem;
    }
}

