/* Centered Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    /* Center contents perfectly */
    display: none;
    justify-content: center;
    align-items: center;
}

.lightbox.active,
.lightbox[style*="display: flex"] {
    display: flex !important;
}

/* Image container */
.lightbox-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 100vw;
    max-height: 100vh;
}

/* The main image */
.lightbox-image,
.lightbox-content {
    max-height: 80vh;
    max-width: 80vw;
    object-fit: contain;
    margin: 0 auto;
    display: block;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Caption text */
.lightbox-caption,
#lightbox-caption {
    color: white;
    font-size: 16px;
    text-align: center;
    position: absolute;
    bottom: 20px;
    width: 100%;
    padding: 10px 0;
}

/* Close button */
.lightbox .close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1002;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.lightbox .close:hover {
    opacity: 1;
    color: #f1c40f;
}

/* Navigation controls */
.lightbox-controls {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 30px;
    box-sizing: border-box;
    z-index: 1001;
}

/* Previous/Next buttons */
.prev-btn,
.next-btn {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 24px;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.prev-btn:hover,
.next-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
    color: #f1c40f;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .lightbox-image,
    .lightbox-content {
        max-width: 94vw;
        max-height: 70vh;
    }

    .lightbox-controls {
        padding: 0 10px;
    }

    .prev-btn,
    .next-btn {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .lightbox .close {
        top: 10px;
        right: 12px;
        font-size: 36px;
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .lightbox-caption,
    #lightbox-caption {
        bottom: 10px;
        font-size: 14px;
        padding: 8px 15px;
    }
}

@media (max-width: 480px) {
    .lightbox-image,
    .lightbox-content {
        max-width: 98vw;
        max-height: 65vh;
    }

    .prev-btn,
    .next-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
        margin: 0 4px;
    }

    .lightbox-controls {
        padding: 0 4px;
    }
}
