/* ====================================================================
   YOUDJIB - MAIN STYLESHEET (SAUDI EDITION)
   VERSION : 1.0
   DESCRIPTION : Variables, Reset, Typographie, Navbar, Boutons.
====================================================================
*/

/* =================================================================
   1. CONFIGURATION & VARIABLES (ROOT)
================================================================= */
:root {
    /* --- PALETTE YOUDJIB (SAUDI THEME) --- */
    
    /* Couleur Primaire : Vert Émeraude "Saudi Vision" */
    --primary-50:  #f0fdf4;
    --primary-100: #dcfce7;
    --primary-200: #bbf7d0;
    --primary-300: #86efac;
    --primary-400: #4ade80;
    --primary-500: #006C35; /* VERT SAOUDIEN OFFICIEL */
    --primary-600: #16a34a;
    --primary-700: #15803d;
    --primary-800: #166534;
    
    /* Accent : Or / Sable (Luxe) */
    --accent-gold: #C5A059; 
    
    /* Neutres */
    --slate-50:  #f9fafb;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #111827; /* Presque noir */
    --slate-950: #020617;

    /* Couleurs Sémantiques */
    --success-light: #dcfce7;
    --success-main:  #10b981;
    --success-dark:  #047857;

    --warning-light: #fef3c7;
    --warning-main:  #f59e0b;
    --warning-dark:  #b45309;

    --danger-light:  #fee2e2;
    --danger-main:   #ef4444;
    --danger-dark:   #b91c1c;

    --info-light:    #e0f2fe;
    --info-main:     #0ea5e9;
    
    /* Accents Spécifiques */
    --accent-purple: #8b5cf6;
    --accent-orange: #f97316;

    /* -----------------------------------------------------------
       SURFACES & TEXTES
    ----------------------------------------------------------- */
    --bg-body: #ffffff;
    --bg-surface: #ffffff;
    --bg-surface-alt: var(--slate-50);
    --bg-header: rgba(255, 255, 255, 0.85);
    --bg-footer: var(--slate-900);

    --text-main: var(--slate-900);
    --text-secondary: #4b5563;
    --text-muted: var(--slate-400);
    --text-inverse: #ffffff;

    /* -----------------------------------------------------------
       BORDURES & RAYONS
    ----------------------------------------------------------- */
    --border-light: var(--slate-200);
    --border-medium: var(--slate-300);

    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 32px;
    --radius-full: 9999px;

    /* -----------------------------------------------------------
       OMBRES (SHADOWS)
    ----------------------------------------------------------- */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    --shadow-blue-glow: 0 0 40px rgba(0, 108, 53, 0.15); /* Glow vert saoudien */

    /* -----------------------------------------------------------
       TYPOGRAPHIE
    ----------------------------------------------------------- */
    --font-sans: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    
    /* -----------------------------------------------------------
       ANIMATIONS & TRANSITIONS
    ----------------------------------------------------------- */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    
    /* -----------------------------------------------------------
       GRADIENTS
    ----------------------------------------------------------- */
    --gradient-primary: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    --gradient-shimmer: linear-gradient(45deg, var(--primary-500), var(--accent-gold), var(--primary-500));
}

/* =================================================================
   2. RESET CSS & BASE (MODERNE & RTL SUPPORT)
================================================================= */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    
    /* AJOUTS RTL IMPORTANTS */
    direction: rtl;
    text-align: right;
}

/* STABILISATION MOBILE CRITIQUE */
html, body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
    margin: 0;
    padding-bottom: 0;
    position: relative;
}

main {
    padding-top: 80px;
}

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

ul, ol { list-style: none; padding: 0; margin: 0; }
img, svg { max-width: 100%; height: auto; display: block; }

button, input, textarea, select {
    font-family: inherit; font-size: inherit; color: inherit;
    border: none; background: none; outline: none;
}
button { cursor: pointer; }

/* =================================================================
   3. UTILITAIRES DE MISE EN PAGE & TYPO
================================================================= */

.container {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
    position: relative;
}

.section-padding {
    padding-top: 100px;
    padding-bottom: 100px;
}

.bg-light { background-color: var(--bg-surface-alt); }
.bg-white { background-color: var(--bg-surface); }

h1, h2, h3, h4, h5, h6 {
    color: var(--text-main);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.01em; /* Ajusté pour l'arabe */
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.25rem; }

p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.75;
    max-width: 65ch;
}

/* Utilitaires Texte */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-shimmer {
    background: var(--gradient-shimmer);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
    display: inline-block;
}
@keyframes shimmer { 0% { background-position: 200% center; } 100% { background-position: -200% center; } }

.section-header {
    text-align: center;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 80px;
    position: relative;
}
.section-header h2 { margin-bottom: 20px; }
.section-header p { margin-left: auto; margin-right: auto; }

/* =================================================================
   4. COMPOSANTS UI : BOUTONS & BADGES
================================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    border: 1px solid transparent;
}

/* Correction Icônes RTL pour les boutons */
.btn i {
    margin-left: 0;
    margin-right: 8px; /* Inverse pour l'arabe */
}

.btn-primary {
    background-color: var(--primary-500);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 108, 53, 0.25);
}
.btn-primary:hover {
    background-color: var(--primary-600);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 108, 53, 0.3);
}
.btn-primary-arrow::after {
    content: '←'; /* Flèche inversée pour RTL */
    display: inline-block;
    transition: transform 0.3s ease;
    margin-right: 6px;
    margin-left: 0;
}
.btn-primary-arrow:hover::after {
    transform: translateX(-5px); /* Mouvement vers la gauche */
}

.btn-secondary {
    background-color: #ffffff;
    color: var(--text-main);
    border-color: var(--border-light);
    box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
    border-color: var(--primary-500);
    color: var(--primary-500);
    background-color: var(--primary-50);
    transform: translateY(-1px);
}

.btn-ghost {
    background-color: transparent;
    color: var(--text-secondary);
    box-shadow: none;
}
.btn-ghost:hover {
    background-color: var(--slate-100);
    color: var(--primary-500);
}

.full-width { width: 100%; }

/* Badges */
.badge-feature {
    display: inline-block;
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--primary-600);
    background-color: var(--primary-50);
    padding: 8px 16px;
    border-radius: 100px;
    margin-bottom: 20px;
}

/* =================================================================
   5. NAVBAR (NAVIGATION) - C'est cette partie qu'il vous manquait
================================================================= */
.navbar-wrapper {
    position: fixed;
    top: 0; left: 0; width: 100%;
    z-index: 9999;
    background-color: rgba(255, 255, 255, 0.85); 
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

/* Logo */
.logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800; 
    color: var(--text-main);
    letter-spacing: -0.02em;
    line-height: 1;
}

.logo-text .highlight {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--accent-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
    margin-right: 2px; /* RTL fix */
}

.logo:hover .logo-image-wrapper {
    transform: scale(1); /* Juste un petit zoom, sans tourner */
    box-shadow: none;
}

.logo-image-wrapper {
    width: 140px;  /* Beaucoup plus grand */
    height: 140px;
    min-width: 140px;
    /* On enlève le fond blanc, l'ombre et les bords */
    border-radius: 0;
    overflow: visible;
    display: flex; align-items: center; justify-content: center;
    box-shadow: none; 
    background: transparent;
    transition: transform 0.3s ease;
}

.main-logo-icon {
    width: 100%; height: 100%; object-fit: contain; display: block;
}

/* Menu Principal */
.nav-menu { display: flex; align-items: center; }
.nav-links { display: flex; gap: 8px; } 

.nav-links a {
    color: var(--text-secondary);
    font-weight: 700; font-size: 1rem; /* Un peu plus grand pour l'arabe */
    position: relative; 
    padding: 8px 16px;
    border-radius: 50px;
    transition: all 0.2s ease;
}

.nav-links a:hover { 
    color: var(--primary-600);
    background-color: var(--primary-50);
    transform: translateY(-1px);
}

/* Partie Droite (Boutons Desktop) */
.nav-right-desktop { display: flex; align-items: center; gap: 16px; }
.nav-buttons-mobile { display: none; }
.menu-toggle { display: none; }

/* =================================================================
   CORRECTIF RTL : SÉQUENCEUR NEURONAL (CERVEAU)
   Pour remettre les câbles dans le bon sens (Droite -> Gauche)
================================================================= */

/* 1. On inverse l'espace de la colonne de droite (Modules) */
.ns-column.end {
    padding-left: 0 !important;   /* On enlève la marge gauche (ancienne LTR) */
    padding-right: 80px !important; /* On ajoute la marge à droite pour les câbles venant du cerveau */
}

/* 2. On retourne les câbles SVG et on les colle au cerveau */
.ns-svg-paths {
    left: auto !important;        /* On détache de la gauche */
    right: -80px !important;      /* On colle à droite (vers le cerveau) */
    transform: scaleX(-1);        /* EFFET MIROIR : On inverse la courbure des lignes */
}

/* 3. On ajuste la position des bulles de résultat (Les étiquettes vertes) */
/* Elles doivent apparaître à GAUCHE du module, pas à droite (sur le câble) */
.ns-result-pop {
    right: auto !important;
    left: 10px !important;
}

/* Quand le module est actif, l'étiquette sort vers la GAUCHE */
.ns-module.active .ns-result-pop {
    right: auto !important;
    left: -20px !important; /* Sort vers l'extérieur (gauche) */
}

/* 4. Ajustement de la ligne droite (Utilisateur -> Cerveau) */
.ns-connector-straight {
    z-index: 0;
    margin: 0 -2px; /* Petit ajustement pour éviter les trous */
}