/* Bloc Grille de Projets */
.projects-grid-block {
    margin: 0 auto;
}

/* En-tête du bloc */
.projects-header {
    text-align: center;
    margin-bottom: 50px;
}

.projects-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    line-height: 1.2;
}

/* Filtres par catégorie */
.projects-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 50px;
    padding: 0 20px;
}

.filter-btn {
    background: #fff;
    border: 2px solid #e1e5e9;
    color: #555;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: #39A347;
    color: #39A347;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(57, 163, 71, 0.2);
}

.filter-btn.active {
    background: #39A347;
    border-color: #39A347;
    color: white;
    box-shadow: 0 5px 15px rgba(57, 163, 71, 0.3);
}

/* Conteneur des projets */
.projects-container {
    width: 100%;
}

/* Grille de projets - Responsive */
.projects-grid {
    display: grid;
    margin-bottom: 50px;
    /* Desktop : 4 colonnes */
    grid-template-columns: repeat(4, 1fr);
}

/* Carte de projet individuelle */
.project-card {
    position: relative;
    background: #fff;
    overflow: hidden;
    transition: all 0.4s ease;
    cursor: pointer;
    aspect-ratio: 4/3; /* Ratio fixe pour uniformité */
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Image du projet */
.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

/* Overlay avec informations */
.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.8) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 25px;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-info {
    color: white;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.project-card:hover .project-info {
    transform: translateY(0);
}

.project-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.project-category {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Bouton "Charger plus" */
.load-more-container {
    text-align: center;
    margin-top: 40px;
}

.load-more-btn {
    background: linear-gradient(135deg, #39A347 0%, #2d8939 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    justify-content: center;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(57, 163, 71, 0.3);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Spinner de chargement */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Message "Aucun projet" */
.no-projects-message {
    text-align: center;
    padding: 80px 20px;
    color: #666;
    font-size: 1.1rem;
}

/* Animation d'apparition des cartes */
.project-card {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

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

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

/* Responsive Design */

/* Tablettes - 3 colonnes */
@media (max-width: 1200px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
    
    .projects-title {
        font-size: 2.2rem;
    }
}

/* Tablettes portrait - 2 colonnes */
@media (max-width: 768px) {
    .projects-grid-block {
        padding: 40px 15px;
    }
    
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        margin-bottom: 40px;
    }
    
    .projects-title {
        font-size: 2rem;
    }
    
    .projects-filters {
        margin-bottom: 40px;
    }
    
    .filter-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .project-overlay {
        padding: 20px;
    }
    
    .project-name {
        font-size: 1.1rem;
    }
    
    .project-category {
        font-size: 0.8rem;
    }
}

/* Mobile - 1 colonne */
@media (max-width: 480px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .projects-title {
        font-size: 1.8rem;
    }
    
    .projects-filters {
        justify-content: flex-start;
        overflow-x: auto;
        padding: 0 15px 10px;
        margin-bottom: 30px;
        gap: 10px;
    }
    
    .filter-btn {
        flex-shrink: 0;
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .load-more-btn {
        padding: 12px 30px;
        font-size: 14px;
    }
    
    .project-card {
        aspect-ratio: 16/10; /* Ratio différent en mobile */
    }
}

/* États de chargement */
.projects-grid.loading {
    opacity: 0.7;
    pointer-events: none;
}

.projects-grid.loading .project-card {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
} 