/* ================================
   PSM Lightbox - Pro UI (1200x800)
   ================================ */

.psm-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.psm-lightbox-overlay.active {
    display: flex;
}

/* کانتینر اصلی لایت‌باکس: دقیقاً 1200×800 */
.psm-lightbox-content {
    position: relative;
    width: 1200px;
    height: 800px;

    /* برای نمایش در صفحه‌های کوچک‌تر: خودکار کوچک شود */
    max-width: calc(100vw - 80px);
    max-height: calc(100vh - 80px);

    background: transparent;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;

    /* subtle entrance */
    transform: translateY(6px) scale(0.99);
    opacity: 0;
    transition: transform .25s ease, opacity .25s ease;
}

.psm-lightbox-overlay.active .psm-lightbox-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* خود عکس */
.psm-lightbox-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;

    user-select: none;
    -webkit-user-drag: none;

    background: transparent;

    /* crisp / premium */
    filter: drop-shadow(0 18px 45px rgba(0, 0, 0, 0.35));
    border-radius: 14px;
}

/* ================================
   Buttons - shared pro style
   ================================ */

.psm-lightbox-close,
.psm-lightbox-nav,
.psm-lightbox-toolbar button {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.10);
    color: #fff;

    border-radius: 14px;
    height: 42px;
    min-width: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease, opacity .18s ease;
    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);

    /* prevent selection */
    user-select: none;
}

/* hover */
.psm-lightbox-close:hover,
.psm-lightbox-nav:hover,
.psm-lightbox-toolbar button:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.26);
    transform: translateY(-1px);
    box-shadow:
        0 14px 30px rgba(0, 0, 0, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

/* active */
.psm-lightbox-close:active,
.psm-lightbox-nav:active,
.psm-lightbox-toolbar button:active {
    transform: translateY(0px) scale(0.98);
    background: rgba(255, 255, 255, 0.14);
}

/* focus (keyboard) */
.psm-lightbox-close:focus-visible,
.psm-lightbox-nav:focus-visible,
.psm-lightbox-toolbar button:focus-visible {
    outline: none;
    border-color: rgba(255, 255, 255, 0.45);
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.20),
        0 14px 30px rgba(0, 0, 0, 0.30);
}

/* disabled nav state if you add .is-disabled */
.psm-lightbox-nav.is-disabled {
    opacity: 0.35;
    pointer-events: none;
    transform: none;
    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ================================
   Toolbar (Zoom/Reset) - above image
   ================================ */

.psm-lightbox-toolbar {
    position: absolute;
    top: -54px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    z-index: 4;
    pointer-events: auto;
}

/* make toolbar buttons a bit “iconic” */
.psm-lightbox-toolbar button {
    gap: 8px;
    padding: 0 14px;
    min-width: 46px;
    border-radius: 999px;
    letter-spacing: 0.2px;
    font-size: 13px;
    font-weight: 600;
}

/* optional: if your toolbar buttons have icons (svg/i) */
.psm-lightbox-toolbar button svg,
.psm-lightbox-toolbar button i {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ================================
   Close button - top right
   ================================ */

.psm-lightbox-close {
    position: absolute;
    top: -56px;
    right: 0;
    z-index: 5;

    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 22px;
    line-height: 1;
}

/* make close feel “danger-ish” on hover */
.psm-lightbox-close:hover {
    background: rgba(239, 68, 68, 0.22);
    border-color: rgba(239, 68, 68, 0.35);
}

/* ================================
   Navigation arrows
   ================================ */

.psm-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;

    width: 52px;
    height: 52px;
    border-radius: 16px;
    font-size: 30px;
    line-height: 1;
}

.psm-lightbox-prev {
    left: -62px;
}

.psm-lightbox-next {
    right: -62px;
}

/* RTL fix for lightbox navigation placement */
.rtl .psm-lightbox-prev,
[dir="rtl"] .psm-lightbox-prev {
    right: -62px;
    left: auto;
}

.rtl .psm-lightbox-next,
[dir="rtl"] .psm-lightbox-next {
    left: -62px;
    right: auto;
}

/* nice glow when hovering arrows */
.psm-lightbox-nav:hover {
    box-shadow:
        0 16px 34px rgba(0, 0, 0, 0.40),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

/* ================================
   Counter
   ================================ */

.psm-lightbox-counter {
    position: absolute;
    bottom: -40px;
    left: 0;
    right: 0;

    text-align: center;
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;
    z-index: 4;

    /* chip */
    width: fit-content;
    margin: 0 auto;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* ================================
   Mobile refinements
   ================================ */

@media (max-width: 768px) {
    .psm-lightbox-content {
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
    }

    .psm-lightbox-prev {
        left: -48px;
    }

    .psm-lightbox-next {
        right: -48px;
    }

    .rtl .psm-lightbox-prev,
    [dir="rtl"] .psm-lightbox-prev {
        right: -48px;
        left: auto;
    }

    .rtl .psm-lightbox-next,
    [dir="rtl"] .psm-lightbox-next {
        left: -48px;
        right: auto;
    }

    .psm-lightbox-toolbar {
        top: -50px;
    }

    .psm-lightbox-close {
        top: -54px;
    }

    .psm-lightbox-nav {
        width: 46px;
        height: 46px;
        font-size: 28px;
        border-radius: 14px;
    }
}

/* very small screens: keep controls reachable */
@media (max-width: 480px) {
    .psm-lightbox-prev {
        left: -40px;
    }

    .psm-lightbox-next {
        right: -40px;
    }

    .rtl .psm-lightbox-prev,
    [dir="rtl"] .psm-lightbox-prev {
        right: -40px;
        left: auto;
    }

    .rtl .psm-lightbox-next,
    [dir="rtl"] .psm-lightbox-next {
        left: -40px;
        right: auto;
    }

    .psm-lightbox-toolbar {
        gap: 8px;
        top: -46px;
    }

    .psm-lightbox-toolbar button {
        height: 40px;
        padding: 0 12px;
        font-size: 12px;
    }

    .psm-lightbox-close {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }

    .psm-lightbox-counter {
        bottom: -36px;
        padding: 7px 11px;
        font-size: 12px;
    }
}

/* reduce motion */
@media (prefers-reduced-motion: reduce) {

    .psm-lightbox-content,
    .psm-lightbox-close,
    .psm-lightbox-nav,
    .psm-lightbox-toolbar button {
        transition: none !important;
    }
}
