/**
 * GB Media Embeds - Lightbox Styles
 */

/* ==========================================================================
   Lightbox Overlay
   ========================================================================== */

.gb-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gb-lightbox-overlay.gb-lightbox-active {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   Lightbox Container
   ========================================================================== */

.gb-lightbox-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gb-lightbox-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    max-height: 100%;
}

.gb-lightbox-image {
    max-width: 90vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.gb-lightbox-active .gb-lightbox-image {
    opacity: 1;
    transform: scale(1);
}

/* ==========================================================================
   Lightbox Caption
   ========================================================================== */

.gb-lightbox-caption {
    color: #fff;
    text-align: center;
    padding: 15px 20px;
    max-width: 600px;
    font-size: 14px;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease 0.15s, transform 0.3s ease 0.15s;
}

.gb-lightbox-active .gb-lightbox-caption {
    opacity: 0.9;
    transform: translateY(0);
}

/* ==========================================================================
   Lightbox Controls
   ========================================================================== */

.gb-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.gb-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.gb-lightbox-close::before,
.gb-lightbox-close::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
}

.gb-lightbox-close::before {
    transform: rotate(45deg);
}

.gb-lightbox-close::after {
    transform: rotate(-45deg);
}

/* Navigation Arrows */
.gb-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.gb-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.gb-lightbox-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.gb-lightbox-prev {
    left: 20px;
}

.gb-lightbox-next {
    right: 20px;
}

.gb-lightbox-nav::before {
    content: '';
    width: 12px;
    height: 12px;
    border-top: 2px solid #fff;
    border-right: 2px solid #fff;
}

.gb-lightbox-prev::before {
    transform: rotate(-135deg);
    margin-left: 4px;
}

.gb-lightbox-next::before {
    transform: rotate(45deg);
    margin-right: 4px;
}

.gb-lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.gb-lightbox-nav:disabled:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Counter
   ========================================================================== */

.gb-lightbox-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.gb-lightbox-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
}

.gb-lightbox-loading::after {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: gb-lightbox-spin 0.8s linear infinite;
}

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

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

@media screen and (max-width: 768px) {
    .gb-lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }

    .gb-lightbox-nav {
        width: 44px;
        height: 44px;
    }

    .gb-lightbox-prev {
        left: 10px;
    }

    .gb-lightbox-next {
        right: 10px;
    }

    .gb-lightbox-counter {
        top: 10px;
        left: 10px;
        font-size: 12px;
        padding: 6px 12px;
    }

    .gb-lightbox-caption {
        font-size: 13px;
        padding: 10px 15px;
    }

    .gb-lightbox-image {
        max-width: 95vw;
        max-height: 75vh;
    }
}

/* Touch-friendly styles */
@media (hover: none) and (pointer: coarse) {
    .gb-lightbox-nav {
        width: 60px;
        height: 60px;
    }

    .gb-lightbox-close {
        width: 50px;
        height: 50px;
    }
}
