/* ============================================
   Portfolio Gallery - Lightbox
   ============================================ */

.pg-lightbox-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pg-lightbox-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.pg-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.pg-lightbox-backdrop.active .pg-lightbox-content {
    transform: scale(1);
}

.pg-lightbox-content img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 60px rgba(0, 0, 0, 0.5);
}

.pg-lightbox-content iframe {
    width: 80vw;
    height: 45vw;
    max-height: 80vh;
    border: none;
    border-radius: 4px;
}

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

.pg-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

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

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

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

.pg-lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.pg-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

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

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

.pg-lightbox-prev::before {
    content: '';
    width: 12px;
    height: 12px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
    margin-left: 4px;
}

.pg-lightbox-next::before {
    content: '';
    width: 12px;
    height: 12px;
    border-right: 2px solid #fff;
    border-top: 2px solid #fff;
    transform: rotate(45deg);
    margin-right: 4px;
}

.pg-lightbox-caption {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 15px;
    text-align: center;
    max-width: 80%;
    z-index: 1000000;
    opacity: 0.8;
}

.pg-lightbox-counter {
    position: fixed;
    top: 25px;
    left: 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    z-index: 1000000;
}

/* Loading spinner for lightbox */
.pg-lightbox-loading {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pg-spin 0.8s linear infinite;
}

@media (max-width: 767px) {
    .pg-lightbox-content iframe {
        width: 95vw;
        height: 56vw;
    }

    .pg-lightbox-nav {
        width: 40px;
        height: 40px;
    }

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

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