/* ==========================================================================
   Modern Work Lightbox - Refined
   ========================================================================== */
.work-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    opacity: 0;
    justify-content: center;
    align-items: center;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.work-lightbox.visible {
    display: flex;
    opacity: 1;
}

.work-lightbox .lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1100px;
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
}

.work-lightbox.visible .lightbox-content {
    transform: scale(1);
}

.work-lightbox .video-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.work-lightbox .center-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 5em;
    height: 5em;
    background: rgba(169, 139, 248, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid var(--purple-light);
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

.work-lightbox .center-play-btn svg {
    width: 50%;
    height: 50%;
    fill: currentColor;
    margin-left: 0.3em;
}

.work-lightbox.is-paused .center-play-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.work-lightbox video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
}

.work-lightbox .lightbox-controls {
    padding: 1.5em 2em;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 100%);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    transition: all 0.3s ease;
}

.work-lightbox.is-paused .lightbox-controls {
    background: rgba(0, 0, 0, 0.6);
}

.work-lightbox .main-controls {
    display: flex;
    align-items: center;
    gap: 1.5em;
}

.work-lightbox .play-pause-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 3.2em;
    height: 3.2em;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.work-lightbox .play-pause-btn svg {
    width: 1.2em;
    height: 1.2em;
    fill: currentColor;
}

.work-lightbox .work-info {
    color: #fff;
}

.work-lightbox .work-info h3 {
    margin: 0;
    font-family: 'swis721__bt_expanded_2';
    font-size: 1.4em;
    letter-spacing: 1px;
}

.work-lightbox .work-info p {
    margin: 0.2em 0 0;
    opacity: 0.7;
    font-size: 0.9em;
}

.work-lightbox .audio-tracks {
    display: flex;
    gap: 1em;
}

.work-lightbox .audio-track-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.8em 1.2em;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.8em;
    font-size: 0.85em;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.work-lightbox .audio-track-btn svg {
    width: 1.2em;
    height: 1.2em;
    fill: currentColor;
}

.work-lightbox .audio-track-btn.active {
    background: linear-gradient(135deg, var(--purple-light) 0%, var(--green-light) 100%);
    color: #000;
    border-color: transparent;
}

.work-lightbox .close-btn {
    position: absolute;
    top: 1.5em;
    right: 1.5em;
    width: 3em;
    height: 3em;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2em;
    transition: all 0.3s ease;
    z-index: 100;
    backdrop-filter: blur(5px);
}

/* Background scroll prevention */
body.lightbox-open {
    overflow: hidden !important;
    /* Removed position: fixed to prevent jumping to top */
    touch-action: none;
    /* Prevents touch scroll on some mobile browsers */
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .work-lightbox {
        padding: 0;
        align-items: center;
    }

    .work-lightbox .lightbox-content {
        width: 100%;
        max-width: 100%;
        height: 100%;
        /* Occupation full screen to avoid issues */
        max-height: 100vh;
        border-radius: 0;
        overflow-y: auto;
    }

    .work-lightbox .video-container {
        position: sticky;
        top: 0;
        z-index: 50;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    }

    .work-lightbox .lightbox-controls {
        position: relative;
        padding: 2em 1.5em;
        flex-direction: column;
        gap: 2.5em;
        background: #000;
        opacity: 1 !important;
        bottom: auto;
    }

    .work-lightbox .main-controls {
        flex-direction: column;
        gap: 1.5em;
        text-align: center;
    }

    .work-lightbox .audio-tracks {
        flex-direction: column;
        width: 100%;
        gap: 0.8em;
    }

    .work-lightbox .audio-track-btn {
        width: 100%;
        justify-content: center;
        padding: 1.2em;
        font-size: 1em;
    }

    .work-lightbox .work-info h3 {
        font-size: 1.3em;
    }

    .work-lightbox .close-btn {
        top: 1em;
        right: 1em;
        width: 2.5em;
        height: 2.5em;
        background: rgba(0, 0, 0, 0.5);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
}

/* Loader Styles */
.loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    /* jQuery will toggle this */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 60;
    color: #fff;
    gap: 1.5em;
    backdrop-filter: blur(5px);
    text-align: center;
}

/* Force flex when visible to ensure centering */
.loader-overlay[style*="display: block"] {
    display: flex !important;
}

.loader-spinner {
    width: 3.5em;
    height: 3.5em;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--purple-light);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-overlay span {
    font-size: 0.9em;
    letter-spacing: 1px;
    opacity: 0.8;
    text-transform: uppercase;
    font-family: 'swis721__bt_expanded_2';
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}