/* Styles pour la vidéo story mobile */

/* Container vidéo principal */
.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

/* Thumbnail vidéo dans le slider de miniatures */
.video-thumbnail {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    transition: all 0.3s ease;
}

.video-thumbnail:hover .video-play-overlay {
    transform: translate(-50%, -50%) scale(1.1);
}

.play-icon {
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

/* Poster de la vidéo principale */
.video-poster-container {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-poster-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.video-preview-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.video-preview-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    transition: all 0.3s ease;
}

.video-poster-container:hover .video-play-button {
    transform: translate(-50%, -50%) scale(1.1);
}

.video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* Lecteur vidéo */
.video-player-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.story-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    background: #000;
}

/* Contrôles personnalisés pour mobile */
.video-controls-mobile {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 20px 15px 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-player-container:hover .video-controls-mobile,
.video-controls-mobile.show {
    opacity: 1;
}

.video-progress-container {
    margin-bottom: 8px;
}

.video-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.video-progress-fill {
    height: 100%;
    background: #ff6b35;
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s ease;
}

.video-time {
    display: flex;
    justify-content: space-between;
    color: white;
    font-size: 12px;
    font-weight: 500;
}

/* Loading spinner */
.video-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
}

.video-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid #ff6b35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive - Format story mobile */
@media (max-width: 768px) {
    .video-container {
        aspect-ratio: 9/16; /* Format story mobile */
        max-height: 70vh;
    }
    
    .video-play-button svg {
        width: 60px;
        height: 60px;
    }
    
    .video-controls-mobile {
        padding: 15px 10px 10px;
    }
}

@media (min-width: 769px) {
    .video-container {
        aspect-ratio: 3/4; /* Format plus adapté au desktop */
        max-height: 600px;
    }
}

/* Animation d'apparition */
.video-story-slide {
    opacity: 0;
    animation: fadeInVideo 0.5s ease forwards;
}

@keyframes fadeInVideo {
    to {
        opacity: 1;
    }
}

/* États de la vidéo */
.video-container.loading .video-poster-container {
    opacity: 0.7;
}

.video-container.playing .video-poster-container {
    display: none;
}

.video-container.paused .video-poster-container {
    display: none;
}

/* Bouton de fermeture pour mobile */
.video-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-player-container:hover .video-close-btn,
.video-close-btn.show {
    opacity: 1;
}

/* Indicateur de qualité */
.video-quality-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-player-container:hover .video-quality-indicator {
    opacity: 1;
}
