/**
 * ParthaOS Portal - Full-Viewport Isolation
 *
 * Aggressively forces the headless SPA to consume the entire screen,
 * overriding any core WordPress injected offsets, toolbars, or margins.
 *
 * @package    ParthaOS_Portal
 * @author     Prem Jagtap
 */

/* 
 * ==========================================================================
 * 1. ROOT VIEWPORT RESET
 * ==========================================================================
 */
html {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    height: 100%;
}

[v-cloak] {
    display: none !important;
}

body.parthaos-headless-theme,
body.pr-portal-shell {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    overflow: hidden;
    position: relative;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
}

/* 
 * ==========================================================================
 * 2. WP ADMIN BAR ANNIHILATION
 * ==========================================================================
 * Acts as a CSS fallback in case a third-party plugin overrides our 
 * show_admin_bar(false) filter in functions.php.
 */
html.wp-toolbar {
    padding-top: 0 !important;
}

#wpadminbar {
    display: none !important;
    height: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

body.admin-bar {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* 
 * ==========================================================================
 * 3. SPA MOUNT POINT ISOLATION
 * ==========================================================================
 */
#app,
#pr-client-app,
#pr-admin-app,
.parthaos-portal-root {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    margin: 0 !important;
    padding: 0 !important;
    isolation: isolate;
    overflow: hidden;
}

.pr-portal-root.is-login {
    height: auto;
    min-height: 100dvh;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.pr-portal-root:not(.is-login) .pr-app-stage {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pr-portal-root:not(.is-login) .pr-app-stage-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
}

.login-screen {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 32px;
}

.login-form {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}

.portal-shell-minimal {
    min-height: 100vh;
    padding: 16px;
}

.portal-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    margin-bottom: 16px;
    border-radius: 12px;
}

.portal-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.tab-btn {
    background: var(--slate-800, #1e293b);
    color: var(--slate-300, #cbd5e1);
    border: 1px solid var(--slate-700, #334155);
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
}

.tab-btn.active {
    background: var(--brand-blue, #3b82f6);
    color: #fff;
    border-color: transparent;
}

.panel-section {
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 16px;
}