/* CompuKaed Video - Styles Frontend */

/* Intégration dans la galerie WooCommerce */
.woocommerce-product-gallery__image.compukaed-video-gallery-item {
    position: relative;
    display: inline-block;
}

.compukaed-video-gallery-item video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.compukaed-video-gallery-item .compukaed-video-link {
    position: relative;
    display: block;
}

/* Icône play sur la vidéo */
.compukaed-video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
}

.compukaed-play-icon {
    display: inline-block;
    width: 60px;
    height: 60px;
    line-height: 60px;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    font-size: 24px;
    transition: all 0.3s ease;
}

.compukaed-video-link:hover .compukaed-play-icon {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Style pour la miniature vidéo */
.compukaed-video-thumbnail-wrapper {
    position: relative;
}

.compukaed-video-thumbnail video {
    width: 100%;
    height: auto;
    display: block;
}

.compukaed-video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    font-size: 16px;
    pointer-events: none;
}

/* Modal vidéo */
.compukaed-video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: compukaed-fadeIn 0.3s ease;
}

@keyframes compukaed-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.compukaed-video-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.compukaed-video-modal-content video {
    width: 100%;
    height: auto;
    max-height: 80vh;
}

.compukaed-video-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
    transition: opacity 0.3s ease;
}

.compukaed-video-modal-close:hover {
    opacity: 0.7;
}

/* Miniature vidéo cliquable */
.compukaed-video-thumbnail {
    position: relative;
    display: inline-block;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.compukaed-video-thumbnail:hover {
    transform: scale(1.05);
}

.compukaed-video-thumbnail::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 48px;
    text-shadow: 0 0 10px rgba(0,0,0,0.8);
    pointer-events: none;
    transition: all 0.3s ease;
}

.compukaed-video-thumbnail:hover::after {
    transform: translate(-50%, -50%) scale(1.2);
}

/* Intégration avec WooCommerce */
.woocommerce-product-gallery .compukaed-product-video {
    margin: 0;
}

.woocommerce-product-gallery .compukaed-video-container {
    width: 100%;
}

.woocommerce-product-gallery .compukaed-video-player {
    width: 100%;
    height: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .compukaed-product-video h3 {
        font-size: 16px;
    }
    
    .compukaed-video-modal-content {
        max-width: 95%;
        margin: 20px;
    }
    
    .compukaed-video-modal-close {
        font-size: 24px;
        top: 5px;
        right: 10px;
    }
    
    .compukaed-video-thumbnail::after {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .compukaed-product-video {
        margin: 15px 0;
    }
    
    .compukaed-video-player {
        border-radius: 4px;
    }
    
    .compukaed-video-thumbnail::after {
        font-size: 28px;
    }
}

/* Amélioration de l'accessibilité */
.compukaed-video-player:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.compukaed-video-thumbnail:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Animation de chargement */
.compukaed-video-player.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: compukaed-spin 1s linear infinite;
}

@keyframes compukaed-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
