/* Reset and Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #B91C1C;
    --primary-dark: #991B1B;
    --secondary: #1E3A5F;
    --secondary-dark: #152A45;
    --accent: #F59E0B;
    --text: #1F2937;
    --text-light: #6B7280;
    --bg: #FFFFFF;
    --bg-alt: #F9FAFB;
    --border: #E5E7EB;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 140px; /* Account for fixed header height */
}

/* Alternative method for browsers that don't support scroll-padding-top */
section[id],
[id] {
    scroll-margin-top: 140px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

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

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    padding: 16px 0;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 1.125rem;
}

.logo-icon {
    font-size: 1.5rem;
}

.logo-image {
    max-height: 100px;
    max-width: 100px;
    height: auto;
    width: auto;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 32px;
    margin-left: auto;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: color 0.2s;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.btn-white {
    background: white;
    color: var(--primary);
    font-weight: 600;
    text-shadow: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-white:hover {
    background: var(--bg-alt);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.btn-outline-white {
    background: transparent;
    color: white;
    border: 2px solid white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-outline-white:hover {
    background: #F7F7F7;
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.btn-full {
    width: 100%;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    margin-top: 72px;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    padding: 80px 24px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 24px;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Sections */
.section {
    padding: 80px 0;
}

.section-alt {
    background: var(--bg-alt);
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 60px;
}

.section-tag {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
}

.section-description {
    font-size: 1.125rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}

.stat-card {
    background: white;
    padding: 32px 24px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.9375rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Projects Grid */
.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Mobile view - keep side-by-side for smaller screens */
@media (max-width: 768px) {
    .projects-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.project-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.project-card {
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.project-card-link:hover .project-card {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.project-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.project-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}

.project-card p {
    color: var(--text-light);
    font-size: 0.9375rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Ensure funding progress bars are wide enough on homepage */
.funding-progress-mini {
    width: 100%;
}

.funding-progress-mini > div[style*="height: 16px"] {
    min-height: 16px !important;
    width: 100% !important;
}

.project-status {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
}

.status-category {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 0 0 auto;
}

.category-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.in-progress {
    background: #FEF3C7;
    color: #D97706;
}

.status-badge.planning {
    background: #E5E7EB;
    color: #6B7280;
}

.status-badge.procurement {
    background: #F3E8FF;
    color: #7C3AED;
}

.status-badge.in-service {
    background: #D1FAE5;
    color: #047857;
}

.status-badge.active {
    background: #DBEAFE;
    color: #1E40AF;
}

.status-badge.on-hold {
    background: #FEF3C7;
    color: #D97706;
}

.status-badge.cancelled {
    background: #FEE2E2;
    color: #991B1B;
}

.status-badge.completed {
    background: #E0E7FF;
    color: #4338CA;
}

/* New Multi-Stage Status Badge Colors */
.status-badge.status-gray {
    background: #E5E7EB;
    color: #6B7280;
}

.status-badge.status-blue {
    background: #DBEAFE;
    color: #1E40AF;
}

.status-badge.status-purple {
    background: #F3E8FF;
    color: #7C3AED;
}

.status-badge.status-green {
    background: #D1FAE5;
    color: #047857;
}

.status-badge.status-yellow {
    background: #FEF3C7;
    color: #D97706;
}

.status-badge.status-orange {
    background: #FED7AA;
    color: #C2410C;
}

.status-badge.status-red {
    background: #FEE2E2;
    color: #991B1B;
}

.status-badge.status-indigo {
    background: #E0E7FF;
    color: #4338CA;
}

.status-badge.status-success {
    background: #D1FAE5;
    color: #047857;
}

.funding-goal {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
    margin-left: auto;
}

/* Project Sponsor Names */
.project-sponsors {
    margin: 16px 0;
    text-align: left;
}

.sponsors-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sponsor-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-light);
}

.sponsor-type {
    font-weight: 600;
    color: var(--text);
    margin-right: 4px;
}

.sponsor-group a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.sponsor-group a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Impact Section */
.impact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.impact-text h3 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
}

.impact-text p {
    color: var(--text-light);
    font-size: 1.0625rem;
    margin-bottom: 20px;
    line-height: 1.7;
}

.impact-list {
    list-style: none;
}

.impact-list li {
    padding: 12px 0;
    padding-left: 32px;
    position: relative;
    color: var(--text);
    font-size: 1rem;
}

.impact-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.125rem;
}

.impact-highlight {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.impact-highlight blockquote {
    font-size: 1.25rem;
    font-style: italic;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 20px;
}

.impact-highlight cite {
    font-style: normal;
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.9375rem;
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    max-width: 600px;
    margin: 0 auto;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.contact-item {
    display: flex;
    gap: 16px;
}

.contact-icon {
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.contact-details h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.contact-details p {
    color: var(--text-light);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.contact-details .note {
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-top: 4px;
}

.donate-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--primary);
}

.donate-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

.donate-card > p {
    color: var(--text-light);
    font-size: 0.9375rem;
    margin-bottom: 24px;
    line-height: 1.6;
}

.donation-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.donation-amount {
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: white;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

.donation-amount:hover,
.donation-amount.active {
    border-color: var(--primary);
    background: #FEF2F2;
    color: var(--primary);
}

.tax-note {
    font-size: 0.75rem;
    color: var(--text-light);
    text-align: center;
    margin-top: 16px;
    line-height: 1.5;
}

/* Footer */
.footer {
    background: var(--secondary-dark);
    color: white;
    padding: 60px 0 24px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.footer-brand .logo-icon,
.footer-brand .logo-text {
    color: white;
}

.footer-brand .logo-text {
    font-weight: 700;
    font-size: 1.125rem;
}

.footer-brand p {
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

.footer-links h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: white;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

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

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

.footer-note {
    margin-top: 8px;
    font-size: 0.8125rem;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text);
    margin: 2px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .container {
        padding: 0 24px;
    }

    .logo-image {
        max-height: 60px;
        max-width: 60px;
    }

    .logo-text {
        font-size: 1rem;
    }

    /* Responsive photo galleries */
    #photoGallery,
    #currentPhotos {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
        gap: 12px !important;
    }

    /* Adjust anchor offset for smaller header on mobile */
    html {
        scroll-padding-top: 100px;
    }

    section[id],
    [id] {
        scroll-margin-top: 100px;
    }

    .nav-menu {
        display: none;
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--bg);
        flex-direction: column;
        padding: 80px 24px 24px;
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        z-index: 1000;
    }

    .nav-menu.active {
        display: flex;
        right: 0;
    }

    .nav-menu li {
        margin: 0 0 20px 0;
    }

    .nav-menu a {
        font-size: 1.125rem;
        padding: 12px 16px;
        border-radius: 8px;
        transition: background-color 0.2s;
    }

    .nav-menu a:hover {
        background-color: var(--bg-alt);
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section-header h2 {
        font-size: 1.875rem;
    }

    .impact-content,
    .contact-grid,
    .footer-content {
        grid-template-columns: 1fr;
    }

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

    .donation-options {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 20px;
    }

    .logo-image {
        max-height: 50px;
        max-width: 50px;
    }

    .logo-text {
        font-size: 0.875rem;
    }

    /* Smaller photo galleries on mobile */
    #photoGallery,
    #currentPhotos {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
        gap: 8px !important;
    }

    /* Adjust anchor offset for very small screens */
    html {
        scroll-padding-top: 90px;
    }

    section[id],
    [id] {
        scroll-margin-top: 90px;
    }

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

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

    .project-status {
        flex-direction: column;
        align-items: flex-start;
    }
}
