/* ============================================
   IMAGE GALLERY - ZOOM & FULLSCREEN
   ============================================ */

/* Gallery Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    animation: lightboxFadeIn 0.3s ease-out;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Lightbox Container */
.lightbox-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 80px;
}

/* Main Image */
.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: grab;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.lightbox-image.dragging {
    cursor: grabbing;
}

.lightbox-image.zoomed {
    cursor: move;
}

/* Close Button */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Navigation Arrows */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.lightbox-nav.prev {
    left: 20px;
}

.lightbox-nav.next {
    right: 20px;
}

/* Zoom Controls */
.lightbox-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 20px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.lightbox-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lightbox-btn:active {
    transform: scale(0.95);
}

.lightbox-zoom-level {
    color: white;
    font-size: 14px;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

/* Fullscreen Button */
.lightbox-fullscreen {
    position: absolute;
    top: 20px;
    right: 80px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lightbox-fullscreen:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Image Counter */
.lightbox-counter {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 16px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 20px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Thumbnails Strip */
.lightbox-thumbnails {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    max-width: 90%;
    overflow-x: auto;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.lightbox-thumbnails::-webkit-scrollbar {
    height: 4px;
}

.lightbox-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.lightbox-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.lightbox-thumb:hover {
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.lightbox-thumb.active {
    border-color: #e74c3c;
}

.lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Loading Spinner */
.lightbox-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: lightboxSpin 0.8s linear infinite;
}

@keyframes lightboxSpin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Image Info */
.lightbox-info {
    position: absolute;
    bottom: 30px;
    right: 30px;
    color: white;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    max-width: 250px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .lightbox-container {
        padding: 40px 20px;
    }
    
    .lightbox-close,
    .lightbox-fullscreen {
        width: 40px;
        height: 40px;
        font-size: 20px;
        top: 10px;
    }
    
    .lightbox-close {
        right: 10px;
    }
    
    .lightbox-fullscreen {
        right: 60px;
    }
    
    .lightbox-nav {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    
    .lightbox-nav.prev {
        left: 10px;
    }
    
    .lightbox-nav.next {
        right: 10px;
    }
    
    .lightbox-controls {
        bottom: 20px;
        padding: 10px 16px;
        gap: 8px;
    }
    
    .lightbox-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .lightbox-counter {
        top: 10px;
        font-size: 14px;
        padding: 6px 16px;
    }
    
    .lightbox-thumbnails {
        bottom: 90px;
        max-width: 95%;
        padding: 8px;
    }
    
    .lightbox-thumb {
        width: 50px;
        height: 50px;
    }
    
    .lightbox-info {
        display: none;
    }
}

@media (max-width: 480px) {
    .lightbox-thumbnails {
        display: none;
    }
    
    .lightbox-controls {
        scale: 0.9;
    }
}

/* Fullscreen mode */
.lightbox:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
}

.lightbox:-moz-full-screen {
    width: 100vw;
    height: 100vh;
}

.lightbox:fullscreen {
    width: 100vw;
    height: 100vh;
}

/* Keyboard shortcuts hint */
.lightbox-shortcuts {
    position: absolute;
    top: 80px;
    left: 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 16px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: lightboxShortcutsFade 0.5s ease-out 2s forwards;
}

@keyframes lightboxShortcutsFade {
    to {
        opacity: 0;
        pointer-events: none;
    }
}

.lightbox-shortcuts kbd {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}
