/* Image Lightbox Styles */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    /* Increased z-index to ensure it appears above all other elements */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    will-change: opacity, visibility;
    /* Optimize for animations */
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-container {
    position: absolute;
    width: 90%;
    max-width: 1200px;
    height: 90%;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    background-color: transparent;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.lightbox-header {
    display: flex;
    justify-content: flex-end;
    padding: 10px;
}

.lightbox-content {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.lightbox-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center;
    transition: transform 0.3s ease;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.lightbox-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 30px;
    z-index: 10;
}

.lightbox-btn {
    background-color: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

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

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: #f97316;
    /* Màu cam */
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, transform 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(249, 115, 22, 0.3);
}

.lightbox-close:hover {
    background-color: #e86207;
    /* Màu cam đậm hơn khi hover */
    transform: rotate(90deg);
}

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

.lightbox-nav:hover {
    background-color: rgba(249, 115, 22, 0.8);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Zoom level indicator */
.zoom-level {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9rem;
    z-index: 10;
}

/* Animation for lightbox opening */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-image-container.active {
    animation: zoomIn 0.3s ease forwards;
}

/* Mobile styles */
@media (max-width: 768px) {
    .lightbox-container {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        position: fixed;
        /* Use fixed instead of absolute on mobile */
        top: 0;
        left: 0;
        transform: none;
        /* Remove transform on mobile */
    }

    .lightbox-content {
        width: 100%;
        height: 100%;
        padding: 10px;
    }

    .lightbox-controls {
        bottom: 80px;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .lightbox-prev {
        left: 10px;
    }

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