/*
 * Lightbox.css - Styles for the image lightbox
 * For Kelli Beaumont's fashion portfolio
 */

.lightbox {
    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: 1000;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
    backdrop-filter: blur(5px);
    cursor: zoom-out;
}

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

.lightbox-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    box-shadow: 0 5px 35px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    opacity: 0;
    transition:
        transform 0.4s ease,
        opacity 0.4s ease;
    position: relative;
    z-index: 2;
}

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

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    width: 50px;
    height: 50px;
    border: none;
    background: rgba(0, 0, 0, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition:
        transform 0.3s ease,
        background-color 0.3s ease,
        color 0.3s ease;
    border-radius: 50%;
    z-index: 10;
}

.lightbox-close {
    top: -60px;
    right: 0;
    font-size: 28px;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 44px;
    line-height: 0;
    padding: 0;
    overflow: hidden;
}

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

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

.lightbox-close:hover,
.lightbox-close:focus,
.lightbox-prev:hover,
.lightbox-prev:focus,
.lightbox-next:hover,
.lightbox-next:focus {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    outline: none;
}

.lightbox-prev span,
.lightbox-next span {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    height: 100%;
    width: 100%;
    margin-top: -11px;
}

.lightbox-prev.hidden,
.lightbox-next.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Prevent scrolling when lightbox is open */
body.lightbox-open {
    overflow: hidden;
    padding-right: 15px; /* Prevents content shift when scrollbar disappears */
}

/* Loading indicator */
.lightbox-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: lightbox-loading 0.8s infinite linear;
    z-index: 1;
    transition: opacity 0.3s ease;
}

.lightbox-loading.hidden {
    opacity: 0;
}

@keyframes lightbox-loading {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Add a subtle zoom effect to portfolio images to indicate they're clickable */
.image-item img {
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

.image-item img:hover,
.image-item img:focus {
    transform: scale(1.02);
    cursor: zoom-in;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .lightbox-container {
        max-width: 95%;
    }

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

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

    .lightbox-prev {
        left: 10px;
    }

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