/**
 * Image Lightbox - Modal overlay for magnifying project images
 */

/* Lightbox overlay - matching sidebar search modal style */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    backdrop-filter: blur(0px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-out;
}

.image-lightbox.active {
    opacity: 1;
    visibility: visible;
    backdrop-filter: blur(8px);
}

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

/* Lightbox content container - matching sidebar search modal */
.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    background: #000;
    border-radius: 12px;
    border: 2px solid #27272a;
    box-shadow: 0 35px 60px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.3s ease-out;
}

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



/* Lightbox header - matching sidebar search modal */
.lightbox-header {
    background: #000;
    border-bottom: 1px solid #27272a;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 3.5rem;
}

.lightbox-header .mac-dots {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.lightbox-header .mac-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.lightbox-header .mac-dot.red {
    background-color: #ef4444;
}

.lightbox-header .mac-dot.yellow {
    background-color: #eab308;
}

.lightbox-header .mac-dot.green {
    background-color: #22c55e;
}

.lightbox-filename {
    margin-left: auto;
    color: #a1a1aa;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Lightbox image container */
.lightbox-image-container {
    position: relative;
    background: #000;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    flex: 1;
    max-height: calc(90vh - 4rem);
}

/* Lightbox slider wrapper for animations */
.lightbox-slider-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.lightbox-slide {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.lightbox-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 0;
    transition: opacity 0.3s ease;
}

/* Close button - matching slider button style */
.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(24, 24, 27, 0.7);
    border: 1px solid rgba(39, 39, 42, 1);
    border-radius: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.lightbox-close:hover {
    background: rgba(39, 39, 42, 0.7);
    transform: scale(1.05);
}

/* Navigation buttons - matching slider navigation style */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(24, 24, 27, 0.7);
    border: 1px solid rgba(39, 39, 42, 1);
    border-radius: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.lightbox-nav:hover {
    background: rgba(39, 39, 42, 0.7);
    transform: translateY(-50%) scale(1.05);
}

.lightbox-nav.prev {
    left: 1rem;
}

.lightbox-nav.next {
    right: 1rem;
}

/* Combined navigation buttons like in slider */
.lightbox-nav-combined {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    gap: 0;
    z-index: 10;
}

.lightbox-nav-combined .lightbox-nav {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    transform: none;
    border-radius: 0;
    width: 2.5rem;
    height: 2.5rem;
}

.lightbox-nav-combined .lightbox-nav:first-child {
    border-top-left-radius: 0.5rem;
    border-bottom-left-radius: 0.5rem;
    border-right: none;
}

.lightbox-nav-combined .lightbox-nav:last-child {
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
    border-left: none;
}

.lightbox-nav-combined .lightbox-nav:hover {
    transform: scale(1.05);
}

.lightbox-nav svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Hide navigation if only one image */
.lightbox-nav.hidden {
    display: none;
}

/* Lightbox counter - matching slider style */
.lightbox-counter {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    background: rgba(24, 24, 27, 0.7);
    border: 1px solid rgba(39, 39, 42, 1);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    z-index: 10;
    backdrop-filter: blur(4px);
}

/* Dot indicators - matching project slider */
.lightbox-dots {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.lightbox-dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.lightbox-dot.active {
    background: rgba(255, 255, 255, 0.8);
    width: 1rem;
    border-radius: 0.25rem;
}

.lightbox-dot:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* Responsive adjustments - matching sidebar search modal */
@media (max-width: 768px) {
    .image-lightbox {
        padding: 0.5rem;
    }
    
    .lightbox-content {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .lightbox-header {
        padding: 0.75rem;
        min-height: 3rem;
    }
    
    .lightbox-filename {
        font-size: 0.75rem;
    }
    
    .lightbox-close {
        width: 2rem;
        height: 2rem;
        top: 0.75rem;
        right: 0.75rem;
    }
    
    .lightbox-nav-combined {
        bottom: 0.75rem;
        right: 0.75rem;
    }
    
    .lightbox-nav-combined .lightbox-nav {
        width: 2rem;
        height: 2rem;
    }
    
    .lightbox-nav svg {
        width: 1rem;
        height: 1rem;
    }
    
    .lightbox-counter {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
        bottom: 0.75rem;
        left: 0.75rem;
    }
    
    .lightbox-dots {
        bottom: 0.75rem;
        gap: 0.375rem;
    }
    
    .lightbox-dot {
        width: 0.25rem;
        height: 0.25rem;
    }
    
    .lightbox-dot.active {
        width: 0.75rem;
    }
    
    .lightbox-image-container {
        aspect-ratio: 16/9;
        max-height: calc(95vh - 4rem);
    }
    
    .lightbox-content {
        max-width: 95vw;
        max-height: 95vh;
    }
}

/* Custom scrollbar styling - matching sidebar search modal */
.lightbox-image-container::-webkit-scrollbar {
    width: 8px;
}

.lightbox-image-container::-webkit-scrollbar-track {
    background: #18181b;
    border-radius: 4px;
}

.lightbox-image-container::-webkit-scrollbar-thumb {
    background: #3f3f46;
    border-radius: 4px;
    border: 1px solid #27272a;
}

.lightbox-image-container::-webkit-scrollbar-thumb:hover {
    background: #52525b;
}

.lightbox-image-container::-webkit-scrollbar-corner {
    background: #18181b;
}

.lightbox-image-container {
    scrollbar-width: thin;
    scrollbar-color: #3f3f46 #18181b;
}