/* Lightbox Styles */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    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-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Wrapper for the shine effect */
.lightbox-image-wrapper {
    position: relative;
    display: inline-block;
    /* Fits the image size */
    overflow: hidden;
    /* Contains the shine */
    border-radius: 4px;
    /* Matches image radius */
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    display: block;
    /* Removes bottom space */
    /* Removed individual box-shadow and transform from here to wrapper could be better, 
       but for simplicity I kept basic properties. Animation is on wrapper/overlay now. */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active .lightbox-image {
    opacity: 1;
}

/* Shine Effect */
.lightbox-image-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    transition: none;
    /* Reset transition for instantaneous reset */
    pointer-events: none;
    /* Click pass-through */
    z-index: 2;
}

.lightbox-image-wrapper:hover::after {
    left: 100%;
    transition: left 0.7s ease;
    /* Smooth glide */
}

/* Controls */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    color: white;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.2s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.lightbox-close {
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    font-size: 24px;
    z-index: 10001;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    font-size: 20px;
    z-index: 10000;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Mobile adjustments */
@media (max-width: 768px) {

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        background: rgba(0, 0, 0, 0.3);
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-close {
        top: 15px;
        right: 15px;
        background: rgba(0, 0, 0, 0.3);
    }
}