/**
 * Estilos do Frontend - Bolinha e Modal
 *
 * @package WC_Product_Video
 */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    --wcpv-primary: #ffffff;
    --wcpv-secondary: #000000;
    --wcpv-border-white: #ffffff;
    --wcpv-border-black: #000000;
}

/* ========================================
   Floating Bubble
   ======================================== */
.wcpv-floating-bubble {
    position: fixed;
    z-index: 9999;
    cursor: pointer;
    transition: 200ms ease-out;
}

/* Posições */
.wcpv-floating-bubble.top-left {
    top: 160px;
    left: 16px;
}

.wcpv-floating-bubble.top-right {
    top: 160px;
    right: 16px;
}

.wcpv-floating-bubble.bottom-left {
    bottom: 100px;
    left: 16px;
}

.wcpv-floating-bubble.bottom-right {
    bottom: 100px;
    right: 16px;
}

/* Wrapper - contém label e círculo */
.wcpv-wrapper {
    position: relative;
    display: inline-block;
}

/* Tamanhos */
.wcpv-floating-bubble.size-xs .wcpv-bubble-shape {
    width: 75px;
    height: 75px;
}

.wcpv-floating-bubble.size-sm .wcpv-bubble-shape {
    width: 100px;
    height: 100px;
}

.wcpv-floating-bubble.size-md .wcpv-bubble-shape {
    width: 130px;
    height: 130px;
}

.wcpv-floating-bubble.size-lg .wcpv-bubble-shape {
    width: 170px;
    height: 170px;
}

/* Shape da Bolinha - fica NA FRENTE da label */
.wcpv-bubble-shape {
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    z-index: 2;
}

/* Borda estilo SimoneLit - cor externa + borda branca interna */
.wcpv-bubble-border {
    width: 100%;
    height: 100%;
    border: 3px solid var(--wcpv-border-color, #ffffff);
    border-radius: 50%;
    padding: 2px;
    background: #ffffff;
    box-sizing: border-box;
}

/* Inner */
.wcpv-bubble-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background: #000;
}

/* Vídeo na bolinha */
.wcpv-bubble-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    user-select: none;
}

/* Indicador de múltiplos vídeos */
.wcpv-bubble-indicators {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    z-index: 3;
}

.wcpv-bubble-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: background 0.2s ease;
}

.wcpv-bubble-indicator.active {
    background: #ffffff;
}

/* ========================================
   Label "Vídeo do produto" - Estilo SimoneLit
   ======================================== */
.wcpv-bubble-label {
    position: absolute;
    top: 50%;
    left: 50%;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-radius: 36px;
    background-color: #000;
    white-space: nowrap;
    overflow: hidden;
    z-index: 1;
    /* Começa escondido atrás do círculo */
    width: 0;
    transform: translateY(-50%);
    transition: width 1s ease;
}

/* Texto via ::after */
.wcpv-bubble-label::after {
    content: attr(data-text);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    white-space: nowrap;
    padding: 0 20px;
    text-transform: uppercase;
}

/* Quando mostrar - expande para a direita */
.wcpv-bubble-label.show {
    width: 214px;
}

/* Label para posição direita - expande para a esquerda */
.wcpv-floating-bubble.top-right .wcpv-bubble-label,
.wcpv-floating-bubble.bottom-right .wcpv-bubble-label {
    left: auto;
    right: 50%;
    justify-content: flex-start;
}

/* ========================================
   Modal
   ======================================== */
.wcpv-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wcpv-modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* Container do Modal */
.wcpv-modal-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 85vh;
    max-height: 700px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

/* Barra de progresso (Stories) */
.wcpv-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 4px;
    padding: 12px;
    z-index: 10;
}

.wcpv-progress-item {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.wcpv-progress-fill {
    height: 100%;
    background: #fff;
    width: 0%;
}

/* Animação suave da barra */
.wcpv-progress-item.active .wcpv-progress-fill {
    animation: wcpv-progress-animation var(--video-duration, 10s) linear forwards;
}

@keyframes wcpv-progress-animation {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

.wcpv-progress-item.completed .wcpv-progress-fill {
    width: 100%;
}

.wcpv-progress-item.active .wcpv-progress-fill {
    width: 0%;
}

/* Vídeo no Modal */
.wcpv-modal-video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
}

.wcpv-modal-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

/* Controles do Modal */
.wcpv-modal-controls {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 10;
}

.wcpv-modal-container .wcpv-control-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    border-radius: 50% !important;
    background: rgba(0, 0, 0, 0.5) !important;
    border: none !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #fff !important;
    transition: background 0.2s ease;
    backdrop-filter: blur(10px);
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

.wcpv-modal-container .wcpv-control-btn:hover {
    background: rgba(0, 0, 0, 0.7) !important;
}

.wcpv-modal-container .wcpv-control-btn svg {
    width: 24px !important;
    height: 24px !important;
    fill: #fff !important;
}

/* Botão Fechar */
.wcpv-modal-container .wcpv-close-btn {
    position: absolute !important;
    top: 22px !important;
    right: 12px !important;
    z-index: 10;
}

/* Navegação por swipe */
.wcpv-swipe-area {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30%;
    z-index: 5;
}

.wcpv-swipe-prev {
    left: 0;
    cursor: w-resize;
}

.wcpv-swipe-next {
    right: 0;
    cursor: e-resize;
}

/* ========================================
   Mobile Styles
   ======================================== */
@media (max-width: 768px) {
    .wcpv-floating-bubble {
        top: auto !important;
        bottom: auto !important;
        position: fixed;
        top: 120px !important;
    }

    .wcpv-floating-bubble.top-left,
    .wcpv-floating-bubble.bottom-left {
        left: 10px;
    }

    .wcpv-floating-bubble.top-right,
    .wcpv-floating-bubble.bottom-right {
        right: 10px;
    }

    /* Bolinha menor no mobile */
    .wcpv-floating-bubble.size-lg .wcpv-bubble-shape {
        width: 100px;
        height: 100px;
    }

    .wcpv-floating-bubble.size-md .wcpv-bubble-shape {
        width: 90px;
        height: 90px;
    }

    /* Modal fullscreen no mobile */
    .wcpv-modal-container {
        max-width: 100%;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
}

/* ========================================
   Animações
   ======================================== */

/* Fade transition para vídeos */
.wcpv-video-fade-enter {
    opacity: 0;
}

.wcpv-video-fade-enter-active {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.wcpv-video-fade-exit {
    opacity: 1;
}

.wcpv-video-fade-exit-active {
    opacity: 0;
    transition: opacity 0.3s ease;
}
