/* ============================================================
   VDS DESIGN SYSTEM - GLOBAL THEME MASTER FILE
   Proprietà di: Visual Design Studio (Giuseppe alias Pino)
   Specializzazione: Cybersecurity & Optimization
   ============================================================ */

:root {
    /* VDS Design Tokens - Base Colors */
    --vds-blue: #007AFF;
    --vds-green: #34C759;
    --vds-red: #FF3B30;
    
    /* Light Mode Palette */
    --bg-base: #F5F5F7;
    --bg-surface: #FFFFFF;
    --bg-navbar: rgba(255, 255, 255, 0.72);
    --bg-card: #FFFFFF;
    --bg-input: #F2F2F7;
    
    --label-primary: #1D1D1F;
    --label-secondary: rgba(60, 60, 67, 0.6);
    --label-tertiary: #86868b;
    
    --separator: rgba(0, 0, 0, 0.1);
    --shadow-vds: 0 10px 30px rgba(0,0,0,0.06);

    /* Layout & Geometry */
    --radius-vds: 18px;
    --radius-button: 12px;
    --spring-easing: cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Skeleton Animation */
    --sk-gradient: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
}

/* Sincronizzazione automatica con il sistema operativo */
@media (prefers-color-scheme: dark) {
    body:not(.light-theme) {
        --bg-base: #000000;
        --bg-surface: #121212;
        --bg-navbar: rgba(0, 0, 0, 0.85);
        --bg-card: #1C1C1E;
        --bg-input: #2C2C2E;
        --label-primary: #F5F5F7;
        --label-secondary: #A1A1A6;
        --label-tertiary: #6E6E73;
        --vds-blue: #0A84FF;
        --separator: rgba(255, 255, 255, 0.15);
        --shadow-vds: 0 10px 40px rgba(0,0,0,0.5);
        --sk-gradient: linear-gradient(90deg, #1C1C1E 25%, #2C2C2E 50%, #1C1C1E 75%);
    }
}

/* Override Manuale Dark Mode */
body.dark-theme {
    --bg-base: #000000;
    --bg-surface: #121212;
    --bg-navbar: rgba(0, 0, 0, 0.85);
    --bg-card: #1C1C1E;
    --bg-input: #2C2C2E;
    
    --label-primary: #F5F5F7;
    --label-secondary: #A1A1A6;
    --label-tertiary: #6E6E73;
    
    --vds-blue: #0A84FF;
    --separator: rgba(255, 255, 255, 0.15);
    --shadow-vds: 0 10px 40px rgba(0,0,0,0.5);
    --sk-gradient: linear-gradient(90deg, #1C1C1E 25%, #2C2C2E 50%, #1C1C1E 75%);
}

/* ============================================================
   BASE RESET & TYPOGRAPHY
   ============================================================ */

html {
    /* scroll-behavior: smooth; */
    scroll-behavior: auto !important;
    scroll-padding-top: 120px; /* Cruciale per la Navbar fissa */
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale;
}

body { 
    background-color: var(--bg-base); 
    color: var(--label-primary); 
    font-family: 'Inter', -apple-system, system-ui, sans-serif; 
    overflow-x: hidden;
    line-height: 1.47;
    transition: background-color 0.4s var(--spring-easing), color 0.4s var(--spring-easing);
}

#app-viewport { 
    min-height: 100vh; 
}

h1, h2, h3 { color: var(--label-primary); font-weight: 700; letter-spacing: -0.022em; }
p { color: var(--label-secondary); }

/* ============================================================
   GLOBAL COMPONENTS (FORMS, BUTTONS, SCROLLBAR)
   ============================================================ */

html,
body,
#app-viewport {
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
#app-viewport::-webkit-scrollbar {
    display: none;
}

input, textarea, select {
    background: var(--bg-input);
    color: var(--label-primary);
    border: 1px solid transparent;
    border-radius: var(--radius-button);
    padding: 12px 16px;
    font-size: 16px;
    transition: all 0.3s var(--spring-easing);
    font-family: inherit;
}

input:focus, textarea:focus {
    border-color: var(--vds-blue);
    background: var(--bg-surface);
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.vds-btn {
    background: var(--vds-blue);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-button);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.vds-btn:active { transform: scale(0.96); }

/* ============================================================
   ANIMATIONS & SKELETON
   ============================================================ */

.page-transition {
    animation: vds-fade-in 0.6s var(--spring-easing);
}

@keyframes vds-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.vds-skeleton-container { width: 100%; padding: 20px 0; }
.sk-hero, .sk-item {
    background: var(--sk-gradient);
    background-size: 200% 100%;
    animation: vds-shine 1.5s infinite linear;
    border-radius: var(--radius-vds);
}
.sk-hero { width: 90%; height: 400px; margin: 0 auto 40px auto; }
.sk-grid {
    width: 80%; margin: 0 auto;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px;
}
.sk-item { height: 250px; }

@keyframes vds-shine { 
    to { background-position: -200% 0; } 
}