/**
 * CARROUSEL VIDÉO PROFESSIONNEL - FOREVER BIEN-ÊTRE
 * Système de slides avec effets cinématiques Ken Burns & Parallax
 * Qualité TV commerciale - Expert Marketing Digital 20 ans d'expérience
 */

/* ============================================================================
   VARIABLES & CONFIGURATION
   ========================================================================= */

:root {
    --hero-height-mobile: 100vh;
    --hero-height-desktop: 90vh;
    --slide-transition-duration: 1.2s;
    --ken-burns-duration: 10s;
    --overlay-gradient: linear-gradient(135deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.1) 100%);
}

/* ============================================================================
   HERO CAROUSEL CONTAINER
   ========================================================================= */

.hero-video-carousel {
    position: relative;
    width: 100%;
    height: var(--hero-height-mobile);
    overflow: hidden;
    background: #000;
}

@media (min-width: 768px) {
    .hero-video-carousel {
        height: var(--hero-height-desktop);
    }
}

/* ============================================================================
   SLIDES CONTAINER
   ========================================================================= */

.hero-slides-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

/* ============================================================================
   INDIVIDUAL SLIDE
   ========================================================================= */

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--slide-transition-duration) ease-in-out,
                visibility 0s linear var(--slide-transition-duration);
    z-index: 1;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
    transition: opacity var(--slide-transition-duration) ease-in-out,
                visibility 0s linear 0s;
    z-index: 2;
}

/* ============================================================================
   KEN BURNS EFFECT - Zoom & Pan Cinématique
   ========================================================================= */

/* LEGACY: Background image (fallback) */
.hero-slide__background {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1);
    animation: kenBurns var(--ken-burns-duration) ease-out infinite alternate;
}

/* NOUVEAU: Vidéo de fond (Ken Burns intégré via ffmpeg) */
.hero-slide__background-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0; /* Vidéo en arrière-plan */
    /* Pas d'animation CSS - l'effet Ken Burns est dans la vidéo */
}

/* Variations d'animation Ken Burns pour chaque slide */
.hero-slide:nth-child(1) .hero-slide__background {
    animation: kenBurnsZoomIn var(--ken-burns-duration) ease-out infinite alternate;
}

.hero-slide:nth-child(2) .hero-slide__background {
    animation: kenBurnsPanRight var(--ken-burns-duration) ease-out infinite alternate;
}

.hero-slide:nth-child(3) .hero-slide__background {
    animation: kenBurnsZoomOut var(--ken-burns-duration) ease-out infinite alternate;
}

.hero-slide:nth-child(4) .hero-slide__background {
    animation: kenBurnsPanLeft var(--ken-burns-duration) ease-out infinite alternate;
}

.hero-slide:nth-child(5) .hero-slide__background {
    animation: kenBurnsDiagonal var(--ken-burns-duration) ease-out infinite alternate;
}

/* Ken Burns Animations */
@keyframes kenBurnsZoomIn {
    from {
        transform: scale(1) translateX(0) translateY(0);
    }
    to {
        transform: scale(1.15) translateX(-2%) translateY(-2%);
    }
}

@keyframes kenBurnsPanRight {
    from {
        transform: scale(1.1) translateX(0);
    }
    to {
        transform: scale(1.15) translateX(-5%);
    }
}

@keyframes kenBurnsZoomOut {
    from {
        transform: scale(1.15) translateY(0);
    }
    to {
        transform: scale(1) translateY(2%);
    }
}

@keyframes kenBurnsPanLeft {
    from {
        transform: scale(1.1) translateX(-3%);
    }
    to {
        transform: scale(1.15) translateX(0);
    }
}

@keyframes kenBurnsDiagonal {
    from {
        transform: scale(1) translateX(-2%) translateY(2%);
    }
    to {
        transform: scale(1.15) translateX(2%) translateY(-2%);
    }
}

/* ============================================================================
   OVERLAY GRADIENT
   ========================================================================= */

.hero-slide__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-gradient);
    z-index: 1;
    pointer-events: none;
}

/* Overlay spécifique par catégorie */
.hero-slide[data-category="nutrition"] .hero-slide__overlay {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.3) 0%, rgba(0, 0, 0, 0.4) 100%);
}

.hero-slide[data-category="beaute"] .hero-slide__overlay {
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.3) 0%, rgba(0, 0, 0, 0.4) 100%);
}

.hero-slide[data-category="minceur"] .hero-slide__overlay {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.3) 0%, rgba(0, 0, 0, 0.4) 100%);
}

.hero-slide[data-category="performance"] .hero-slide__overlay {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.3) 0%, rgba(0, 0, 0, 0.4) 100%);
}

.hero-slide[data-category="hygiene"] .hero-slide__overlay {
    background: linear-gradient(135deg, rgba(156, 204, 101, 0.3) 0%, rgba(0, 0, 0, 0.4) 100%);
}

/* ============================================================================
   SLIDE CONTENT - Textes & CTA
   ========================================================================= */

.hero-slide__content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 2rem;
    text-align: center;
    color: #fff;
    animation: slideContentFadeIn 1s ease-out 0.3s both;
}

.hero-slide.active .hero-slide__content {
    animation: slideContentFadeIn 1s ease-out 0.3s both;
}

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

/* ============================================================================
   TYPOGRAPHY - Responsive & Professionnel
   ========================================================================= */

.hero-slide__category {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    opacity: 0.9;
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

.hero-slide__title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    max-width: 800px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.8s ease-out 0.7s both;
}

.hero-slide__description {
    font-size: 1.125rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 600px;
    opacity: 0.95;
    animation: fadeInUp 0.8s ease-out 0.9s both;
}

@media (min-width: 768px) {
    .hero-slide__category {
        font-size: 1rem;
    }

    .hero-slide__title {
        font-size: 3.5rem;
    }

    .hero-slide__description {
        font-size: 1.25rem;
    }
}

@media (min-width: 1200px) {
    .hero-slide__title {
        font-size: 4.5rem;
    }
}

/* ============================================================================
   CTA BUTTONS
   ========================================================================= */

.hero-slide__cta {
    display: inline-flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeInUp 0.8s ease-out 1.1s both;
}

.hero-slide__cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.hero-slide__cta-button--primary {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: #fff;
}

.hero-slide__cta-button--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(76, 175, 80, 0.4);
}

.hero-slide__cta-button--secondary {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.hero-slide__cta-button--secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

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

/* ============================================================================
   NAVIGATION DOTS
   ========================================================================= */

.hero-carousel__dots {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.75rem;
    z-index: 10;
}

.hero-carousel__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
}

.hero-carousel__dot:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: scale(1.2);
}

.hero-carousel__dot.active {
    background: #fff;
    width: 40px;
    border-radius: 6px;
}

/* ============================================================================
   NAVIGATION ARROWS (Desktop uniquement)
   ========================================================================= */

.hero-carousel__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    color: #fff;
    font-size: 1.5rem;
}

@media (min-width: 768px) {
    .hero-carousel__arrow {
        display: flex;
    }
}

.hero-carousel__arrow:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.hero-carousel__arrow--prev {
    left: 2rem;
}

.hero-carousel__arrow--next {
    right: 2rem;
}

/* ============================================================================
   PARALLAX EFFECT (on scroll)
   ========================================================================= */

.hero-video-carousel[data-parallax="true"] .hero-slide__background {
    transition: transform 0.1s linear;
}

/* ============================================================================
   LOADING & PERFORMANCE
   ========================================================================= */

.hero-slide__background[data-loaded="false"] {
    background-color: #1a1a1a;
}

.hero-slide__background[data-loaded="true"] {
    animation-play-state: running;
}

/* Optimisation mobile - Réduire les effets sur petits écrans */
@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
    .hero-slide__background {
        animation: none !important;
        transform: scale(1.05) !important;
    }
}

/* ============================================================================
   ACCESSIBILITY
   ========================================================================= */

.hero-carousel__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Pause au hover (desktop) */
@media (min-width: 768px) {
    .hero-video-carousel:hover .hero-slide__background {
        animation-play-state: paused;
    }
}

/* Respect des préférences d'animation réduites */
@media (prefers-reduced-motion: reduce) {
    .hero-slide__background,
    .hero-slide__content,
    .hero-slide__category,
    .hero-slide__title,
    .hero-slide__description,
    .hero-slide__cta {
        animation: none !important;
        transition: opacity 0.3s ease !important;
    }
}

/* ============================================================================
   MUSIQUE DE FOND - Contrôles
   ========================================================================= */

.hero-carousel__audio-control {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    color: #fff;
}

.hero-carousel__audio-control:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.hero-carousel__audio-control svg {
    width: 20px;
    height: 20px;
}

/* ============================================================================
   RESPONSIVE OPTIMIZATIONS
   ========================================================================= */

/* Mobile First - Performance optimisée */
@media (max-width: 767px) {
    .hero-slide__content {
        padding: 1.5rem;
    }

    .hero-slide__title {
        font-size: 2rem;
    }

    .hero-slide__description {
        font-size: 1rem;
    }

    .hero-slide__cta-button {
        padding: 0.875rem 2rem;
        font-size: 0.9375rem;
    }
}

/* Tablette */
@media (min-width: 768px) and (max-width: 1023px) {
    .hero-slide__title {
        font-size: 3rem;
    }
}

/* Grand écran - Full cinematic experience */
@media (min-width: 1920px) {
    .hero-video-carousel {
        height: 100vh;
    }

    .hero-slide__title {
        font-size: 5rem;
    }

    .hero-slide__description {
        font-size: 1.5rem;
    }
}

/* ============================================================================
   PRINT STYLES
   ========================================================================= */

@media print {
    .hero-video-carousel {
        display: none;
    }
}
