/* Portfolio Avant/Après - Styles */

.portfolio-avant-apres {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Filtres */
.portfolio-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 12px 30px;
    background: #f0f0f0;
    border: 2px solid transparent;
    border-radius: 30px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #333;
}

.filter-btn:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: #000000;
    color: white;
    border-color: #000000;
}

/* Grille du portfolio */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.portfolio-item {
    opacity: 1;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.portfolio-item.hidden {
    opacity: 0;
    transform: scale(0.9);
    position: absolute;
    pointer-events: none;
}

/* Comparateur avant/après */
.comparison-slider {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.comparison-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 66.67%; /* Ratio 3:2 - ajustable selon vos besoins */
    overflow: hidden;
    cursor: ew-resize;
    background: #000;
}

/* Image APRÈS (arrière-plan) - toujours visible */
.comparison-after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    user-select: none;
    pointer-events: none;
    display: block;
}

/* Wrapper de l'image AVANT - contrôle la zone visible */
.comparison-before-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%; /* Position initiale au milieu */
    height: 100%;
    overflow: hidden;
    z-index: 2;
}

/* Image AVANT - révélée progressivement */
.comparison-before-wrapper .comparison-before {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    object-fit: cover;
    object-position: left center;
    user-select: none;
    pointer-events: none;
    display: block;
}

/* Curseur */
.comparison-handle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    transform: translateX(-50%);
    z-index: 3;
    cursor: ew-resize;
}

.comparison-handle-line {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: white;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.comparison-handle-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.comparison-handle-circle svg {
    width: 24px;
    height: 24px;
}

.comparison-handle-circle svg path {
    stroke: #2c3e50;
}

.comparison-container:active .comparison-handle-circle {
    transform: translate(-50%, -50%) scale(1.1);
}

/* Responsive */
@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .filter-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .portfolio-filters {
        gap: 10px;
    }
}

/* Animation d'apparition */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.portfolio-item {
    animation: fadeIn 0.5s ease forwards;
}
