/**
 * SESSIONVAULT - MODALS & OVERLAYS CSS
 * --------------------------------------------------------
 * TABLE OF CONTENTS:
 * --------------------------------------------------------
 * 1. Global Modal Overlay & Cards
 * 2. Toast Notifications
 * 3. Full-Screen Gates (Login, Passkey, Onboarding)
 * ========================================================
 */

/* ======================================================== */
/* 1. GLOBAL MODAL OVERLAY & CARDS                          */
/* ======================================================== */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.custom-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* FIX: Z-INDEX OVERRIDE FOR GLOBAL CONFIRMS (Forces them over the Edit Modal) */
#custom-alert-modal,
#custom-confirm-modal,
#custom-prompt-modal {
    z-index: 11000 !important;
}

.custom-modal-card {
    background: #ffffff;
    border-radius: 12px;
    max-width: 440px;
    width: 90%;
    padding: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.custom-modal-overlay.active .custom-modal-card {
    transform: scale(1);
}

/* ======================================================== */
/* 2. TOAST NOTIFICATIONS                                   */
/* ======================================================== */
.app-toast {
    position: fixed;
    bottom: 30px;
    /* Physical positioning kept intentionally for perfect centering */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 11000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.app-toast.visible {
    opacity: 1;
}

/* ======================================================== */
/* 3. FULL-SCREEN GATES (Login, Passkey, Onboarding)        */
/* ======================================================== */
.onboarding-card {
    background: #ffffff;
    border-radius: 16px;
    max-width: 440px;
    width: 100%;
    padding: 40px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#passkey-lock-overlay,
#login-gate-overlay {
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    width: 100vw;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
}

#passkey-lock-overlay {
    background: var(--sidebar-bg);
    z-index: 1005;
}

#login-gate-overlay {
    background: var(--sidebar-bg);
    z-index: 1001;
}

#onboarding-overlay {
    position: fixed;
    inset: 0;
    display: none;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    z-index: 9999;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 40px 16px !important;
}

#onboarding-overlay .onboarding-card {
    max-width: 650px !important;
    width: 100% !important;
    display: block !important;
    margin: 0 auto 150px auto !important;
    height: auto !important;
    max-height: none !important;
}

#onboarding-overlay .onboarding-card h2,
#onboarding-overlay .onboarding-card p {
    text-align: center;
}