/* ==========================================================================
   Full-Screen HTML5 Canvas Viewer Modal (.biohb-vault-modal)
   BuddyBoss Native Light Aesthetic
   ========================================================================== */

.biohb-vault-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    background: rgba(18, 43, 70, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-family: inherit;
    color: #122b46;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    box-sizing: border-box;
    animation: biohbModalFadeIn 0.2s ease-out;
}

.biohb-vault-modal[hidden] {
    display: none !important;
}

.biohb-vault-modal__backdrop {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* Header Bar */
.biohb-vault-modal__header {
    position: relative;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #e7e9ec;
    box-shadow: 0 2px 10px rgba(18, 43, 70, 0.05);
    flex-shrink: 0;
    box-sizing: border-box;
}

.biohb-vault-modal__header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.biohb-vault-modal__lock-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    border-radius: 6px;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    color: #2563eb;
    flex-shrink: 0;
}

.biohb-vault-modal__title {
    margin: 0;
    font-size: 14.5px;
    font-weight: 600;
    color: #122b46;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.biohb-vault-modal__counter {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 6px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

/* Close Button — Clean, non-aggressive BuddyBoss icon button */
.biohb-vault-modal__close-btn,
button.biohb-vault-modal__close-btn {
    all: unset !important;
    position: relative !important;
    z-index: 100 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    border-radius: 6px !important;
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    color: #64748b !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease !important;
}

.biohb-vault-modal__close-btn:hover,
button.biohb-vault-modal__close-btn:hover {
    background: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
    color: #122b46 !important;
}

/* Body & Canvas Wrapper */
.biohb-vault-modal__body {
    position: relative;
    z-index: 5;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    overflow: hidden;
    touch-action: none;
    box-sizing: border-box;
}

.biohb-vault-modal__canvas-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.biohb-vault-canvas {
    display: block;
    cursor: grab;
    touch-action: none;
}

.biohb-vault-canvas:active {
    cursor: grabbing;
}

/* Side Carousel Arrow Buttons */
.biohb-vault-modal__nav-btn {
    all: unset;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid #dce2e8;
    color: #122b46;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    box-sizing: border-box;
    transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.biohb-vault-modal__nav-btn:hover {
    background: #ffffff;
    border-color: #2f7ef7;
    color: #2f7ef7;
    transform: translateY(-50%) scale(1.06);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.biohb-vault-modal__nav-btn--prev {
    left: 16px;
}

.biohb-vault-modal__nav-btn--next {
    right: 16px;
}

/* Spinner */
.biohb-vault-modal__spinner {
    position: absolute;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #475569;
    font-size: 13.5px;
    font-weight: 500;
}

.biohb-vault-spinner__ring {
    width: 34px;
    height: 34px;
    border: 2.5px solid #e2e8f0;
    border-top-color: #2f7ef7;
    border-radius: 50%;
    animation: biohbSpin 0.7s linear infinite;
}

.biohb-vault-spinner__ring--small {
    width: 16px;
    height: 16px;
    border-width: 2px;
    border-color: rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
}

/* Retry Box */
.biohb-vault-modal__retry-box {
    position: absolute;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.biohb-vault-retry-box__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 32px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 10px 25px -5px rgba(18, 43, 70, 0.12), 0 8px 10px -6px rgba(18, 43, 70, 0.08);
    text-align: center;
    max-width: 320px;
    animation: biohbModalFadeIn 0.2s ease-out;
}

.biohb-vault-retry-box__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    color: #2563eb;
}

.biohb-vault-retry-box__msg {
    margin: 0;
    font-size: 13.5px;
    font-weight: 500;
    color: #475569;
    line-height: 1.45;
}

.biohb-vault-retry-box__btn,
button.biohb-vault-retry-box__btn {
    all: unset;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 24px;
    border-radius: 8px;
    background: #2563eb;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.biohb-vault-retry-box__btn:hover,
button.biohb-vault-retry-box__btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.biohb-vault-retry-box__btn:active,
button.biohb-vault-retry-box__btn:active {
    transform: translateY(0);
}

.biohb-vault-retry-box__btn[disabled],
button.biohb-vault-retry-box__btn[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

@keyframes biohbSpin {
    to { transform: rotate(360deg); }
}

@keyframes biohbModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Footer Container (Thumbnail Strip & Toolbar) */
.biohb-vault-modal__footer {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-width: 90vw;
}

/* Bottom Thumbnail Strip Bar */
.biohb-vault-modal__thumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    max-width: 100%;
    overflow-x: auto;
    box-sizing: border-box;
}

.biohb-vault-thumb {
    width: 36px;
    height: 36px;
    border-radius: 5px;
    border: 2px solid transparent;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.65;
    transition: opacity 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    flex-shrink: 0;
    box-sizing: border-box;
}

.biohb-vault-thumb:hover {
    opacity: 0.95;
}

.biohb-vault-thumb.is-active {
    border-color: #2f7ef7;
    opacity: 1;
    transform: scale(1.05);
}

/* Bottom Floating Toolbar */
.biohb-vault-modal__toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
}

.biohb-vault-toolbar__btn {
    all: unset;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 5px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.biohb-vault-toolbar__btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #122b46;
}

.biohb-vault-toolbar__btn--label {
    min-width: 48px;
    cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .biohb-vault-modal__header {
        padding: 8px 12px;
    }
    .biohb-vault-modal__title {
        font-size: 13.5px;
    }
    .biohb-vault-modal__nav-btn {
        width: 34px;
        height: 34px;
    }
    .biohb-vault-modal__nav-btn--prev {
        left: 8px;
    }
    .biohb-vault-modal__nav-btn--next {
        right: 8px;
    }
    .biohb-vault-modal__footer {
        bottom: 12px;
    }
}