/**
 * ============================================
 * OPTIMUM ENTREPRISE - Fichier CSS Principal
 * ============================================
 * Ce fichier contient tous les styles partagés
 * entre les différentes pages du site.
 * ============================================
 */

/* ============================================
   1. VARIABLES CSS (Custom Properties)
   ============================================ */
:root {
    /* Couleurs de la marque */
    --brand-red: #5d1212;
    --brand-red-light: #8a1c1c;
    --brand-gold: #facc15;
    --brand-gold-dim: #ca8a04;
    --brand-dark: #050505;
    --brand-dark-alt: #0a0a0a;
    
    /* Couleurs Glass Effect */
    --glass-bg: rgba(20, 20, 20, 0.6);
    --glass-bg-light: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-light: rgba(255, 255, 255, 0.05);
    
    /* Couleurs de texte */
    --text-primary: #ffffff;
    --text-secondary: #e5e7eb;
    --text-muted: #9ca3af;
    --text-dark: #6b7280;
    
    /* 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;
    
    /* Bordures */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
    
    /* Ombres */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.36);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow-gold: 0 0 20px rgba(250, 204, 21, 0.3);
    --shadow-glow-red: 0 0 20px rgba(93, 18, 18, 0.3);
}

/* ============================================
   Accessibility helpers
   ============================================ */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--brand-gold);
    color: var(--brand-dark);
    padding: 0.5rem 1rem;
    z-index: 9999;
    border-radius: 0 0 6px 6px;
    transform: translateY(-4px);
    transition: transform 120ms ease;
}
.skip-link:focus {
    top: 0.5rem;
    transform: none;
}

/* Utility: screen-reader only */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Focus-visible for better keyboard accessibility */
:focus-visible {
    outline: 3px solid var(--brand-gold);
    outline-offset: 2px;
}

/* ============================================
   2. RESET & BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--brand-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Sélection de texte */
::selection {
    background-color: var(--brand-gold);
    color: var(--brand-dark);
}

/* ============================================
   3. SCROLLBAR PERSONNALISÉE
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0f0f0f;
}

::-webkit-scrollbar-thumb {
    background: var(--brand-red);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brand-gold);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--brand-red) #0f0f0f;
}

/* ============================================
   4. TYPOGRAPHIE
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

.font-display {
    font-family: 'Space Grotesk', sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-normal);
}

a:hover {
    color: var(--brand-gold);
}

/* ============================================
   5. GLASSMORPHISM
   ============================================ */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
}

.glass-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid var(--glass-border-light);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.glass-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: rgba(250, 204, 21, 0.3);
    box-shadow: var(--shadow-xl), 0 0 20px rgba(250, 204, 21, 0.1);
}

/* ============================================
   6. DÉGRADÉS DE TEXTE
   ============================================ */
.text-gradient {
    background: linear-gradient(135deg, var(--brand-gold) 0%, var(--text-primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-red {
    background: linear-gradient(135deg, #ff4d4d 0%, var(--brand-red) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============================================
   7. ANIMATIONS
   ============================================ */

/* Float Animation */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

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

.animate-pulse-slow {
    animation: pulse-slow 4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Typing Animation (Chatbot) */
@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.typing-dot {
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

/* Glitch Effect (404 page) */
@keyframes glitch {
    0%, 90%, 100% { transform: translate(0); }
    92% { transform: translate(-5px, 2px); }
    94% { transform: translate(5px, -2px); }
    96% { transform: translate(-3px, 1px); }
    98% { transform: translate(3px, -1px); }
}

.animate-glitch {
    animation: glitch 3s infinite;
}

/* ============================================
   8. EFFETS DE LUEUR (GLOW)
   ============================================ */
.glow-point {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(93,18,18,0.4) 0%, rgba(0,0,0,0) 70%);
    pointer-events: none;
    z-index: 0;
    filter: blur(40px);
}

/* Blobs de fond */
.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.25;
    transform: translate3d(0,0,0);
    z-index: 0;
    pointer-events: none;
}

/* ============================================
   9. CANVAS BACKGROUND
   ============================================ */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.6;
}

/* ============================================
   10. HEADER & NAVIGATION
   ============================================ */
#header,
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    transition: background-color var(--transition-normal), box-shadow var(--transition-normal);
}

#header.scrolled,
#navbar.scrolled {
    background-color: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Underline hover effect pour liens */
.nav-link-underline {
    position: relative;
}

.nav-link-underline::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--brand-gold);
    transition: width var(--transition-normal);
}

.nav-link-underline:hover::after {
    width: 100%;
}

/* ============================================
   11. BOUTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.875rem;
    transition: all var(--transition-normal);
    cursor: pointer;
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-red) 0%, #991b1b 100%);
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(93, 18, 18, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #991b1b 0%, var(--brand-red) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(93, 18, 18, 0.5);
}

.btn-gold {
    background-color: var(--brand-gold);
    color: var(--brand-dark);
    box-shadow: var(--shadow-glow-gold);
}

.btn-gold:hover {
    background-color: var(--text-primary);
    color: var(--brand-dark);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-outline-gold {
    background: transparent;
    border: 1px solid var(--brand-gold);
    color: var(--brand-gold);
}

.btn-outline-gold:hover {
    background: var(--brand-gold);
    color: var(--brand-dark);
}

/* ============================================
   12. FORMULAIRES
   ============================================ */
.form-input,
.text-input {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.form-input::placeholder,
.text-input::placeholder {
    color: #4b5563;
}

.form-input:focus,
.text-input:focus {
    outline: none;
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 1px var(--brand-gold);
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--brand-gold);
    margin-bottom: 0.5rem;
    margin-left: 0.5rem;
}

/* ============================================
   13. CHATBOT WIDGET
   ============================================ */
.chat-widget {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--brand-red);
    border-radius: 2px;
}

/* ============================================
   14. UTILITAIRES
   ============================================ */

/* Couleurs de texte */
.text-brand-gold { color: var(--brand-gold); }
.text-brand-red { color: var(--brand-red); }
.text-muted { color: var(--text-muted); }

/* Backgrounds */
.bg-brand-dark { background-color: var(--brand-dark); }
.bg-brand-red { background-color: var(--brand-red); }
.bg-brand-gold { background-color: var(--brand-gold); }

/* Bordures */
.border-gold { border-color: var(--brand-gold); }
.border-red { border-color: var(--brand-red); }

/* Ombres */
.shadow-glow-gold { box-shadow: var(--shadow-glow-gold); }
.shadow-glow-red { box-shadow: var(--shadow-glow-red); }

/* No Scrollbar (pour les éléments avec scroll horizontal) */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ============================================
   15. MEDIA QUERIES
   ============================================ */
@media (max-width: 768px) {
    .glass-card:hover {
        transform: none;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .reveal {
        opacity: 1;
        transform: none;
    }
}
