/* ==========================================================================
   PT Suite - Design Tokens (Fitness Tech Theme)
   ========================================================================== */

:root,
[data-theme="dark"] {
    /* Superfici */
    --bg-primary: #0F172A;
    --bg-primary-soft: #131C31;
    --bg-surface: #1E293B;
    --bg-surface-hover: #243247;
    --bg-elevated: #2A3A52;
    --bg-inset: #16203A;
    --border-color: #334155;
    --border-strong: #46556B;
    --header-bg: rgb(15 23 42 / 88%);
    --tabbar-bg: rgb(15 23 42 / 96%);
    --overlay-bg: rgb(2 6 23 / 65%);
    --glow-a: rgb(16 185 129 / 8%);
    --glow-b: rgb(6 182 212 / 7%);
    --grid-stripe: rgb(22 32 58 / 35%);
    --grid-weekend: rgb(22 32 58 / 45%);
    --off-a: rgb(15 23 42 / 72%);
    --off-b: rgb(30 41 59 / 72%);
    --color-scheme: dark;

    /* Colori funzionali */
    --accent-primary: #10B981;
    --accent-primary-dark: #059669;
    --accent-volt: #84CC16;
    --accent-domicilio: #F97316;
    --accent-palestra: #06B6D4;
    --accent-danger: #EF4444;
    --accent-warning: #F59E0B;
    --accent-info: #6366F1;

    /* Tinte trasparenti per badge e superfici tenui */
    --tint-primary: rgb(16 185 129 / 14%);
    --tint-volt: rgb(132 204 22 / 14%);
    --tint-domicilio: rgb(249 115 22 / 14%);
    --tint-palestra: rgb(6 182 212 / 14%);
    --tint-danger: rgb(239 68 68 / 14%);
    --tint-warning: rgb(245 158 11 / 14%);

    /* Testo */
    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    --text-inverse: #0F172A;

    /* Tipografia */
    --font-title: 'Outfit', 'Segoe UI', system-ui, sans-serif;
    --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono: ui-monospace, 'SFMono-Regular', 'JetBrains Mono', monospace;

    --fs-xs: 0.75rem;
    --fs-sm: 0.8125rem;
    --fs-base: 0.9375rem;
    --fs-md: 1.0625rem;
    --fs-lg: 1.25rem;
    --fs-xl: 1.5rem;
    --fs-2xl: 2rem;
    --fs-3xl: 2.5rem;

    /* Spaziature */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;

    /* Raggi e ombre */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 999px;

    --shadow-sm: 0 1px 2px rgb(2 6 23 / 40%);
    --shadow-md: 0 6px 16px rgb(2 6 23 / 45%);
    --shadow-lg: 0 18px 40px rgb(2 6 23 / 55%);
    --shadow-glow: 0 0 0 3px rgb(16 185 129 / 25%);

    /* Animazioni */
    --transition-fast: 120ms ease;
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 380ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --sidebar-width: 248px;
    --sidebar-width-collapsed: 72px;
    --header-height: 64px;
    --tabbar-height: 64px;
    --content-max: 1440px;
    --z-header: 50;
    --z-sidebar: 60;
    --z-tabbar: 70;
    --z-overlay: 80;
    --z-modal: 90;
    --z-toast: 100;
}

[data-theme="light"] {
    --bg-primary: #F1F5F9;
    --bg-primary-soft: #E8EEF5;
    --bg-surface: #FFFFFF;
    --bg-surface-hover: #F8FAFC;
    --bg-elevated: #FFFFFF;
    --bg-inset: #E2E8F0;
    --border-color: #CBD5E1;
    --border-strong: #94A3B8;
    --header-bg: rgb(241 245 249 / 92%);
    --tabbar-bg: rgb(255 255 255 / 96%);
    --overlay-bg: rgb(15 23 42 / 40%);
    --glow-a: rgb(16 185 129 / 10%);
    --glow-b: rgb(6 182 212 / 8%);
    --grid-stripe: rgb(226 232 240 / 55%);
    --grid-weekend: rgb(241 245 249 / 80%);
    --off-a: rgb(226 232 240 / 75%);
    --off-b: rgb(203 213 225 / 75%);
    --color-scheme: light;
    --accent-primary: #059669;
    --accent-primary-dark: #047857;
    --accent-volt: #65A30D;
    --text-primary: #0F172A;
    --text-secondary: #334155;
    --text-muted: #64748B;
    --text-inverse: #F8FAFC;
    --shadow-sm: 0 1px 2px rgb(15 23 42 / 8%);
    --shadow-md: 0 6px 16px rgb(15 23 42 / 10%);
    --shadow-lg: 0 18px 40px rgb(15 23 42 / 12%);
    --shadow-glow: 0 0 0 3px rgb(5 150 105 / 22%);
    --tint-primary: rgb(5 150 105 / 12%);
    --tint-volt: rgb(101 163 13 / 12%);
}

[data-theme="ocean"] {
    --bg-primary: #0B1F2A;
    --bg-primary-soft: #0E2836;
    --bg-surface: #123040;
    --bg-surface-hover: #173A4C;
    --bg-elevated: #1A4458;
    --bg-inset: #0D2633;
    --border-color: #245066;
    --border-strong: #2E6580;
    --header-bg: rgb(11 31 42 / 90%);
    --tabbar-bg: rgb(11 31 42 / 96%);
    --overlay-bg: rgb(4 14 20 / 65%);
    --glow-a: rgb(6 182 212 / 12%);
    --glow-b: rgb(14 165 233 / 8%);
    --grid-stripe: rgb(18 48 64 / 40%);
    --grid-weekend: rgb(18 48 64 / 55%);
    --off-a: rgb(11 31 42 / 72%);
    --off-b: rgb(18 48 64 / 72%);
    --color-scheme: dark;
    --accent-primary: #22D3EE;
    --accent-primary-dark: #06B6D4;
    --accent-volt: #38BDF8;
    --text-primary: #ECFEFF;
    --text-secondary: #BAE6FD;
    --text-muted: #7DD3FC;
    --text-inverse: #082F3A;
    --shadow-glow: 0 0 0 3px rgb(34 211 238 / 25%);
    --tint-primary: rgb(34 211 238 / 16%);
    --tint-volt: rgb(56 189 248 / 14%);
}

[data-theme="sunset"] {
    --bg-primary: #1C1410;
    --bg-primary-soft: #241A14;
    --bg-surface: #2A1E18;
    --bg-surface-hover: #33241C;
    --bg-elevated: #3D2A20;
    --bg-inset: #1A120E;
    --border-color: #5C3D2E;
    --border-strong: #7A4E38;
    --header-bg: rgb(28 20 16 / 90%);
    --tabbar-bg: rgb(28 20 16 / 96%);
    --overlay-bg: rgb(12 8 6 / 65%);
    --glow-a: rgb(249 115 22 / 12%);
    --glow-b: rgb(239 68 68 / 8%);
    --grid-stripe: rgb(42 30 24 / 40%);
    --grid-weekend: rgb(42 30 24 / 55%);
    --off-a: rgb(28 20 16 / 72%);
    --off-b: rgb(61 42 32 / 72%);
    --color-scheme: dark;
    --accent-primary: #F97316;
    --accent-primary-dark: #EA580C;
    --accent-volt: #FBBF24;
    --accent-domicilio: #FB7185;
    --text-primary: #FFF7ED;
    --text-secondary: #FED7AA;
    --text-muted: #FDBA74;
    --text-inverse: #1C1410;
    --shadow-glow: 0 0 0 3px rgb(249 115 22 / 28%);
    --tint-primary: rgb(249 115 22 / 16%);
    --tint-volt: rgb(251 191 36 / 14%);
}

[data-theme="forest"] {
    --bg-primary: #0F1A14;
    --bg-primary-soft: #142118;
    --bg-surface: #1A2A20;
    --bg-surface-hover: #213428;
    --bg-elevated: #2A4032;
    --bg-inset: #121C16;
    --border-color: #2F4A38;
    --border-strong: #3D6148;
    --header-bg: rgb(15 26 20 / 90%);
    --tabbar-bg: rgb(15 26 20 / 96%);
    --overlay-bg: rgb(6 12 8 / 65%);
    --glow-a: rgb(132 204 22 / 12%);
    --glow-b: rgb(16 185 129 / 8%);
    --grid-stripe: rgb(26 42 32 / 40%);
    --grid-weekend: rgb(26 42 32 / 55%);
    --off-a: rgb(15 26 20 / 72%);
    --off-b: rgb(42 64 50 / 72%);
    --color-scheme: dark;
    --accent-primary: #84CC16;
    --accent-primary-dark: #65A30D;
    --accent-volt: #A3E635;
    --text-primary: #F7FEE7;
    --text-secondary: #D9F99D;
    --text-muted: #A3E635;
    --text-inverse: #14532D;
    --shadow-glow: 0 0 0 3px rgb(132 204 22 / 28%);
    --tint-primary: rgb(132 204 22 / 16%);
    --tint-volt: rgb(163 230 53 / 14%);
}

/* Rispetta le preferenze di accessibilità sul movimento */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
