/**
 * Biix Video - Styles
 * Video jako podmiana głównego obrazka
 */

/* ==========================================================================
   Kontener video - zastępuje obrazek
   ========================================================================== */

.biixvideo-container {
    position: relative;
    width: 100%;
    min-height: 400px;
    aspect-ratio: 1 / 1;
    background: #000;
    overflow: hidden;
}

/* YouTube container */
#biixvideo-youtube-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#biixvideo-youtube-container iframe,
#biixvideo-youtube {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

/* Player wrapper */
.biixvideo-player-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.biixvideo-player-wrapper video,
.biixvideo-player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Plyr styles - FULL SIZE */
.biixvideo-container .plyr,
.biixvideo-container .plyr--video {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.biixvideo-container .plyr__video-wrapper {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    padding-bottom: 0 !important;
}

.biixvideo-container .plyr video,
.biixvideo-container .plyr__video-wrapper video {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    max-width: none !important;
    max-height: none !important;
}

/* ==========================================================================
   Loader / Spinner
   ========================================================================== */

.biixvideo-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10;
    transition: opacity 0.3s ease;
}

.biixvideo-container.loaded .biixvideo-loader {
    opacity: 0;
    pointer-events: none;
}

.biixvideo-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: biixvideo-spin 1s linear infinite;
}

@keyframes biixvideo-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Kontrolki
   ========================================================================== */

.biixvideo-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.biixvideo-container:hover .biixvideo-controls,
.biixvideo-container:not(.playing) .biixvideo-controls {
    opacity: 1;
}

.biixvideo-play-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.biixvideo-play-btn:hover {
    transform: scale(1.1);
    background: #fff;
}

.biixvideo-play-btn svg {
    width: 28px;
    height: 28px;
    fill: #333;
}

/* Ikony play/pause */
.biixvideo-icon-play,
.biixvideo-icon-pause {
    display: none;
}

.biixvideo-container:not(.playing) .biixvideo-icon-play {
    display: block;
}

.biixvideo-container.playing .biixvideo-icon-pause {
    display: block;
}

/* Click animation */
.biixvideo-container.click-animation .biixvideo-play-btn {
    animation: biixvideo-pulse 0.4s ease;
}

@keyframes biixvideo-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.9);
    }
}

/* ==========================================================================
   Przycisk zamknięcia (X)
   ========================================================================== */

.biixvideo-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 30;
}

.biixvideo-close-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.biixvideo-close-btn svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

/* ==========================================================================
   Badge/overlay na miniaturce
   ========================================================================== */

.biixvideo-thumb {
    position: relative;
}

.biixvideo-thumb-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    z-index: 5;
}

.biixvideo-thumb-overlay:hover {
    background: rgba(0, 0, 0, 0.5);
}

.biixvideo-thumb-play {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.biixvideo-thumb-overlay:hover .biixvideo-thumb-play {
    transform: scale(1.1);
}

.biixvideo-thumb-play svg {
    width: 18px;
    height: 18px;
    fill: #333;
    margin-left: 2px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .biixvideo-container {
        min-height: 300px;
    }
    
    .biixvideo-play-btn {
        width: 50px;
        height: 50px;
    }
    
    .biixvideo-play-btn svg {
        width: 24px;
        height: 24px;
    }
    
    .biixvideo-close-btn {
        width: 36px;
        height: 36px;
        top: 10px;
        right: 10px;
    }
    
    .biixvideo-close-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .biixvideo-thumb-play {
        width: 30px;
        height: 30px;
    }
    
    .biixvideo-thumb-play svg {
        width: 14px;
        height: 14px;
    }
}
