/* 
 * Zekin Vote Live - Frontend Styles
 * Styles pour le popup publicitaire et animations
 */

/* ========================================
   POPUP PUBLICITAIRE
   ======================================== */

.zekin-ad-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.zekin-ad-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    cursor: pointer;
}

.zekin-ad-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: 90vh;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: zekin-popup-appear 0.4s ease-out;
}

@keyframes zekin-popup-appear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.zekin-ad-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.zekin-ad-close:hover {
    background: rgba(220, 38, 38, 0.9);
    transform: rotate(90deg);
}

.zekin-ad-content {
    position: relative;
    width: 100%;
    max-width: 800px;
    max-height: 80vh;
}

.zekin-ad-image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

#zekin-ad-image {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

.zekin-ad-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    z-index: 10;
}

.zekin-ad-indicator {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: default;
    white-space: nowrap;
}

.zekin-ad-indicator.active {
    background: #0073aa;
    transform: scale(1.1);
}

/* ========================================
   BOUTON DE VOTE (optionnel)
   ======================================== */

.zekin-vote-button-wrapper {
    padding: 15px 20px;
    border-top: 1px solid #e2e8f0;
}

.zekin-vote-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.zekin-vote-button:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
    color: #fff;
}

.zekin-vote-button .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ========================================
   ANIMATIONS SUPPLÉMENTAIRES
   ======================================== */

@keyframes zekin-shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.zekin-loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: zekin-shimmer 2s infinite;
}

/* Animation de mise à jour des scores */
@keyframes zekin-score-update {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.zekin-score-updated {
    animation: zekin-score-update 0.5s ease;
}

/* ========================================
   RESPONSIVE - POPUP
   ======================================== */

@media (max-width: 768px) {
    .zekin-ad-container {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .zekin-ad-content {
        max-width: 100%;
    }
    
    #zekin-ad-image {
        max-height: 70vh;
    }
    
    .zekin-ad-close {
        width: 35px;
        height: 35px;
        font-size: 24px;
        top: 10px;
        right: 10px;
    }
    
    .zekin-ad-indicators {
        bottom: 15px;
        padding: 10px 15px;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
        max-width: 90%;
    }
    
    .zekin-ad-indicator {
        padding: 6px 12px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .zekin-ad-container {
        border-radius: 12px;
    }
    
    .zekin-ad-indicators {
        bottom: 10px;
        padding: 8px 12px;
        gap: 6px;
    }
    
    .zekin-ad-indicator {
        padding: 5px 10px;
        font-size: 10px;
    }
}

/* ========================================
   ÉTAT DÉSACTIVÉ (si popup désactivé)
   ======================================== */

.zekin-popup-disabled .zekin-ad-popup {
    display: none !important;
}

/* ========================================
   ACCESSIBILITÉ
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .zekin-ad-popup,
    .zekin-ad-container,
    #zekin-ad-image,
    .zekin-ad-indicator {
        animation: none !important;
        transition: none !important;
    }
}

/* Focus visible pour l'accessibilité */
.zekin-ad-close:focus-visible {
    outline: 3px solid #0073aa;
    outline-offset: 2px;
}

/* ========================================
   PRINT - Masquer le popup
   ======================================== */

@media print {
    .zekin-ad-popup {
        display: none !important;
    }
}

/* ========================================
   STYLES ADDITIONNELS POUR L'INTÉGRATION
   ======================================== */

/* Empêcher le scroll du body quand le popup est ouvert */
body.zekin-popup-open {
    overflow: hidden;
}

/* Transition fluide pour le changement d'image */
#zekin-ad-image {
    transition: opacity 0.3s ease;
}

/* Style pour les images cliquables */
#zekin-ad-image[style*="cursor: pointer"] {
    cursor: pointer !important;
}

#zekin-ad-image[style*="cursor: pointer"]:hover {
    opacity: 0.95;
}

/* Indicateur de chargement pour les images */
.zekin-ad-image-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: zekin-spin 0.8s linear infinite;
    opacity: 0;
    pointer-events: none;
}

#zekin-ad-image[src=""] ~ .zekin-ad-image-wrapper::before,
#zekin-ad-image:not([src]) ~ .zekin-ad-image-wrapper::before {
    opacity: 1;
}

/* Animation pour le passage d'un groupe à l'autre */
.zekin-ad-indicator {
    transform-origin: center;
}

.zekin-ad-indicator.active {
    animation: zekin-indicator-pulse 0.6s ease;
}

@keyframes zekin-indicator-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1.1);
    }
}

/* Ombre portée douce pour le container */
.zekin-ad-container {
    box-shadow: 
        0 0 0 1px rgba(0, 0, 0, 0.05),
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Style pour les très grands écrans */
@media (min-width: 1600px) {
    .zekin-ad-content {
        max-width: 1000px;
    }
}

/* Dark mode support (optionnel) */
@media (prefers-color-scheme: dark) {
    .zekin-ad-container {
        background: #1a1a1a;
    }
}
