/**
 * ACF Gallery & Repeater Addon - Lightbox Styles
 */

.acfgra-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.acfgra-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.acfgra-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
}

.acfgra-lightbox-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 80px;
    z-index: 1;
}

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

.acfgra-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.acfgra-lightbox-close svg {
    fill: #fff;
}

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

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

.acfgra-lightbox-nav svg {
    fill: #fff;
}

.acfgra-lightbox-prev {
    left: 15px;
}

.acfgra-lightbox-next {
    right: 15px;
}

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

.acfgra-lightbox-image-wrapper {
    position: relative;
    max-width: 100%;
    max-height: calc(100vh - 200px);
}

.acfgra-lightbox-image {
    max-width: 100%;
    max-height: calc(100vh - 200px);
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.acfgra-lightbox-image.is-loaded {
    opacity: 1;
}

.acfgra-lightbox-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

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

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

.acfgra-lightbox-info {
    margin-top: 15px;
    text-align: center;
    color: #fff;
}

.acfgra-lightbox-title {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.acfgra-lightbox-caption {
    margin: 5px 0 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.acfgra-lightbox-counter {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.acfgra-lightbox-thumbnails {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.5);
    overflow-x: auto;
}

.acfgra-lightbox-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
    background: transparent;
}

.acfgra-lightbox-thumb:hover,
.acfgra-lightbox-thumb.is-active {
    opacity: 1;
    border-color: #fff;
}

.acfgra-lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hide scrollbar on lightbox thumbnails */
.acfgra-lightbox-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.acfgra-lightbox-thumbnails::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.acfgra-lightbox-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 768px) {
    .acfgra-lightbox-container {
        padding: 50px 15px;
    }

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

    .acfgra-lightbox-prev {
        left: 5px;
    }

    .acfgra-lightbox-next {
        right: 5px;
    }

    .acfgra-lightbox-thumb {
        width: 50px;
        height: 50px;
    }
}
