/*
 * Impact Page Styles
 * Clean, professional design matching the site's aesthetic.
 */

/* ===== Hero Section ===== */
.impact-hero {
    background-color: var(--dark-bg);
    padding: 120px 0 120px;
    position: relative;
    overflow: hidden;
}

.hero-content-wrapper {
    position: relative;
    z-index: 2;
}


.impact-title {
    font-size: 3.8rem;
    font-weight: 800;
    color: var(--text-color);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.highlight-text {
    color: var(--primary);
}

.impact-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 580px;
    margin-bottom: 3rem;
}

.impact-hero-stats {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: nowrap;
}

.hero-stat {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--glass-bg);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex: 1;
    min-width: 0;
}

.hero-stat:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-color);
    flex-shrink: 0;
}

.stat-content {
    text-align: center;
    min-width: 0;
    flex: 1;
}

.hero-stat-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-color);
    line-height: 1.2;
    white-space: nowrap;
}

.hero-stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    white-space: nowrap;
    letter-spacing: 1px;
    margin-top: 0.25rem;
}


/* Hero Visual Section */
.hero-visual-section {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image-stack {
    position: relative;
    height: 350px;
    margin: 0 auto 2rem;
    width: 450px;
    max-width: 100%;
}

.hero-proof-img {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    transition: opacity 0.5s ease, visibility 0.5s ease;
    opacity: 0;
    visibility: hidden;
}

.hero-proof-img.active {
    z-index: 3;
    opacity: 1;
    visibility: visible;
    transform: rotate(0deg) scale(1);
}

/* Hide all non-active images completely */
.hero-proof-img:not(.active) {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none;
}




@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

@keyframes scroll-wheel {
    0%, 100% { opacity: 1; transform: translateX(-50%) translateY(0); }
    50% { opacity: 0.5; transform: translateX(-50%) translateY(8px); }
}

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

.impact-title, .impact-subtitle, .impact-hero-stats {
    animation: fadeInUp 1s ease-out;
}

.impact-title { animation-delay: 0.2s; }
.impact-subtitle { animation-delay: 0.4s; }
.impact-hero-stats { animation-delay: 0.6s; }

.hero-image-wrapper {
    position: relative;
    padding: 20px;
}
.hero-proof-img {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
    transform: rotate(3deg);
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.verification-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 2rem;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
}
.verification-badge i {
    color: #28a745;
}

/* ===== Section Headings ===== */
.section-heading {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.75rem;
}
.section-subheading {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== How It Works Section ===== */
.how-it-works-section {
    background-color: var(--glass-bg);
}
.how-it-works-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}
.step {
    text-align: center;
    max-width: 250px;
    flex: 1;
}
.step-number {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--gradient-mid));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.3);
}
.step h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.75rem;
}
.step p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}
.step-arrow {
    color: var(--primary);
    font-size: 1.5rem;
    display: none;
}
@media (min-width: 768px) {
    .step-arrow { display: block; }
}

/* Desktop: Side-by-side layout */
@media (min-width: 992px) {
    .hero-content-wrapper {
        text-align: left;
    }
    .impact-hero-stats {
        justify-content: flex-start;
    }
    .hero-visual-section {
        display: flex;
        justify-content: center;
        align-items: center;
    }
}

/* ===== Causes Section ===== */
.causes-section {
    background-color: var(--body-bg);
    position: relative;
}

/* Causes Grid - Uniform Layout */
.causes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.cause-card-modern {
    padding: 2rem;
    border-radius: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.cause-card-modern::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--gradient-mid));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.cause-card-modern:hover::after {
    transform: scaleX(1);
}

.cause-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.cause-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.cause-icon-modern {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--gradient-mid));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    box-shadow: 0 5px 15px rgba(209, 32, 38, 0.2);
}

.cause-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.cause-card-modern h4 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.cause-card-modern p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

/* ===== Proof Gallery Section ===== */
.proof-section {
    background-color: var(--glass-bg);
}
.proof-grid {
    column-count: 4;
    column-gap: 1rem;
    max-width: 1400px;
    margin: 0 auto;
    contain: layout;
    transform: translateZ(0);
}
.proof-grid-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    display: inline-block;
    width: 100%;
    margin-bottom: 1rem;
    break-inside: avoid;
    page-break-inside: avoid;
    contain: layout;
    transform: translateZ(0);
    will-change: transform;
}
.proof-grid-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
    transform: translateZ(0);
    backface-visibility: hidden;
}
.proof-grid-item:hover img {
    transform: scale(1.1);
}

.proof-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.proof-grid-item:hover .proof-overlay {
    opacity: 1;
}
.proof-overlay span {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
}
.proof-overlay i {
    margin-right: 6px;
}

/* ===== CTA Section ===== */
.impact-cta {
    background-color: var(--body-bg);
}
.cta-card {
    padding: 4rem 2rem;
    border-radius: 20px;
    max-width: 800px;
    margin: 0 auto;
}
.cta-card h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1rem;
}
.cta-card p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
}
.cta-card .btn {
    padding: 0.9rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
}

/* ===== Lightbox Modal ===== */
.lightbox-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}
.lightbox-modal.active {
    display: flex;
}
.lightbox-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.9);
}
.lightbox-container {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-container img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.lightbox-close-btn {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    transition: transform 0.2s;
}
.lightbox-close-btn:hover {
    transform: scale(1.2);
}
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
}
.lightbox-nav:hover {
    background: rgba(255,255,255,0.2);
}
.lightbox-prev-btn { left: -70px; }
.lightbox-next-btn { right: -70px; }

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .impact-title { font-size: 2.8rem; }
    .impact-hero-stats { gap: 0.75rem; }
    .hero-stat-value { font-size: 1.4rem; }
    .proof-grid { column-count: 3; }
    
    /* Causes Grid Responsive */
    .causes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 1200px) {
    .proof-grid { column-count: 3; }
}
@media (max-width: 992px) {
    .proof-grid { column-count: 3; }
    .causes-mosaic { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto auto; }
    .card-large { grid-column: 1 / -1; grid-row: 1; }
    .card-medium { grid-column: 1; grid-row: 2; }
    .causes-mosaic .mosaic-card:nth-child(3) { grid-column: 2; grid-row: 2; }
    .card-small { grid-column: 1 / -1; grid-row: 3; }
}
@media (max-width: 768px) {
    .proof-grid { 
        column-count: 2; 
        contain: layout;
        transform: translateZ(0);
    }
    .impact-title { font-size: 2.8rem; }
    .cause-hero-card { flex-direction: column; text-align: center; gap: 2rem; }
    .causes-mosaic { grid-template-columns: 1fr; }
    .card-large, .card-medium, .card-small { grid-column: 1; }
    .card-large { grid-row: 1; }
    .card-medium { grid-row: 2; }
    .causes-mosaic .mosaic-card:nth-child(3) { grid-row: 3; }
    .card-small { grid-row: 4; }
    .hero-image-stack { height: 350px; width: 320px; }
    .hero-proof-img { width: 100%; height: 100%; }
    .lightbox-nav {
        position: fixed;
        background: var(--primary);
        z-index: 10001;
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    .lightbox-prev-btn { 
        left: 10px; 
        top: 50%;
        transform: translateY(-50%);
    }
    .lightbox-next-btn { 
        right: 10px; 
        top: 50%;
        transform: translateY(-50%);
    }
    .lightbox-nav:hover {
        background: var(--primary);
        opacity: 0.9;
    }
    
    /* Center content on mobile */
    .hero-content-wrapper { text-align: center; }
    .impact-subtitle { margin-left: auto; margin-right: auto; margin-bottom: 1rem; }
    .impact-hero-stats { justify-content: center; }
    
    /* Hero padding on mobile */
    .impact-hero {
        padding: 25px 0 0;
    }
    
    /* Hide stat icons on mobile */
    .stat-icon {
        display: none;
    }
    
    /* Hero stat flex on mobile */
    .hero-stat {
        flex: 1 1 calc(30%);
        padding: 0;
    }
    
    /* Shorten stat labels on mobile */
    .hero-stat-label {
        font-size: 0;
    }
    .hero-stat-label::after {
        content: attr(data-mobile);
        font-size: 0.75rem;
    }
    
    /* Causes Grid Mobile */
    .causes-grid {
        grid-template-columns: 1fr;
    }
    
    /* How It Works - Stack steps vertically on mobile */
    .how-it-works-steps {
        flex-direction: column;
    }
}
@media (max-width: 576px) {
    .proof-grid { 
        column-count: 2; 
        contain: layout;
        transform: translateZ(0);
    }
    .impact-title { font-size: 2.2rem; }
    .cta-card { padding: 2.5rem 1.5rem; }
    .cta-card h2 { font-size: 1.6rem; }
    .impact-hero-stats { flex-wrap: wrap; gap: 0.5rem; }
    .hero-stat { flex: 1 1 calc(30%); min-width: 0; padding: 0; }
    .hero-stat-value { font-size: 1.3rem; }
    .hero-image-stack { 
        height: 300px;
        width: 280px;
    }
    .hero-proof-img { 
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

/* iPhone-specific fixes (414px and below - covers all iPhone models) */
@media (max-width: 414px) {
    .hero-image-stack {
        height: auto;
        min-height: 250px;
        width: 100%;
        max-width: 100%;
        padding: 0 10px;
        position: relative;
    }
    .hero-proof-img {
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        max-height: 400px;
        object-fit: contain !important;
        max-width: 100%;
        left: auto !important;
        top: auto !important;
        margin-bottom: 0;
    }
    /* On iPhone, show only active image, hide others completely */
    .hero-proof-img:not(.active) {
        display: none !important;
    }
    .hero-proof-img.active {
        display: block !important;
    }
}

/* Dark Theme: Make text-muted elements white */
.dark-theme .impact-subtitle,
.dark-theme .hero-stat-label,
.dark-theme .section-subheading,
.dark-theme .cta-card p,
.dark-theme .cause-card-modern p {
    color: #ffffff !important;
}
