/* 
    Pregati.re - Global Design System 
    Consolidated from head.php for performance and caching.
*/

:root {
    --primary: #00808a;
    --on-primary: #ffffff;
    --secondary: #c29100;
    --on-secondary: #ffffff;
    --background: #fffef7;
    --surface: #fdfbf0;
    --on-surface: #1e293b;
    --on-surface-variant: #64748b;
    --surface-container-lowest: #ffffff;
    --surface-container-low: #fdf9e3;
    --surface-container: #fffef2;
    --surface-container-high: #fbf6d9;
    --surface-container-highest: #f5f0cd;
    --outline: #94a3b8;
}

.dark {
    --primary: #62f9ee;
    --on-primary: #003734;
    --secondary: #ffc72c;
    --on-secondary: #3f2e00;
    --background: #131319;
    --surface: #1f1f26;
    --on-surface: #e4e1ea;
    --on-surface-variant: #c9c5d0;
    --surface-container-lowest: #0f0f14;
    --surface-container-low: #1b1b21;
    --surface-container: #1f1f26;
    --surface-container-high: #292930;
    --surface-container-highest: #34343b;
    --outline: #938f99;
}

body {
    font-family: 'Manrope', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    background-color: var(--background);
    color: var(--on-surface);
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 200, 'GRAD' 0, 'opsz' 24;
    font-family: 'Material Symbols Outlined' !important;
    display: inline-block;
    line-height: 1;
    text-transform: none !important;
    letter-spacing: normal !important;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;
}

.glass-card {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(25, 25, 30, 0.15);
}

.dark .glass-card {
    background: rgba(25, 25, 30, 0.15);
}

html:not(.dark) .glass-card {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

.bg-checkers {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.01) 25%, transparent 25%, transparent 74%, rgba(255, 255, 255, 0.01) 75%, rgba(255, 255, 255, 0.01)),
        linear-gradient(45deg, rgba(255, 255, 255, 0.01) 25%, transparent 25%, transparent 74%, rgba(255, 255, 255, 0.01) 75%, rgba(255, 255, 255, 0.01));
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    pointer-events: none;
    z-index: 0;
}

.bg-cyber-grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(to right, rgba(98, 249, 238, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(98, 249, 238, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
    pointer-events: none;
    z-index: 0;
}

@keyframes grid-scroll {
    from { background-position: 0 0; }
    to { background-position: 0 50px; }
}

.animate-grid-scroll {
    animation: grid-scroll 10s linear infinite;
}

/* Premium Select Styling */
select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(255,255,255,0.4)'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.25rem center;
    background-size: 1rem;
    padding-right: 3.5rem !important;
    color-scheme: dark;
    cursor: pointer;
}

html:not(.dark) select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(0,0,0,0.4)'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    color-scheme: light;
}

select option {
    background-color: #1a1a21;
    color: #fff;
    padding: 1rem;
}

html:not(.dark) select option {
    background-color: #fff;
    color: #000;
}

/* Accessibility Overrides */
.acc-high-contrast {
    --primary: #ffff00 !important;
    --secondary: #ffc72c !important;
    --background: #000000 !important;
    --surface: #000000 !important;
    --on-background: #ffff00 !important;
    --on-surface: #ffff00 !important;
    --outline: #ffff00 !important;
}

.acc-high-contrast body {
    background-color: #000 !important;
    color: #ff0 !important;
}

.acc-high-contrast .glass-card,
.acc-high-contrast section {
    background: #000 !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    border: none !important;
}

.acc-high-contrast nav,
.acc-high-contrast footer {
    background: #000 !important;
    border: none !important;
}

.acc-dyslexic,
.acc-dyslexic *:not(.material-symbols-outlined) {
    font-family: 'OpenDyslexic', sans-serif !important;
}

.acc-reduced-motion *,
.acc-reduced-motion {
    animation: none !important;
    transition: none !important;
}

.font-size-lg { font-size: 110%; }
.font-size-xl { font-size: 125%; }

/* Mobile Stability Fixes */
@media (max-width: 768px) {
    *, *::before, *::after { box-sizing: border-box !important; }
    html, body {
        overflow-x: hidden !important;
        width: 100vw !important;
        position: relative;
        margin: 0;
        padding: 0;
    }
    main { width: 100% !important; overflow-x: hidden !important; }
    .max-w-7xl {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        width: 100% !important;
        overflow: hidden !important;
    }
    .glass-card { border-radius: 1.25rem !important; }
    h1, h2, h3, h4, p, span, a {
        overflow-wrap: break-word !important;
        word-wrap: break-word !important;
        word-break: break-word !important;
    }
    [onclick^="switchTab"] {
        font-size: 10px !important;
        letter-spacing: 0.1em !important;
    }
}
