/* ==========================================================================
   💻 JEREMOS 26.9 - CORE & DESIGN TOKENS (jeremos.css)
   Variables globales, layout de base, preload screen, scrollbars
   ========================================================================== */

/* --- MODULAR CSS IMPORTS --- */
@import url('jeremos-wm.css');
@import url('jeremos-admin.css');
@import url('jeremos-mob.css');
@import url('jeremos-oth.css');

/* ==========================================================================
   💻 JEREMOS 26.9 - WEB DESKTOP & ADMIN SYSTEM FOR INOVINFO PORTAL
   ========================================================================== */

:root {
    --win-bg-primary: #0c0f14;
    --win-surface: rgba(20, 26, 36, 0.82);
    --win-surface-solid: #151b24;
    --win-surface-hover: rgba(255, 255, 255, 0.1);
    --win-glass-border: rgba(255, 255, 255, 0.12);
    --win-glass-border-active: rgba(96, 165, 250, 0.5);
    --win-accent: #3b82f6;
    --win-accent-gradient: linear-gradient(135deg, #3b82f6, #8b5cf6);
    --win-accent-glow: rgba(59, 130, 246, 0.35);
    --win-text: #f8fafc;
    --win-text-muted: #94a3b8;
    --win-taskbar-height: 52px;
    --win-shadow-window: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 0 1px var(--win-glass-border);
    --win-shadow-active: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 0 1px var(--win-glass-border-active), 0 0 35px var(--win-accent-glow);
    --win-radius: 14px;
}

/* Base Display Rule for Dual Mode */
#win-desktop-container {
    display: none;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: 1000;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

/* Enable Desktop OS on screens >= 1440px */
@media (min-width: 1440px) {
    body {
        overflow: hidden;
    }
    #win-desktop-container {
        display: flex;
        flex-direction: column;
    }
    .container {
        display: none !important;
    }
}

/* Force OS mode class if toggled manually */
body.force-os-mode {
    overflow: hidden !important;
}
body.force-os-mode #win-desktop-container {
    display: flex !important;
    flex-direction: column !important;
}
body.force-os-mode .container {
    display: none !important;
}



/* ==========================================================================
   OS BOOT PRELOADER SCREEN (AUTHENTIQUE DEMARRAGE OS)
   ========================================================================== */
#win-boot-screen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: #06090e;
    background: radial-gradient(circle at 50% 45%, #0f172a 0%, #06090e 70%);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

#win-boot-screen.boot-finished {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: scale(1.04) !important;
    pointer-events: none !important;
}

.win-boot-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 48px;
    animation: winBootCenterIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes winBootCenterIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(16px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.win-boot-glass-container {
    position: static;
    transform: none;
}

.win-boot-spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60px;
}

.win-boot-spinner {
    position: relative;
    width: 48px;
    height: 48px;
}

.win-boot-spinner-track {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.04);
}

.win-boot-spinner-dot {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: rotate(225deg);
    animation: winBootSpinnerOrbit 4.2s infinite;
}

.win-boot-spinner-dot::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 10px #38bdf8, 0 0 20px rgba(56, 189, 248, 0.8);
}

.win-boot-spinner-dot:nth-child(1) { animation-delay: 160ms; }
.win-boot-spinner-dot:nth-child(2) { animation-delay: 320ms; }
.win-boot-spinner-dot:nth-child(3) { animation-delay: 480ms; }
.win-boot-spinner-dot:nth-child(4) { animation-delay: 640ms; }
.win-boot-spinner-dot:nth-child(5) { animation-delay: 800ms; }

@keyframes winBootSpinnerOrbit {
    0% {
        transform: rotate(225deg);
        opacity: 1;
        animation-timing-function: ease-out;
    }
    7% {
        transform: rotate(345deg);
        animation-timing-function: linear;
    }
    30% {
        transform: rotate(455deg);
        animation-timing-function: ease-in-out;
    }
    39% {
        transform: rotate(690deg);
        animation-timing-function: linear;
    }
    70% {
        transform: rotate(815deg);
        opacity: 1;
        animation-timing-function: ease-out;
    }
    75% {
        transform: rotate(945deg);
        animation-timing-function: ease-out;
    }
    76% {
        transform: rotate(945deg);
        opacity: 0;
    }
    100% {
        transform: rotate(945deg);
        opacity: 0;
    }
}

/* Cache tout le reste pendant le preload puis transition douce lors du boot achevé */
body:not(.boot-loaded) #win-desktop-container,
body:not(.boot-loaded) .container {
    opacity: 0;
    pointer-events: none;
}

body.boot-loaded #win-desktop-container,
body.boot-loaded .container {
    opacity: 1;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   MODERN SYSTEM SCROLLBARS (DARK & LIGHT ADAPTED)
   ========================================================================== */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    border: 1px solid transparent;
    background-clip: padding-box;
    transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.42);
    background-clip: padding-box;
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Light Theme Scrollbars */
body.theme-light *,
body.theme-light ::-webkit-scrollbar,
body.theme-light {
    scrollbar-color: rgba(15, 23, 42, 0.28) transparent;
}

body.theme-light ::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.22);
    border: 1px solid transparent;
    background-clip: padding-box;
}

body.theme-light ::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, 0.45);
    background-clip: padding-box;
}

