/* ============================================
   EXAMFORGE WEB ENTRY — STYLES
   Fullscreen overlay + pre-fullscreen content hiding.
   Uses the same CSS variables as the app so it blends in.
   ============================================ */

/* ---------- HIDE APP CONTENT WHILE FULLSCREEN IS PENDING ---------- */

/*
   When web-entry.js sets this attribute on <html>, everything
   inside <body> except the fullscreen overlay is hidden. This
   prevents the user from seeing the app for a split second
   before the overlay renders.

   The overlay itself is always visible while active.
*/
html[data-fullscreen-pending="true"] body > *:not(#examforgeFullscreenOverlay, .splash-screen, .splash-quote) {
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Also prevent scrolling and overscroll flash */
html[data-fullscreen-pending="true"],
html[data-fullscreen-pending="true"] body {
    overflow: hidden !important;
    overscroll-behavior: none !important;
}

/* ---------- FULLSCREEN OVERLAY ---------- */

#examforgeFullscreenOverlay {
    position: fixed;
    inset: 0;
    z-index: 2147483647; /* max 32-bit int — above everything, ever */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #030303;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(244, 67, 54, 0.10) 0%, transparent 55%),
        radial-gradient(circle at 80% 70%, rgba(244, 67, 54, 0.06) 0%, transparent 55%);
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    color: #ffffff;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

#examforgeFullscreenOverlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ---------- CARD ---------- */

#examforgeFullscreenOverlay .ef-fs-card {
    width: 100%;
    max-width: 420px;
    text-align: center;
    padding: 8px 4px;
    transform: translateY(8px);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#examforgeFullscreenOverlay.active .ef-fs-card {
    transform: translateY(0);
}

/* ---------- ICON ---------- */

#examforgeFullscreenOverlay .ef-fs-icon {
    width: 84px;
    height: 84px;
    margin: 0 auto 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#examforgeFullscreenOverlay .ef-fs-icon::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    z-index: -1;
}

#examforgeFullscreenOverlay .ef-fs-icon .material-icons-round {
    font-size: 5rem;
    color: var(--primary-color);
}

/* ---------- TEXT ---------- */

#examforgeFullscreenOverlay .ef-fs-title {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 12px;
    color: #ffffff;
    letter-spacing: -0.01em;
}

#examforgeFullscreenOverlay .ef-fs-message {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #aaaaaa;
    margin: 0 0 32px;
    max-width: 340px;
    margin-left: auto;
    margin-right: auto;
}

/* ---------- BUTTON ---------- */

#examforgeFullscreenOverlay .ef-fs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    background: #f44336;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
}

#examforgeFullscreenOverlay .ef-fs-btn:hover {
    background: #e53935;
}

#examforgeFullscreenOverlay .ef-fs-btn:active {
    transform: scale(0.97);
}

#examforgeFullscreenOverlay .ef-fs-btn .material-icons-round {
    font-size: 28px;
}

/* ---------- HINT ---------- */

#examforgeFullscreenOverlay .ef-fs-hint {
    margin: 24px 0 0;
    font-size: 1rem;
    color: #717171;
    line-height: 1.5;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

#examforgeFullscreenOverlay .ef-fs-hint kbd {
    display: inline-block;
    padding: 1px 6px;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 1rem;
    background: #1a1a1a;
    border: 1px solid #333333;
    border-radius: 4px;
    color: #aaaaaa;
    line-height: 1.4;
}

/* ---------- ERROR ---------- */

#examforgeFullscreenOverlay .ef-fs-error {
    margin: 16px 0 0;
    font-size: 1rem;
    color: #f44336;
    line-height: 1.5;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

#examforgeFullscreenOverlay .ef-fs-error[hidden] {
    display: none;
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 400px) {
    #examforgeFullscreenOverlay {
        padding: 20px;
    }

    #examforgeFullscreenOverlay .ef-fs-icon {
        width: 72px;
        height: 72px;
    }

    #examforgeFullscreenOverlay .ef-fs-icon .material-icons-round {
        font-size: 4.2rem;
    }

    #examforgeFullscreenOverlay .ef-fs-title {
        font-size: 1.5rem;
    }

    #examforgeFullscreenOverlay .ef-fs-message {
        font-size: 1.2rem;
        margin-bottom: 24px;
    }

    #examforgeFullscreenOverlay .ef-fs-btn {
        padding: 12px 24px;
        font-size: 1.2rem;
    }
}

/* ---------- LANDSCAPE PHONE ---------- */

@media (max-height: 500px) and (orientation: landscape) {
    #examforgeFullscreenOverlay .ef-fs-card {
        max-width: 560px;
        display: flex;
        align-items: center;
        gap: 24px;
        text-align: left;
    }

    #examforgeFullscreenOverlay .ef-fs-icon {
        width: 64px;
        height: 64px;
        margin: 0;
        flex-shrink: 0;
    }

    #examforgeFullscreenOverlay .ef-fs-icon .material-icons-round {
        font-size: 3.5rem;
    }

    #examforgeFullscreenOverlay .ef-fs-card > div:not(.ef-fs-icon) {
        flex: 1;
    }

    #examforgeFullscreenOverlay .ef-fs-title {
        font-size: 1.45rem;
        margin-bottom: 6px;
    }

    #examforgeFullscreenOverlay .ef-fs-message {
        font-size: 1.1rem;
        margin-bottom: 16px;
        max-width: none;
    }

    #examforgeFullscreenOverlay .ef-fs-hint {
        margin-top: 12px;
        font-size: 1rem;
    }
}

/* ---------- LIGHT THEME ---------- */

@media (prefers-color-scheme: light) {
    #examforgeFullscreenOverlay {
        background: #ffffff;
        background-image:
            radial-gradient(circle at 20% 30%, rgba(211, 47, 47, 0.08) 0%, transparent 55%),
            radial-gradient(circle at 80% 70%, rgba(211, 47, 47, 0.05) 0%, transparent 55%);
        color: #030303;
    }

    #examforgeFullscreenOverlay .ef-fs-title {
        color: #030303;
    }

    #examforgeFullscreenOverlay .ef-fs-message {
        color: #606060;
    }

    #examforgeFullscreenOverlay .ef-fs-hint {
        color: #909090;
    }

    #examforgeFullscreenOverlay .ef-fs-hint kbd {
        background: #f1f1f1;
        border-color: #e0e0e0;
        color: #606060;
    }

    #examforgeFullscreenOverlay .ef-fs-btn {
        background: #d32f2f;
    }

    #examforgeFullscreenOverlay .ef-fs-btn:hover {
        background: #b71c1c;
    }
}