/* ==========================================
   CRIHD PROJECTS PAGE - STYLES COMPLETS
   ========================================== */

/* Styles de base déjà définis dans home.css, on ajoute les spécifiques à projects */

/* ==========================================
   FILTRES DE PROJETS
   ========================================== */

.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 60px;
    flex-wrap: wrap;
    gap: 20px;
}

.project-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0;
}

.filter-btn:hover,
.filter-btn.active {
    background: #c53c3c;
    border-color: #c53c3c;
    color: white;
}


.project-partners {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.partner-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.afd-badge,
.rainforest-badge,
.tech-badge,
.jeunes-badge {
    background: #c53c3c;
    color: white;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 0;
}

.rainforest-badge {
    background: #22c55e;
}

.tech-badge {
    background: #3b82f6;
}

.jeunes-badge {
    background: #f59e0b;
}

.partner-text {
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
}


/* ==========================================
   SECTION IMPACT
   ========================================== */

.impact-section {
    background: #f8f9fa;
    padding: 80px 0;
}

.impact-header {
    text-align: center;
    margin-bottom: 60px;
}

.impact-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
}

.stat-card {
    background: white;
    padding: 32px 24px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-radius: 0;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: #c53c3c;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
}

.stat-number {
    display: block;
    font-size: 36px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
}

.stat-label {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================
   SECTION CALL TO ACTION
   ========================================== */

.cta-section {
    background: #2c3e50;
    color: white;
    padding: 80px 0;
}

.cta-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: center;
}

.cta-title {
    font-size: 32px;
    font-weight: 700;
    color: white;
    margin-bottom: 16px;
    line-height: 1.2;
}

.cta-description {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin: 0;
}

.cta-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
}

.cta-actions .btn {
    min-width: 200px;
    text-align: center;
    justify-content: center;
}

/* ==========================================
   ANIMATIONS ET ÉTATS
   ========================================== */

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

@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.project-card {
    animation: fadeInUp 0.6s ease-out forwards;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }
.project-card:nth-child(6) { animation-delay: 0.6s; }

.stat-number.animate {
    animation: countUp 0.8s ease-out forwards;
}

/* États de filtre */
.project-card.filtered-out {
    opacity: 0.3;
    transform: scale(0.95);
    pointer-events: none;
}

.project-card.filtered-in {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .projects-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .cta-content {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }

    .cta-actions {
        align-items: center;
    }

    .impact-stats {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .project-filters {
        justify-content: center;
        width: 100%;
    }

    .filter-btn {
        flex: 1;
        text-align: center;
        min-width: 80px;
    }

    .project-overlay {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .project-progress {
        min-width: 100px;
    }

    .project-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .projects-pagination {
        flex-direction: column;
        gap: 16px;
    }

    .pagination-numbers {
        order: -1;
    }

    .cta-title {
        font-size: 24px;
    }

    .impact-stats {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .stat-number {
        font-size: 28px;
    }
}

@media (max-width: 640px) {
    .main-hero {
        padding: 40px 0 30px;
    }

    .hero-title {
        font-size: 24px;
    }

    .projects-section,
    .impact-section,
    .cta-section {
        padding: 60px 0;
    }

    .project-content {
        padding: 20px;
    }

    .project-title {
        font-size: 16px;
    }

    .project-description {
        font-size: 13px;
    }

    .cta-actions .btn {
        width: 100%;
    }

    .stat-card {
        padding: 24px 16px;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .stat-number {
        font-size: 24px;
    }
}

/* ==========================================
   ACCESSIBILITÉ
   ========================================== */

.filter-btn:focus,
.pagination-btn:focus,
.page-number:focus,
.project-link:focus {
    outline: 2px solid #c53c3c;
    outline-offset: 2px;
}

.project-card:focus-within {
    outline: 2px solid #c53c3c;
    outline-offset: 2px;
}

/* Préférence pour les animations réduites */
@media (prefers-reduced-motion: reduce) {
    .project-card,
    .stat-number,
    .project-image img,
    .project-link {
        animation: none;
        transition: none;
    }

    .project-card:hover {
        transform: none;
    }

    .project-card:hover .project-image img {
        transform: none;
    }
}

/* ==========================================
   ÉTATS DE CHARGEMENT
   ========================================== */

.project-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.project-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #c53c3c;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================
   AMÉLIORATIONS SPÉCIFIQUES
   ========================================== */

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Amélioration du contraste pour l'accessibilité */
.project-status {
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.progress-text {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Optimisation pour l'impression */
@media print {
    .project-filters,
    .projects-pagination,
    .cta-section {
        display: none;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .project-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }

    .project-image {
        height: 150px;
    }
}