/* ===================================
   VARIABLES ET THÈME KLEIN COSMIQUE
   =================================== */

:root {
    /* Couleurs Klein Cosmique - Palette Maîtres */
    --klein-blue: #002FA7;
    --klein-light: #5A8BFF;
    --klein-dark: #001f6f;
    --cosmic-purple: #7B1FA2;
    --cosmic-pink: #FF4081;
    --cosmic-gold: #FFD700;
    
    /* Couleurs de base */
    --color-bg: #ffffff;
    --color-surface: #f8f9fa;
    --color-text: #1A1110;
    --color-text-secondary: #34495E;
    --color-border: #e2e8f0;
    
    /* Couleurs thématiques */
    --color-primary: var(--klein-blue);
    --color-secondary: var(--cosmic-purple);
    --color-accent: var(--cosmic-pink);
    --color-warning: var(--cosmic-gold);
    
    /* Palette enrichie - Accents vibrants */
    --orange-fauve: #FF6B35;
    --rouge-passion: #E74C3C;
    --jaune-soleil: #FFD700;
    --vert-mediterrane: #50C878;
    --violet-intense: #7B1FA2;
    --rose-vibrant: #FF4081;
    --ikb-celeste: #1E88E5;
    --ikb-mid: #0047C8;
    
    /* Tons sombres */
    --noir-profond: #1A1110;
    --indigo-sombre: #2E1A47;
    --gris-ardoise: #34495E;
    
    /* Typographie */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Courier New', monospace;
    
    /* Espacements */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    
    /* Tailles de texte */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    
    /* Line heights */
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.75;
    --leading-loose: 2;
    
    /* Border radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --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);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Container */
    --container-max-width: 1200px;
}

/* Mode sombre */
[data-theme="dark"] {
    --color-bg: rgba(26, 17, 16, 0.95);
    --color-surface: rgba(26, 17, 16, 0.7);
    --color-text: #F8F9FB;
    --color-text-secondary: rgba(248, 249, 251, 0.85);
    --color-border: rgba(255, 255, 255, 0.1);
    
    --klein-blue: #0047C8;
    --klein-light: #5A8BFF;
    --cosmic-purple: #7B1FA2;
    --cosmic-pink: #FF4081;
}

/* ===================================
   RESET ET BASE
   =================================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: var(--color-text);
    background-color: var(--color-bg);
    transition: background-color var(--transition-base), color var(--transition-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

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

.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.main-content {
    min-height: calc(100vh - 200px);
}

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

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: var(--leading-tight);
    margin-bottom: var(--spacing-md);
    color: var(--color-text);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
    margin-bottom: var(--spacing-md);
    color: var(--color-text-secondary);
}

.section-title {
    font-size: var(--text-3xl);
    margin-bottom: var(--spacing-xl);
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    margin: var(--spacing-md) auto 0;
    border-radius: var(--radius-full);
}

/* ===================================
   BOUTONS
   =================================== */

.btn {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all var(--transition-base);
    cursor: pointer;
    text-align: center;
    border: 2px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--orange-fauve), var(--rouge-passion));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn-secondary:hover {
    background-color: var(--color-bg);
    border-color: var(--color-primary);
}

/* ===================================
   LIENS
   =================================== */

.link {
    color: var(--color-primary);
    position: relative;
    transition: color var(--transition-base);
}

.link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width var(--transition-base);
}

.link:hover {
    color: var(--klein-light);
}

.link:hover::after {
    width: 100%;
}

.link.active {
    color: var(--color-primary);
    font-weight: 600;
}

/* ===================================
   FORMULAIRES
   =================================== */

input[type="text"],
input[type="email"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: var(--color-bg);
    color: var(--color-text);
    transition: all var(--transition-base);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 47, 167, 0.1);
}

/* ===================================
   UTILITAIRES
   =================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.hidden { display: none; }
.visible { display: block; }

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

.slide-up {
    animation: slideUp var(--transition-slow);
}
