/* =========================================
   GALERIA WIDEO - DARK PREMIUM
   ========================================= */

.video-gallery-wrapper {
    background-color: var(--bg-color, #0d0e12); /* Mroczne tło Premium */
    padding: 60px 0;
    width: 100%;
}

.video-gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--container, 1200px);
    margin: 0 auto 40px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color, #1f222e);
    padding-bottom: 15px;
}

.video-gallery-title {
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.video-gallery-link {
    color: var(--accent-color, #d4af37);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.video-gallery-link:hover {
    color: #ffffff;
}

/* Siatka dla filmów */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: var(--container, 1200px);
    margin: 0 auto;
    padding: 0 20px;
}

/* Pojedynczy box z wideo */
.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; /* Standardowy kinowy wymiar, brak ucinania dla wideo */
    background-color: #161920; 
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    /* Subtelny obrys (szkło premium) */
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Plakat / Okładka zdjęcia przed kliknięciem */
.video-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.6s ease;
}

/* Efekt najazdu - lekkie powiększenie zdjęcia (Kinowe doświadczenie) */
.video-container:hover .video-poster {
    transform: scale(1.05);
    filter: brightness(0.6);
}

/* Wstrzyknięty iframe Vimeo lub lokalne wideo */
.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    z-index: 5;
    background: #000;
}

/* Przycisk Play w Stylu Glassmorphism */
.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(22, 25, 32, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* Trójkąt Złoty */
.play-button::before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-left: 22px solid var(--accent-color, #d4af37);
    border-top: 14px solid transparent;
    border-bottom: 14px solid transparent;
    margin-left: 6px; 
    transition: border-left-color 0.3s ease;
}

/* Po najechaniu przycisk powiększa się i świeci */
.video-container:hover .play-button {
    background: var(--accent-color, #d4af37);
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.6);
}

.video-container:hover .play-button::before {
    border-left-color: #000000;
}

/* =========================================
   LIGHTBOX (Kinowe Zaciemnienie Ekranu)
   ========================================= */

.video-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.video-lightbox.is-active {
    opacity: 1;
    pointer-events: auto;
}

.video-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 14, 18, 0.95); /* Bardzo ciemne szkło */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.video-lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    z-index: 2;
    aspect-ratio: 16 / 9;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    border-radius: 8px;
    overflow: visible; /* Żeby X mógł wyjść poza obrys */
    background: #000;
}

.video-lightbox-iframe-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
}

.video-lightbox-iframe-wrapper iframe,
.video-lightbox-iframe-wrapper video {
    width: 100%;
    height: 100%;
    border: none;
}

.video-lightbox-close {
    position: absolute;
    top: -45px;
    right: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
}

.video-lightbox-close:hover {
    color: var(--accent-color, #d4af37);
    transform: scale(1.1);
}

/* Responsywność */
@media (max-width: 980px) {
    .videos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .video-lightbox-content {
        width: 100%;
        border-radius: 0;
    }
    .video-lightbox-iframe-wrapper {
        border-radius: 0;
    }
    .video-lightbox-close {
        top: 10px;
        right: 10px;
        z-index: 10;
        background: rgba(0,0,0,0.5);
        border-radius: 50%;
        width: 40px;
        height: 40px;
        font-size: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .videos-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .video-gallery-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding-bottom: 20px;
    }
}
