/**
 * Modulo Video - Front-end Styles
 */

/* ==========================================================================
   BOUTON VIDÉO PRODUIT
   ========================================================================== */

.modulo-video-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    line-height: 1;
    transition: background-color 0.2s ease, transform 0.1s ease;
    background-color: var(--modulo-btn-bg, #333333);
    color: var(--modulo-btn-color, #ffffff);
    margin-top: 15px;
}

.modulo-video-button:hover {
    background-color: var(--modulo-btn-hover, #555555);
}

.modulo-video-button:active {
    transform: scale(0.98);
}

.modulo-video-button:focus {
    outline: 2px solid var(--modulo-btn-bg, #333333);
    outline-offset: 2px;
}

/* Tailles */
.modulo-video-button--small {
    padding: 8px 14px;
    font-size: 13px;
}

.modulo-video-button--medium {
    padding: 12px 20px;
    font-size: 14px;
}

.modulo-video-button--large {
    padding: 16px 28px;
    font-size: 16px;
}

.modulo-video-button--full {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
}

/* Icône */
.modulo-video-icon {
    flex-shrink: 0;
}

/* ==========================================================================
   MODAL VIDÉO
   ========================================================================== */

.modulo-video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modulo-video-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.modulo-video-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modulo-modal-overlay, rgba(0, 0, 0, 0.8));
    cursor: pointer;
}

.modulo-video-modal__container {
    position: relative;
    z-index: 1;
    width: 90%;
    max-height: 90vh;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modulo-video-modal.is-open .modulo-video-modal__container {
    transform: scale(1);
}

/* Tailles modal */
.modulo-video-modal__container--medium {
    max-width: 60%;
}

.modulo-video-modal__container--large {
    max-width: 80%;
}

.modulo-video-modal__container--fullscreen {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
}

.modulo-video-modal__close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.modulo-video-modal__close:hover {
    opacity: 1;
}

.modulo-video-modal__container--fullscreen .modulo-video-modal__close {
    top: 20px;
    right: 20px;
    z-index: 10;
}

.modulo-video-modal__content {
    position: relative;
    background: #000;
    border-radius: 4px;
    overflow: hidden;
}

.modulo-video-modal__container--fullscreen .modulo-video-modal__content {
    border-radius: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modulo-video-modal__video {
    display: block;
    width: 100%;
    height: auto;
    max-height: 90vh;
}

.modulo-video-modal__container--fullscreen .modulo-video-modal__video {
    max-height: 100vh;
    max-width: 100vw;
    object-fit: contain;
}

/* ==========================================================================
   BLOC VIDÉO FOND
   ========================================================================== */

.modulo-video-bg {
    position: relative;
    overflow: hidden;
    height: var(--mvb-height, 70vh);
    min-height: 300px;
}

.modulo-video-bg--full-width {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

.modulo-video-bg__video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: 1;
}

.modulo-video-bg__poster-mobile {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.modulo-video-bg__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.modulo-video-bg__content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    display: flex;
    padding: 40px;
    box-sizing: border-box;
}

/* Alignement horizontal */
.modulo-video-bg__content--h-left {
    justify-content: flex-start;
    text-align: left;
}

.modulo-video-bg__content--h-center {
    justify-content: center;
    text-align: center;
}

.modulo-video-bg__content--h-right {
    justify-content: flex-end;
    text-align: right;
}

/* Alignement vertical */
.modulo-video-bg__content--v-top {
    align-items: flex-start;
}

.modulo-video-bg__content--v-center {
    align-items: center;
}

.modulo-video-bg__content--v-bottom {
    align-items: flex-end;
}

.modulo-video-bg__text {
    max-width: 800px;
}

/* Tailles de texte */
.modulo-video-bg__text--small .modulo-video-bg__title {
    font-size: 1.5rem;
}

.modulo-video-bg__text--small .modulo-video-bg__subtitle {
    font-size: 1rem;
}

.modulo-video-bg__text--medium .modulo-video-bg__title {
    font-size: 2.5rem;
}

.modulo-video-bg__text--medium .modulo-video-bg__subtitle {
    font-size: 1.125rem;
}

.modulo-video-bg__text--large .modulo-video-bg__title {
    font-size: 3.5rem;
}

.modulo-video-bg__text--large .modulo-video-bg__subtitle {
    font-size: 1.25rem;
}

.modulo-video-bg__title {
    margin: 0 0 15px 0;
    font-weight: 700;
    line-height: 1.2;
}

.modulo-video-bg__subtitle {
    margin: 0 0 25px 0;
    opacity: 0.9;
    line-height: 1.5;
}

/* Bouton CTA */
.modulo-video-bg__cta {
    display: inline-block;
    padding: 14px 30px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modulo-video-bg__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.modulo-video-bg__cta--filled {
    background-color: var(--mvb-cta-bg, #ffffff);
    color: var(--mvb-cta-color, #000000);
    border: 2px solid transparent;
}

.modulo-video-bg__cta--outline {
    background-color: transparent;
    color: var(--mvb-cta-bg, #ffffff);
    border: 2px solid var(--mvb-cta-bg, #ffffff);
}

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

@media (max-width: 768px) {
    /* Modal */
    .modulo-video-modal__container--medium,
    .modulo-video-modal__container--large {
        max-width: 95%;
    }
    
    .modulo-video-modal__close {
        top: -35px;
    }
    
    /* Bloc vidéo fond */
    .modulo-video-bg__content {
        padding: 20px;
    }
    
    .modulo-video-bg__text--small .modulo-video-bg__title {
        font-size: 1.25rem;
    }
    
    .modulo-video-bg__text--medium .modulo-video-bg__title {
        font-size: 1.75rem;
    }
    
    .modulo-video-bg__text--large .modulo-video-bg__title {
        font-size: 2rem;
    }
    
    .modulo-video-bg__subtitle {
        font-size: 1rem !important;
    }
    
    .modulo-video-bg__cta {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
    
    /* Désactiver vidéo sur mobile */
    .modulo-video-bg--disable-mobile .modulo-video-bg__video {
        display: none;
    }
    
    .modulo-video-bg--disable-mobile .modulo-video-bg__poster-mobile {
        display: block;
    }
}

/* Masquer bouton sur mobile si option activée */
@media (max-width: 768px) {
    .modulo-video-button--hide-mobile {
        display: none !important;
    }
}
