/* ============================================
   OSU Simple Lightbox
   ============================================ */

/* Overlay */
.osu-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(4, 4, 12, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: zoom-out;
}

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

/* Image container */
.osu-lightbox-inner {
    position: relative;
    max-width: 92vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* The lightbox image */
.osu-lightbox-img {
    max-width: 92vw;
    max-height: 85vh;
    width: auto;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.7);
    transform: scale(0.92);
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s ease;
    cursor: default;
}

.osu-lightbox-overlay.is-active .osu-lightbox-img {
    transform: scale(1);
    opacity: 1;
}

/* Caption */
.osu-lightbox-caption {
    color: #9a9ab8;
    font-size: 0.85rem;
    font-style: italic;
    text-align: center;
    margin-top: 12px;
    padding: 0 20px;
    max-width: 600px;
    opacity: 0;
    transition: opacity 0.3s ease 0.15s;
}

.osu-lightbox-overlay.is-active .osu-lightbox-caption {
    opacity: 1;
}

/* Close button */
.osu-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 100001;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(10, 10, 20, 0.6);
    color: #d4d4e8;
    font-size: 20px;
    line-height: 38px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
    padding: 0;
    font-family: Arial, sans-serif;
}

.osu-lightbox-close:hover {
    border-color: #b8a0d8;
    color: #b8a0d8;
    background: rgba(10, 10, 20, 0.8);
}

/* Nav arrows */
.osu-lightbox-prev,
.osu-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100001;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    background: rgba(10, 10, 20, 0.5);
    color: #d4d4e8;
    font-size: 22px;
    line-height: 42px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
    padding: 0;
    font-family: Arial, sans-serif;
    user-select: none;
}

.osu-lightbox-prev { left: 16px; }
.osu-lightbox-next { right: 16px; }

.osu-lightbox-prev:hover,
.osu-lightbox-next:hover {
    border-color: #b8a0d8;
    color: #b8a0d8;
    background: rgba(10, 10, 20, 0.8);
}

/* Hide arrows when only 1 image */
.osu-lightbox-overlay[data-count="1"] .osu-lightbox-prev,
.osu-lightbox-overlay[data-count="1"] .osu-lightbox-next {
    display: none;
}

/* Loading spinner */
.osu-lightbox-overlay.is-loading .osu-lightbox-img {
    visibility: hidden;
}

.osu-lightbox-spinner {
    display: none;
    width: 36px;
    height: 36px;
    border: 3px solid rgba(184, 160, 216, 0.2);
    border-top-color: #b8a0d8;
    border-radius: 50%;
    animation: osu-spin 0.7s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -18px 0 0 -18px;
}

.osu-lightbox-overlay.is-loading .osu-lightbox-spinner {
    display: block;
}

@keyframes osu-spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .osu-lightbox-img {
        max-width: 96vw;
        max-height: 80vh;
    }

    .osu-lightbox-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 18px;
        line-height: 34px;
    }

    .osu-lightbox-prev,
    .osu-lightbox-next {
        width: 38px;
        height: 38px;
        font-size: 18px;
        line-height: 36px;
    }

    .osu-lightbox-prev { left: 8px; }
    .osu-lightbox-next { right: 8px; }

    .osu-lightbox-caption {
        font-size: 0.8rem;
    }
}
