/* =============================================================================
   CURIO - Design System Tokens (Source unique de vérité)
   ============================================================================= */

:root {
    /* =========================================================================
       COULEURS PRIMAIRES
       ========================================================================= */

    /* Bleu principal - utilisé pour actions, liens, sidebar */
    --color-primary: #4A90D9;
    --color-primary-light: #93c5fd;
    --color-primary-dark: #1e40af;
    --color-primary-rgb: 74, 144, 217;

    /* Pourpre - accent, sidebar gradient */
    --color-accent: #8B5CF6;
    --color-accent-light: #C4B5FD;
    --color-accent-dark: #7C3AED;
    --color-accent-rgb: 139, 92, 246;

    /* Rose/Magenta - sidebar gradient middle */
    --color-secondary: #C84B8A;
    --color-secondary-light: #F472B6;
    --color-secondary-dark: #9D174D;
    --color-secondary-rgb: 200, 75, 138;

    /* =========================================================================
       COULEURS SÉMANTIQUES
       ========================================================================= */

    /* Succès - Mathématiques */
    --color-success: #22C55E;
    --color-success-light: rgba(34, 197, 94, 0.15);
    --color-success-dark: #16A34A;

    /* Danger - Français */
    --color-danger: #EF4444;
    --color-danger-light: rgba(239, 68, 68, 0.15);
    --color-danger-dark: #DC2626;

    /* Warning */
    --color-warning: #F97316;
    --color-warning-light: rgba(249, 115, 22, 0.15);
    --color-warning-dark: #EA580C;

    /* Info */
    --color-info: #06B6D4;
    --color-info-light: rgba(6, 182, 212, 0.15);
    --color-info-dark: #0891B2;

    /* =========================================================================
       COULEURS PAR MATIÈRE
       ========================================================================= */

    --color-french: var(--color-danger);
    --color-french-light: var(--color-danger-light);

    --color-math: var(--color-success);
    --color-math-light: var(--color-success-light);

    --color-grammar: #9333EA;
    --color-grammar-light: rgba(147, 51, 234, 0.15);

    --color-comprehension: var(--color-warning);
    --color-comprehension-light: var(--color-warning-light);

    --color-writing: #14B8A6;
    --color-writing-light: rgba(20, 184, 166, 0.15);

    /* =========================================================================
       COULEURS NEUTRES
       ========================================================================= */

    --color-text-primary: #1F2937;
    --color-text-secondary: #4B5563;
    --color-text-muted: #6B7280;
    --color-text-light: #9CA3AF;
    --color-text-white: #FFFFFF;

    --color-bg-primary: #FDF8F3;
    --color-bg-secondary: #FFFFFF;
    --color-bg-tertiary: #F9FAFB;
    --color-bg-muted: #F3F4F6;

    --color-border: #E5E7EB;
    --color-border-light: #F3F4F6;
    --color-border-dark: #D1D5DB;

    /* =========================================================================
       GRADIENTS
       ========================================================================= */

    --gradient-sidebar: linear-gradient(180deg, var(--color-primary) 0%, var(--color-secondary) 50%, var(--color-accent) 100%);
    --gradient-primary: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    --gradient-accent: linear-gradient(135deg, var(--color-accent) 0%, var(--color-secondary) 100%);

    /* Background effet cahier Seyes - opacité réduite pour cohérence avec landing */
    --bg-seyes:
        repeating-linear-gradient(to bottom, transparent, transparent 31px, rgba(150, 180, 210, 0.25) 31px, rgba(150, 180, 210, 0.25) 32px),
        repeating-linear-gradient(to bottom, transparent, transparent 7px, rgba(150, 180, 210, 0.12) 7px, rgba(150, 180, 210, 0.12) 8px),
        repeating-linear-gradient(to right, transparent, transparent 31px, rgba(150, 180, 210, 0.18) 31px, rgba(150, 180, 210, 0.18) 32px);

    /* =========================================================================
       TYPOGRAPHIE
       ========================================================================= */

    --font-primary: 'Sniglet', sans-serif;
    --font-cursive: 'Sniglet', cursive;

    --font-size-xs: 0.75rem;     /* 12px */
    --font-size-sm: 0.875rem;    /* 14px */
    --font-size-base: 1rem;      /* 16px */
    --font-size-lg: 1.125rem;    /* 18px */
    --font-size-xl: 1.25rem;     /* 20px */
    --font-size-2xl: 1.5rem;     /* 24px */
    --font-size-3xl: 1.875rem;   /* 30px */
    --font-size-4xl: 2.25rem;    /* 36px */

    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;

    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;

    /* =========================================================================
       ESPACEMENTS
       ========================================================================= */

    --spacing-0: 0;
    --spacing-1: 0.25rem;   /* 4px */
    --spacing-2: 0.5rem;    /* 8px */
    --spacing-3: 0.75rem;   /* 12px */
    --spacing-4: 1rem;      /* 16px */
    --spacing-5: 1.25rem;   /* 20px */
    --spacing-6: 1.5rem;    /* 24px */
    --spacing-8: 2rem;      /* 32px */
    --spacing-10: 2.5rem;   /* 40px */
    --spacing-12: 3rem;     /* 48px */
    --spacing-16: 4rem;     /* 64px */

    /* Aliases pour compatibilité */
    --spacing-xs: var(--spacing-1);
    --spacing-sm: var(--spacing-2);
    --spacing-md: var(--spacing-4);
    --spacing-lg: var(--spacing-6);
    --spacing-xl: var(--spacing-8);
    --spacing-2xl: var(--spacing-12);

    /* =========================================================================
       BORDER RADIUS (3 valeurs seulement)
       ========================================================================= */

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* =========================================================================
       OMBRES
       ========================================================================= */

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-elevated: 0 8px 30px rgba(0, 0, 0, 0.12);

    /* =========================================================================
       TRANSITIONS
       ========================================================================= */

    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    --transition-slower: 500ms ease;

    --easing-default: ease;
    --easing-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --easing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* =========================================================================
       Z-INDEX
       ========================================================================= */

    --z-dropdown: 100;
    --z-sticky: 150;
    --z-sidebar: 200;
    --z-modal-backdrop: 300;
    --z-modal: 400;
    --z-popover: 500;
    --z-tooltip: 600;

    /* =========================================================================
       LAYOUT
       ========================================================================= */

    --sidebar-width-collapsed: 115px;
    --sidebar-width-expanded: 280px;
    --navbar-height: 80px;
    --content-max-width: 1200px;

    /* =========================================================================
       BREAKPOINTS (pour référence JS)
       ========================================================================= */

    --breakpoint-sm: 480px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1280px;
}

/* =============================================================================
   GLOBAL SNIGLET FONT FIX
   Sniglet font appears "puffy/bold" without explicit font-weight: 400
   ============================================================================= */

* {
    font-weight: 400;
}

h1, h2, h3, h4, h5, h6, strong, b, th {
    font-weight: 400;
}

/* =============================================================================
   ANIMATIONS KEYFRAMES
   ============================================================================= */

/* Fade in */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Slide in from bottom */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide in from top */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scale in */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pulse attention */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Spin loader */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Bounce subtle */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Shake error */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* =============================================================================
   CLASSES D'ANIMATION UTILITAIRES
   ============================================================================= */

.animate-fade-in {
    animation: fadeIn var(--transition-base) ease forwards;
}

.animate-slide-up {
    animation: slideInUp var(--transition-slow) ease forwards;
}

.animate-slide-down {
    animation: slideInDown var(--transition-slow) ease forwards;
}

.animate-scale-in {
    animation: scaleIn var(--transition-base) ease forwards;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-bounce {
    animation: bounce 1s ease-in-out infinite;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

/* Hover animations pour les cartes */
.hover-lift {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Hover animation pour les boutons */
.hover-scale {
    transition: transform var(--transition-fast);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* =============================================================================
   MEDIA QUERY: Préférence mouvement réduit
   ============================================================================= */

@media (prefers-reduced-motion: reduce) {
    :root {
        --transition-fast: 0ms;
        --transition-base: 0ms;
        --transition-slow: 0ms;
        --transition-slower: 0ms;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =============================================================================
   CLASSES UTILITAIRES D'ACCESSIBILITÉ
   ============================================================================= */

/* Screen reader only - caché visuellement mais accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible pour accessibilité clavier */
.focus-visible:focus,
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: var(--color-text-white);
    padding: var(--spacing-2) var(--spacing-4);
    border-radius: var(--radius-md);
    z-index: var(--z-tooltip);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: var(--spacing-2);
}
