/* === REALISATIONS PAGE STYLES === */
:root {
    --primary-gradient: linear-gradient(135deg, #34c7ff 0%, #2b8af9 100%);
    --dark-bg: #121212;
    --card-bg: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    --transition-fast: 0.3s ease;
    --transition-medium: 0.5s ease;
    --glow-shadow: 0 0 15px rgba(52, 199, 255, 0.5);
}

/* Correction du bug de la double barre de défilement */
body {
    overflow-x: hidden;
    background-color: var(--dark-bg);
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
}

/* === GENERAL STYLES === */
.realisations-page-wrapper {
    position: relative;
    padding: 80px 5%;
    min-height: 100vh;
    overflow-x: hidden;
}

/* === BACKGROUND BEAM EFFECT === */
.realisations-bg-beam {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    height: 60vh;
    background: radial-gradient(circle, rgba(52, 199, 255, 0.15) 0%, rgba(43, 138, 249, 0.1) 40%, transparent 70%);
    filter: blur(200px);
    z-index: 0;
    animation: beam-move 20s infinite alternate ease-in-out;
    pointer-events: none;
}

@keyframes beam-move {
    0% {
        transform: translate(-50%, -60%) scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: translate(-40%, -50%) scale(1);
        opacity: 0.7;
    }
    100% {
        transform: translate(-60%, -40%) scale(0.9);
        opacity: 0.6;
    }
}

/* === HEADER SECTION === */
.realisations-header {
    position: relative;
    text-align: center;
    margin-bottom: 60px;
    z-index: 1;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.realisations-header.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.realisations-header h2 {
    font-size: 2.8rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.realisations-header p {
    max-width: 800px;
    margin: 0 auto 30px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
}

.realisations-subtext {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 20px;
}

/* === FILTERS === */
.realisations-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.realisations-filters.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.filter-btn {
    padding: 10px 20px;
    border-radius: 50px;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid transparent;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    border-color: #34c7ff;
}

.filter-btn.is-active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--glow-shadow);
}

/* === GALLERY === */
.realisations-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    position: relative;
    z-index: 1;
    margin-bottom: 80px;
}

.project-card {
    background-color: #161b22;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid transparent;
    opacity: 1;
    transform: translateY(0) scale(1);
    /* Désactiver les transitions automatiques pour éviter les clignotements */
    transition: box-shadow 0.3s ease;
}

/* Classe pour l'animation d'entrée initiale seulement */
.project-card.initial-animation {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.project-card.initial-animation.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(52, 199, 255, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Supprimer la classe is-hidden qui peut causer des problèmes */
/* .project-card.is-hidden {
    display: none;
} */

/* === BEFORE-AFTER SLIDER === */
.before-after-slider {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.slider-image-before,
.slider-image-after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.slider-image-before img,
.slider-image-after img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slider-image-after {
    width: 50%; /* Initial position at 50% */
    clip-path: inset(0 0 0 0);
}

.slider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%; /* Initial position at 50% */
    width: 2px;
    background-color: white;
    transform: translateX(-50%);
    cursor: ew-resize;
    z-index: 10;
}

.handle-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.handle-arrows {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.arrow-left,
.arrow-right {
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

.arrow-left {
    border-right: 6px solid white;
    margin-right: 4px;
}

.arrow-right {
    border-left: 6px solid white;
    margin-left: 4px;
}

/* === PROJECT CAPTION === */
.project-caption {
    padding: 20px;
}

.project-caption h3 {
    font-size: 1.3rem;
    margin: 0 0 5px 0;
    font-weight: 600;
}

.project-caption span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* === CTA SECTION === */
.realisations-cta {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(to bottom, rgba(26, 26, 26, 0.5), rgba(18, 18, 18, 0.8));
    border-radius: var(--border-radius-lg);
    position: relative;
    z-index: 1;
    margin-top: 50px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.realisations-cta.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.realisations-cta h3 {
    font-size: 2rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.realisations-cta p {
    max-width: 600px;
    margin: 0 auto 30px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.button-primary {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 50px;
    background: var(--primary-gradient);
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
    border: none;
    font-size: 1rem;
}

.button-primary:hover {
    box-shadow: var(--glow-shadow);
    transform: translateY(-2px);
}

/* === RESPONSIVE STYLES === */
@media (max-width: 1024px) {
    .realisations-gallery {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .realisations-header h2 {
        font-size: 2.4rem;
    }
}

@media (max-width: 768px) {
    .realisations-page-wrapper {
        padding: 60px 5%;
    }
    
    .realisations-header h2 {
        font-size: 2rem;
    }
    
    .realisations-header p {
        font-size: 1rem;
    }
    
    .realisations-gallery {
        grid-template-columns: 1fr;
    }
    
    .realisations-cta h3 {
        font-size: 1.8rem;
    }
    
    .realisations-cta p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .realisations-header h2 {
        font-size: 1.8rem;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    
    .before-after-slider {
        height: 200px;
    }
    
    .handle-circle {
        width: 30px;
        height: 30px;
    }
}