/* Custom Lightbox with Thumbnails */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 10000;
    transition: color 0.2s;
}

.lightbox-close:hover {
    color: var(--primary-color, #c60018);
}

.lightbox-info {
    position: relative;
    color: white;
    z-index: 10000;
    text-align: center;
    direction: rtl;
    background: rgba(0,0,0,0.6);
    padding: 10px 30px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
}

.lightbox-info h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.info-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 5px;
}

.info-divider {
    opacity: 0.6;
}

#lightboxDate {
    font-size: 14px;
    opacity: 0.8;
}

.info-bottom {
    font-size: 14px;
    color: #eee;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 70vh;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.lightbox-counter-inner {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: bold;
    z-index: 10001;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.lightbox-img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 50px;
    cursor: pointer;
    background: rgba(0,0,0,0.5);
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: background 0.3s, transform 0.2s;
    user-select: none;
}

.lightbox-nav:hover {
    background: var(--primary-color, #c60018);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: -80px;
}

.lightbox-next {
    right: -80px;
}

@media(max-width: 768px) {
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    
    .info-top {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 5px !important;
    }
    
    .lightbox-info h3#lightboxAlbumName {
        font-size: 14px !important;
        white-space: nowrap !important;
    }
    
    #lightboxDate {
        font-size: 12px !important;
        white-space: nowrap !important;
    }
}

.lightbox-thumbnails {
    display: flex;
    gap: 10px;
    max-width: 90%;
    overflow-x: auto;
    padding: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) rgba(255,255,255,0.1);
}

.lightbox-thumbnails::-webkit-scrollbar {
    height: 8px;
}
.lightbox-thumbnails::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}
.lightbox-thumbnails::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.lightbox-thumb {
    width: 100px;
    height: 75px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s, transform 0.3s, border 0.2s;
    border: 2px solid transparent;
}

.lightbox-thumb:hover {
    opacity: 0.8;
    transform: translateY(-3px);
}

.lightbox-thumb.active {
    opacity: 1;
    border-color: var(--primary-color, #c60018);
    transform: scale(1.05);
}

.gallery-item {
    cursor: pointer;
}
