/* ============================================
   Simple Easy Lightbox
   ============================================ */

/* Hover effect for lightbox-eligible images */
a.sel-lightbox-hover {
    display: inline-block;
    cursor: pointer;
}

a.sel-lightbox-hover img {
    transition: transform 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease;
}

a.sel-lightbox-hover:hover img {
    transform: scale(1.03);
    filter: brightness(1.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

/* Overlay — background color + opacity set dynamically by JS */
.simple-easy-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: default;
}

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

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

.simple-easy-lightbox-inner > * {
    pointer-events: auto;
}

/* The lightbox image */
.simple-easy-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: pointer;
}

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

/* Caption */
.simple-easy-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;
}

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

/* Close button */
.simple-easy-lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    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;
}

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

/* Nav arrows */
.simple-easy-lightbox-prev,
.simple-easy-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;
}

.simple-easy-lightbox-prev { left: -54px; }
.simple-easy-lightbox-next { right: -54px; }

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

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

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

.simple-easy-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: simple-easy-spin 0.7s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -18px 0 0 -18px;
}

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

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

/* ============================================
   Light Theme Overrides
   ============================================ */

.sel-theme-light {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.sel-theme-light .simple-easy-lightbox-img {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.sel-theme-light .simple-easy-lightbox-caption {
    color: #444;
}

.sel-theme-light .simple-easy-lightbox-close {
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.85);
    color: #555;
}

.sel-theme-light .simple-easy-lightbox-close:hover {
    border-color: #999;
    color: #222;
    background: rgba(255, 255, 255, 0.95);
}

.sel-theme-light .simple-easy-lightbox-prev,
.sel-theme-light .simple-easy-lightbox-next {
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.85);
    color: #555;
}

.sel-theme-light .simple-easy-lightbox-prev:hover,
.sel-theme-light .simple-easy-lightbox-next:hover {
    border-color: #999;
    color: #222;
    background: rgba(255, 255, 255, 0.95);
}

.sel-theme-light .simple-easy-lightbox-spinner {
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: #888;
}

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

    .simple-easy-lightbox-close {
        top: -12px;
        right: -12px;
        width: 36px;
        height: 36px;
        font-size: 18px;
        line-height: 34px;
    }

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

    .simple-easy-lightbox-prev { left: -6px; }
    .simple-easy-lightbox-next { right: -6px; }

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