/**
 * TPP Lightbox Styles
 *
 * @package TPP_Custom_Theme
 * @subpackage Gallery
 */

/* Body scroll lock */
body.tpp-lightbox-open {
    overflow: hidden;
}

/* Lightbox container */
.tpp-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--tpp-z-modal-high);
}

.tpp-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Overlay */
.tpp-lightbox__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(4px);
}

/* Container */
.tpp-lightbox__container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 80px;
}

/* Close button */
.tpp-lightbox__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.tpp-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

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

.tpp-lightbox__nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.tpp-lightbox__nav--prev {
    left: 20px;
}

.tpp-lightbox__nav--next {
    right: 20px;
}

/* Content */
.tpp-lightbox__content {
    max-width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 5;
}

/* Image wrapper */
.tpp-lightbox__image-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Image */
.tpp-lightbox__image {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tpp-lightbox__image.loaded {
    opacity: 1;
}

/* Loading spinner */
.tpp-lightbox__loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
}

.tpp-lightbox__loading.active {
    display: block;
}

.tpp-lightbox__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--tpp-primary, #05d38f);
    border-radius: 50%;
    animation: tpp-lightbox-spin 0.8s linear infinite;
}

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

/* Title */
.tpp-lightbox__title {
    margin-top: 16px;
    padding: 8px 16px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    max-width: 600px;
}

/* Bottom bar */
.tpp-lightbox__bottom {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 30px;
    z-index: 10;
}

/* Counter */
.tpp-lightbox__counter {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--tpp-font-primary);
    letter-spacing: 0.5px;
}

/* Share buttons */
.tpp-lightbox__share {
    display: flex;
    gap: 10px;
}

.tpp-lightbox__share-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: background 0.2s ease, transform 0.2s ease;
    position: relative;
}

.tpp-lightbox__share-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.tpp-lightbox__share-btn--facebook:hover {
    background: #1877f2;
}

.tpp-lightbox__share-btn--twitter:hover {
    background: #000;
}

.tpp-lightbox__share-btn--pinterest:hover {
    background: #bd081c;
}

.tpp-lightbox__share-btn--copy:hover {
    background: var(--tpp-primary, #05d38f);
}

/* Copy tooltip */
.tpp-lightbox__copy-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--tpp-primary, #05d38f);
    color: #000;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    margin-bottom: 8px;
}

.tpp-lightbox__copy-tooltip.active {
    opacity: 1;
    visibility: visible;
}

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

/* Tablet */
@media (max-width: 1024px) {
    .tpp-lightbox__container {
        padding: 50px 60px;
    }

    .tpp-lightbox__nav {
        width: 48px;
        height: 48px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .tpp-lightbox__container {
        padding: 60px 20px;
    }

    .tpp-lightbox__nav {
        display: none;
    }

    .tpp-lightbox__close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }

    .tpp-lightbox__image {
        max-height: 60vh;
        border-radius: 8px;
    }

    .tpp-lightbox__bottom {
        flex-direction: column;
        gap: 15px;
        bottom: 15px;
    }

    .tpp-lightbox__share-btn {
        width: 36px;
        height: 36px;
    }
}
