/* Features Custom Block Styles */

.features-section {
    position: relative;
    /* background-color: #0a0a0a; */
    padding: 0;
    overflow: hidden;
    overflow-x: hidden; /* prevent horizontal overflow/extra scrollbar on scroll */
    box-sizing: border-box; /* ensure paddings don't create overflow */
    min-height: 100vh; /* Force une hauteur minimale pour que la vidéo soit visible */
}

/* Background Video Styles */
.features-background-video {
    /* position: absolute; */
    /* top: 0;
    left: 0; */
    width: 100vw;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.features-bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.features-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4); /* Semi-transparent overlay pour améliorer la lisibilité */
    z-index: 2;
}

/* S'assurer que le contenu est au-dessus de la vidéo */
.features-section .section-gap {
    position: relative;
    z-index: 10;
}

.features-section .main-container {
    position: relative;
    z-index: 11;
}

.section-gap {
    padding: 80px 0 120px 0;
    position: relative;
    overflow-x: hidden; /* avoid horizontal scroll caused by animated children */
    min-height: calc(100vh - 160px); /* S'assurer qu'il y a assez de contenu pour que la vidéo soit visible */
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 11;
}

/* Section Title Styles */
.section-title-wrapper {
    text-align: center;
    margin-bottom: 80px;
    position: relative;
    z-index: 12;
}

.section-title-block {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 12;
}

.overflow-hidden {
    overflow: hidden;
}

.section-subtitle {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-color, #ff3d29);
    margin-bottom: 20px;
    font-family: 'Rajdhani', sans-serif;
}

.section-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--white, #ffffff);
    margin: 0;
    font-family: 'Monument Extended', sans-serif;
    text-transform: none;
    letter-spacing: -2px;
}

/* Feature List Styles */
.feature-list-wrapper {
    display: flex;
    flex-direction: column;
    gap: 60px;
    position: relative;
    z-index: 12;
}

.feature-list-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
    padding: 60px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 12;
}

.feature-list-item:nth-child(even) {
    grid-template-areas: "image content";
}

.feature-list-item:nth-child(even) .feature-list-contact-block {
    grid-area: content;
}

.feature-list-item:nth-child(even) .feature-image-block {
    grid-area: image;
}

.feature-list-item:last-child {
    border-bottom: none;
}

/* Content Block */
.feature-list-contact-block {
    padding-right: 40px;
}

.feature-card-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--white, #ffffff);
    margin: 0 0 24px 0;
    line-height: 1.2;
    font-family: "Tomorrow", sans-serif;
    font-weight: 300;
    font-style: normal;
    letter-spacing: -1px;
}

.feature-text {
    font-size: 16px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.75);
    margin: 0 0 32px 0;
    font-family: 'Inter', sans-serif;
}

/* Feature Points */
.feature-points-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.feature-point {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed #007aff;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    transition: all 0.3s ease;
    font-family: 'Rajdhani', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.feature-point:hover {
    /* background: rgba(255, 61, 41, 0.1);
    border-color: var(--accent-color, #29ffea56);
    color: var(--accent-color, #29ffea56); */
    transform: translateY(-2px);
}

/* Image Block */
.feature-image-block {
    position: relative;
    height: 40rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px dashed #007aff;
}

.on-scroll-image-block {
    position: relative;
    width: 100%;
    /* height: 100%; */
    border-radius: 12px;
    overflow: hidden;
    background: #1a1a1a;
    will-change: transform; /* hint to browser to optimize transforms */
    backface-visibility: hidden; /* avoid subpixel artifacts that can create scrollbars */
}

.image-on-scroll {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block; /* avoid inline spacing issues */
    max-width: 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform; /* GPU optimize transforms */
    backface-visibility: hidden; /* prevent rendering artifacts */
}

.on-scroll-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* background: linear-gradient(45deg, var(--accent-color, #ff3d29) 0%, rgba(255, 61, 41, 0.8) 100%); */
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

/* Background Shape */
.section-bg-shape {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255, 61, 41, 0.03) 0%, transparent 70%);
    z-index: 5;
}

.section-bg-shape::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 61, 41, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(40px);
}

.section-bg-shape::after {
    content: '';
    position: absolute;
    bottom: 20%;
    right: 10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(41, 98, 255, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(60px);
}

/* Hover Effects */
.feature-list-item:hover .image-on-scroll {
    transform: scale(1.05);
}

.feature-list-item:hover .on-scroll-image-overlay {
    transform: translateX(-100%);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0px, 100px, 0px);
    }
    to {
        opacity: 1;
        transform: translate3d(0px, 0px, 0px);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translate3d(-50px, 0px, 0px);
    }
    to {
        opacity: 1;
        transform: translate3d(0px, 0px, 0px);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translate3d(50px, 0px, 0px);
    }
    to {
        opacity: 1;
        transform: translate3d(0px, 0px, 0px);
    }
}

/* Animation Classes */
.animate-fadeInUp {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-fadeInRight {
    animation: fadeInRight 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.on-scroll-image-block img {
    height: 40rem !important;
}

/* Responsive Design */
@media screen and (max-width: 1024px) {

    .section-title {
        font-size: 3rem;
    }
    
    .feature-card-title {
        font-size: 2rem;
    }
    
    .feature-list-item {
        gap: 60px;
    }
    
    .feature-list-contact-block {
        padding-right: 20px;
    }
    
    /* Ajuster l'overlay vidéo sur tablette */
    .features-video-overlay {
        background: rgba(0, 0, 0, 0.5);
    }
}

@media screen and (max-width: 768px) {
    .on-scroll-image-block img {
        height: auto !important;
    }
    .section-gap {
        padding: 60px 0 80px 0;
    }
    
    .main-container {
        padding: 0 16px;
    }
    
    .section-title-wrapper {
        margin-bottom: 60px;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
    
    .feature-list-item {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 40px 0;
    }
    
    .feature-list-item:nth-child(even) {
        grid-template-areas: "content" "image";
    }
    
    .feature-list-contact-block {
        padding-right: 0;
        text-align: center;
    }
    
    .feature-card-title {
        font-size: 1.8rem;
        margin-bottom: 16px;
    }
    
    .feature-text {
        font-size: 15px;
        margin-bottom: 24px;
    }
    
    .feature-image-block {
        height: 300px;
    }
    
    .feature-points-wrapper {
        justify-content: center;
    }
    
    /* Ajuster l'overlay vidéo sur mobile pour améliorer la lisibilité */
    .features-video-overlay {
        background: rgba(0, 0, 0, 0.6);
    }
    
    /* Sur mobile, s'assurer que la vidéo ne pose pas de problèmes de performance */
    .features-bg-video {
        /* Optionnel: réduire la qualité sur mobile */
        filter: brightness(0.8);
    }
}

@media screen and (max-width: 480px) {
    .section-title {
        font-size: 2rem;
    }
    
    .feature-card-title {
        font-size: 1.5rem;
    }
    
    .feature-list-wrapper {
        gap: 40px;
    }
    
    .feature-image-block {
        height: 250px;
    }
    
    .feature-point {
        font-size: 8px;
        padding: 6px 12px;
    }
}

/* Feature Before/After Slider Styles */
.feature-before-after-container {
    --slider-position: 50%;
    --slider-width: 3px;
    --slider-color: rgba(255, 255, 255, 0.95);
    --button-size: 44px;
    --button-color: rgba(255, 255, 255, 0.98);
    --arrow-color: #757575;
    
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #1a1a1a;
}

.feature-screen-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
}

.feature-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    will-change: transform, width;
}

.feature-background-img {
    z-index: 1;
}

.feature-foreground-img {
    z-index: 2;
    width: 100%;
    clip-path: inset(0 calc(100% - var(--slider-position, 50%)) 0 0);
    transition: none;
    will-change: clip-path;
    /* S'assurer que le clipping fonctionne aux extrémités */
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
}

.feature-slider {
    position: absolute;
    top: 0;
    left: 0;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 100%;
    background: transparent;
    outline: none;
    margin: 0;
    padding: 0;
    border: none;
    transition: none;
    z-index: 6;
    cursor: col-resize;
    opacity: 0;
    min-width: 100%;
    max-width: 100%;
    touch-action: pan-x;
}

.feature-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: var(--slider-width, 6px);
    height: 100%;
    background: transparent;
    cursor: col-resize;
}

.feature-slider::-moz-range-thumb {
    width: var(--slider-width, 6px);
    height: 100%;
    background: transparent;
    cursor: col-resize;
    border: none;
}

.feature-slider-button {
    pointer-events: none;
    position: absolute;
    height: 100%;
    width: var(--slider-width, 3px);
    background-color: #007bff95;
    left: calc(var(--slider-position, 50%) - calc(var(--slider-width, 3px) / 2));
    top: 0;
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: none;
    backdrop-filter: blur(4px);
    will-change: left;
}

.feature-slider-button::before {
    content: '';
    position: absolute;
    width: var(--button-size);
    height: var(--button-size);
    background-color: #007bff95;
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: none;
    backdrop-filter: blur(4px);
}

.feature-slider-button::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background: white;
    opacity: 0.9;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.5 3.5L1.5 9.5l6 6M16.5 3.5l6 6-6 6'/%3E%3C/svg%3E") no-repeat center;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.5 3.5L1.5 9.5l6 6M16.5 3.5l6 6-6 6'/%3E%3C/svg%3E") no-repeat center;
    z-index: 6;
    transition: none;
}