﻿/* ============================
   TRADEGURU.TECH - CSS GLOBAL 
   Menu Sidebar Accordéon + Header
   ============================ */

/* IMPORT GOOGLE FONTS MODERNES */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@300;400;500;600;700&display=swap');

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

/* === VARIABLES CSS === */
:root {
    --header-height: 70px;
    --sidebar-width: 300px;
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4338ca;
    --primary-rgb: 99, 102, 241;
    --secondary-color: #00d4ff;
    --secondary-rgb: 0, 212, 255;
    --accent-color: #ffd700;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --dark-bg: #1a1a2e;
    --darker-bg: #16213e;
    --darkest-bg: #0f0f23;
    --text-light: #ffffff;
    --text-gray: #94a3b8;
    --text-dark: #1e293b;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --border-light: rgba(99, 102, 241, 0.15);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 25px rgba(120, 89, 197, 0.25), 0 0 50px rgba(60, 137, 198, 0.15);
    --shadow-xl: 0 12px 35px rgba(99, 102, 241, 0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    --blur: blur(10px);
    --blur-strong: blur(15px);
}

/* === FONTES MODERNES PAR LANGUE === */
/* Fonte par défaut - Inter moderne */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    line-height: 1.6;
    padding-top: var(--header-height);
}

/* Fonte spécialisée pour l'hébreu - SANS affecter les icônes */
html[lang="he"] body,
html[lang="he"] p,
html[lang="he"] span:not(.fa):not([class*="fa-"]):not(.fas):not(.far):not(.fab),
html[lang="he"] div:not(.fa):not([class*="fa-"]),
html[lang="he"] a:not(.fa):not([class*="fa-"]),
html[lang="he"] li:not(.fa):not([class*="fa-"]),
html[lang="he"] td,
html[lang="he"] th,
html[lang="he"] label,
html[lang="he"] button:not(.fa):not([class*="fa-"]) {
    font-family: 'Heebo', 'Arial Hebrew', sans-serif !important;
}

/* Fonte spécialisée pour l'arabe - SANS affecter les icônes */
html[lang="ar"] body,
html[lang="ar"] p,
html[lang="ar"] span:not(.fa):not([class*="fa-"]):not(.fas):not(.far):not(.fab),
html[lang="ar"] div:not(.fa):not([class*="fa-"]),
html[lang="ar"] a:not(.fa):not([class*="fa-"]),
html[lang="ar"] li:not(.fa):not([class*="fa-"]),
html[lang="ar"] td,
html[lang="ar"] th,
html[lang="ar"] label,
html[lang="ar"] button:not(.fa):not([class*="fa-"]) {
    font-family: 'Noto Sans Arabic', 'Arabic UI Text', 'Tahoma', sans-serif !important;
}

/* Titres avec fonte plus élégante */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 600;
    line-height: 1.3;
}

html[lang="he"] h1, html[lang="he"] h2, html[lang="he"] h3, 
html[lang="he"] h4, html[lang="he"] h5, html[lang="he"] h6 {
    font-family: 'Heebo', 'Arial Hebrew', sans-serif !important;
    font-weight: 600;
}

html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, 
html[lang="ar"] h4, html[lang="ar"] h5, html[lang="ar"] h6 {
    font-family: 'Noto Sans Arabic', 'Arabic UI Text', 'Tahoma', sans-serif !important;
    font-weight: 600;
}

/* PROTECTION DES ICÔNES FONTAWESOME */
.fa, .fas, .far, .fab, .fal, .fad,
[class*="fa-"],
i[class*="fa"],
.faq-icon,
.category-title i,
.lang-btn i,
.sidebar-toggle i {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", FontAwesome !important;
    font-weight: 900 !important;
}

/* === HEADER PRINCIPAL === */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(22, 33, 62, 0.95) 100%);
    backdrop-filter: var(--blur-strong);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

/* Header en mode light avec dégradé bleu drapeau d'Israël */
body.light-mode .top-header {
    background: linear-gradient(135deg, #0038b8 0%, #4a90e2 100%) !important;
    border-bottom: 1px solid rgba(0, 56, 184, 0.3) !important;
}

.header-container {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* === BOUTON SIDEBAR TOGGLE === */
.sidebar-toggle {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 12px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    backdrop-filter: var(--blur);
}

.sidebar-toggle:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* === LOGO CENTRAL === */
.logo-section {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 12px;
    padding: 8px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    backdrop-filter: var(--blur);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.logo:hover {
    transform: translateX(-50%) scale(1.05);
    box-shadow: var(--shadow-lg);
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: logoGlow 3s ease-in-out infinite alternate;
    letter-spacing: -0.5px;
}

@keyframes logoGlow {
    from { 
        filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.4)); 
        transform: scale(1);
    }
    to { 
        filter: drop-shadow(0 0 16px rgba(99, 102, 241, 0.7)); 
        transform: scale(1.02);
    }
}

/* === ACTIONS HEADER === */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* === SÉLECTEUR LANGUE === */
.language-selector {
    position: relative;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-light);
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px; /* Fonte plus petite et élégante */
    font-weight: 500; /* Un peu plus épais */
    min-width: 60px;
    height: 41px;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; /* Fonte moderne */
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px 0;
    min-width: 150px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1001;
}

.lang-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-item {
    display: block;
    padding: 10px 16px;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
    font-size: 13px; /* Fonte plus petite */
    font-weight: 400; /* Fonte normale */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; /* Fonte moderne */
}

.lang-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
}

.lang-item.active {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
}

/* === STYLES SÉLECTEUR LANGUE MODE LIGHT === */
body.light-mode .language-selector {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

body.light-mode #lang-menu {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(0, 56, 184, 0.2) !important;
    box-shadow: 0 8px 24px rgba(0, 56, 184, 0.15) !important;
}

body.light-mode #lang-menu a {
    color: #0038b8 !important;
    font-weight: bold !important;
    background: rgba(255, 255, 255, 0.9) !important;
    margin: 2px 4px !important;
    border-radius: 6px !important;
    transition: all 0.3s ease !important;
    border: 1px solid rgba(0, 56, 184, 0.2) !important;
}

body.light-mode #lang-menu a:hover {
    background: rgba(0, 56, 184, 0.1) !important;
    color: #002d8f !important;
    transform: translateX(5px) !important;
}

/* Icône langue en blanc pour mode light */
body.light-mode #lang-toggle {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* Bouton langue et texte en blanc pour mode light */
body.light-mode .lang-btn {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 12px 16px !important;
    font-size: 16px !important;
    min-width: 60px !important;
    height: 41px !important;
    border-radius: 8px !important;
}

body.light-mode .lang-btn .lang-current {
    color: #ffffff !important;
    font-weight: bold !important;
}

body.light-mode .lang-btn i {
    color: #ffffff !important;
}

/* === BOUTONS CTA MODE LIGHT === */
body.light-mode .cta-primary,
body.light-mode .cta-primary .cta-text,
body.light-mode .cta-primary span {
    color: #ffffff !important; /* Texte blanc UNIQUEMENT pour "Commencer Gratuitement" */
}

/* === TOGGLE THÈME === */
.theme-toggle {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 12px;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: var(--blur);
}

.theme-toggle:hover {
    background: linear-gradient(135deg, var(--accent-color) 0%, #ffed4a 100%);
    color: var(--dark-bg);
    transform: rotate(180deg) scale(1.1);
    box-shadow: var(--shadow-lg);
}

/* === BOUTONS AUTH === */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-login, .btn-register {
    padding: 8px 12px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    backdrop-filter: var(--blur);
}

.btn-login {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-light);
}

.btn-login:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-register {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-register:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

/* === MENU USER === */
.user-menu {
    position: relative;
}

.user-btn {
    background: none;
    border: none;
    color: var(--text-light);
    padding: 4px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px 0;
    min-width: 180px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1001;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
}

.user-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
}

.user-item.logout {
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
    color: #ff6b6b;
}

/* === SIDEBAR MENU === */
.sidebar-menu {
    position: fixed;
    top: var(--header-height);
    left: -var(--sidebar-width);
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--dark-bg);
    border-right: 1px solid var(--border-color);
    z-index: 999;
    transition: left 0.3s ease;
    overflow-y: auto;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
    visibility: hidden;
}

.sidebar-menu.active {
    left: 0;
    visibility: visible;
}

/* === HEADER SIDEBAR === */
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6); /* Bleu au lieu de noir */
    position: relative;
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.sidebar-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-light);
    flex: 1;
}

.sidebar-close {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 20px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: var(--transition);
    margin-left: auto;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ff6b6b;
}

/* === CONTENU SIDEBAR === */
.sidebar-content {
    padding: 20px 0;
}

.menu-section {
    margin-bottom: 8px;
}

/* === ITEMS MENU === */
.menu-item {
    width: 100%;
    background: none;
    border: none;
    color: var(--text-light);
    padding: 16px 24px;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    text-decoration: none;
    position: relative;
}

.menu-item:hover {
    background: linear-gradient(90deg, #dc2626, #ef4444); /* Rouge vif pour plus de visibilité */
    color: white;
    padding-left: 28px;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.menu-item.single {
    border-left: 3px solid transparent;
}

.menu-item.single:hover {
    border-left-color: var(--primary-color);
}

.accordion-arrow {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.3s ease;
}

/* === SUBMENUS === */
.submenu, .sub-submenu {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe); /* Bleu clair au lieu de gris */
    border-left: 2px solid var(--primary-color);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

/* Sous-menus imbriqués (nested) */
.submenu.nested {
    background: linear-gradient(135deg, #c7d2fe, #a5b4fc); /* Bleu plus foncé pour niveau 2 */
    border-left: 2px solid #818cf8;
    margin-left: 20px;
}

/* Thème sombre pour sous-menus */
.dark-theme .submenu, 
.dark-theme .sub-submenu {
    background: linear-gradient(135deg, #1e3a8a, #1d4ed8); /* Bleu foncé en mode sombre */
}

.dark-theme .submenu.nested {
    background: linear-gradient(135deg, #1e293b, #334155); /* Encore plus foncé pour niveau 2 */
}

.dark-theme .submenu-item, 
.dark-theme .sub-item {
    color: #bfdbfe; /* Texte bleu clair en mode sombre */
}

.submenu.active {
    max-height: 800px;
    padding: 8px 0;
}

.sub-submenu.active {
    max-height: 400px;
    padding: 8px 0;
}

.submenu-item, .sub-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 40px;
    color: #1e40af; /* Couleur texte bleu foncé pour contraste */
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-weight: 500;
}

/* Items de sous-menus imbriqués (nested-item) */
.submenu-item.nested-item {
    padding: 10px 30px;
    padding-left: 50px;
    font-size: 13px;
    color: #1e3a8a;
}

.dark-theme .submenu-item.nested-item {
    color: #93c5fd;
}

.sub-item {
    padding-left: 60px;
    font-size: 13px;
}

.submenu-item:hover, .sub-item:hover {
    background: linear-gradient(90deg, #2563eb, #3b82f6); /* Bleu vif pour sous-menus */
    color: white;
    padding-left: 44px;
    transform: translateX(5px);
    border-left: 3px solid #fbbf24; /* Bordure jaune pour contraste */
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.sub-item:hover {
    padding-left: 64px;
}

/* === OVERLAY === */
.sidebar-overlay {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: transparent; /* Suppression du fond noir */
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    pointer-events: none; /* Désactiver les interactions */
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: none; /* Garder désactivé même quand actif */
}

/* === BODY AVEC SIDEBAR OUVERTE === */
body.sidebar-open {
    /* Le menu reste ouvert sans bloquer le scroll */
    position: relative;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
        --header-height: 65px;
    }
    
    .logo-text {
        display: none;
    }
    
    .header-container {
        padding: 0 15px;
        gap: 8px;
    }
    
    .sidebar-header {
        padding: 16px;
    }
    
    .menu-item {
        padding: 14px 20px;
        font-size: 14px;
    }
    
    .submenu-item {
        padding: 10px 36px;
        font-size: 13px;
    }
    
    .header-actions {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    :root {
        --sidebar-width: 260px;
        --header-height: 60px;
    }
    
    .header-container {
        padding: 0 12px;
    }
    
    .header-actions {
        gap: 6px;
    }
    
    .lang-btn, .theme-toggle, .btn-login, .btn-register {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .sidebar-toggle {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* === ÉTATS DE FOCUS ET ACCESSIBILITÉ === */
button:focus,
a:focus,
.menu-item:focus,
.submenu-item:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.sidebar-toggle:focus,
.theme-toggle:focus,
.btn-login:focus,
.btn-register:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

/* Mode réduit pour les animations */
@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;
    }
}

/* Amélioration du contraste */
@media (prefers-contrast: high) {
    :root {
        --border-color: rgba(255, 255, 255, 0.3);
        --border-light: rgba(99, 102, 241, 0.4);
    }
    
    .menu-item:hover,
    .submenu-item:hover {
        border-left: 4px solid var(--primary-color);
    }
}

/* === ANIMATIONS === */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(99, 102, 241, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.6), 0 0 30px rgba(99, 102, 241, 0.4);
    }
}

/* Animation d'entrée pour le contenu */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in-up {
    animation: slideInUp 0.8s ease-out;
}

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

.glow-animation {
    animation: glow 3s ease-in-out infinite;
}

/* === THÈME SOMBRE === */
.dark-theme {
    --dark-bg: #0f0f0f;
    --darker-bg: #1a1a1a;
    --border-color: rgba(255, 255, 255, 0.15);
}

.dark-theme .top-header {
    background: rgba(15, 15, 15, 0.95);
}

.dark-theme .sidebar-menu {
    background: var(--dark-bg);
}

.dark-theme .sidebar-header {
    background: var(--darker-bg);
}

/* === SCROLLBAR PERSONNALISÉE === */
/* Scrollbar pour la sidebar */
.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 3px;
    transition: var(--transition);
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
}

/* Scrollbar globale pour toute la page */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 4px;
    transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

/* Scrollbar en mode clair */
body.light-mode ::-webkit-scrollbar-track {
    background: rgba(99, 102, 241, 0.1);
}

body.light-mode ::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
}

/* Support pour Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) rgba(0, 0, 0, 0.1);
}

/* === THEMES === */

/* LIGHT MODE - Thème clair moderne avec dégradés bleus */
/* 🎨 THÈME LIGHT TRADEGURU - VERSION PREMIUM */
body.light-mode { 
    background: linear-gradient(to bottom, 
        #f0f5ff 0%,           /* Bleu clair très pâle en haut */
        #e6f2ff 15%,          /* Bleu ciel clair */
        #dceeff 30%,          /* Bleu clair */
        #d4e9ff 45%,          /* Bleu doux */
        #cce6ff 60%,          /* Bleu moyen clair */
        #c2e0ff 75%,          /* Bleu légèrement plus vif */
        #b8daff 100%          /* Bleu clair en bas */
    );
    background-attachment: fixed;
    color: #1a202c; 
    min-height: 100vh;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
}

body.light-mode .top-header { 
    background: linear-gradient(135deg, rgba(113, 128, 150, 0.95) 0%, rgba(74, 85, 104, 0.95) 50%, rgba(45, 55, 72, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(113, 128, 150, 0.25);
    box-shadow: 0 8px 25px rgba(120, 89, 197, 0.25), 0 0 50px rgba(60, 137, 198, 0.15);
}

body.light-mode .sidebar-menu { 
    background: linear-gradient(180deg, #ffffff 0%, #f7fafc 50%, #edf2f7 100%);
    border-right: 2px solid rgba(113, 128, 150, 0.15);
    box-shadow: 8px 0 24px rgba(74, 85, 104, 0.08);
}

body.light-mode .sidebar-header {
    background: linear-gradient(135deg, #718096 0%, #4a5568 50%, #2d3748 100%);
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-mode .sidebar-title {
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

body.light-mode .sidebar-close {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: all 0.2s ease;
}

body.light-mode .sidebar-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

body.light-mode .menu-item {
    color: #4a5568;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 2px 8px;
}

body.light-mode .menu-item:hover {
    background: linear-gradient(135deg, rgba(113, 128, 150, 0.12) 0%, rgba(74, 85, 104, 0.08) 100%);
    color: #2d3748;
    transform: translateX(6px);
    border-left: 4px solid #718096;
    box-shadow: 0 4px 12px rgba(74, 85, 104, 0.1);
}

body.light-mode .submenu-item {
    color: #718096;
    font-weight: 400;
    transition: all 0.2s ease;
    border-radius: 6px;
    margin: 1px 12px;
}

body.light-mode .submenu-item:hover {
    background: linear-gradient(135deg, rgba(113, 128, 150, 0.08) 0%, rgba(74, 85, 104, 0.05) 100%);
    color: #4a5568;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(74, 85, 104, 0.06);
}

body.light-mode .lang-dropdown,
body.light-mode .user-dropdown { 
    background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
    border: 1px solid rgba(113, 128, 150, 0.2);
    box-shadow: 0 16px 40px rgba(74, 85, 104, 0.12);
    backdrop-filter: blur(16px);
    border-radius: 12px;
}

/* 🎨 ÉLÉMENTS PRINCIPAUX THÈME LIGHT PREMIUM */
body.light-mode .lang-item,
body.light-mode .user-item {
    color: #4a5568;
    transition: all 0.2s ease;
}

body.light-mode .lang-item:hover,
body.light-mode .user-item:hover {
    background: linear-gradient(135deg, rgba(113, 128, 150, 0.1) 0%, rgba(74, 85, 104, 0.08) 100%);
    color: #2d3748;
    transform: translateX(4px);
}

/* Boutons principaux en mode light premium */
body.light-mode .btn-primary {
    background: linear-gradient(135deg, #718096 0%, #4a5568 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(74, 85, 104, 0.2);
    transition: all 0.3s ease;
}

body.light-mode .btn-primary:hover {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(74, 85, 104, 0.3);
}

/* 🎨 SECTIONS EN MODE LIGHT - SANS BACKGROUNDS AJOUTÉS */
body.light-mode .bt-section,
body.light-mode .main-content > div,
body.light-mode .accordion-section {
    /* Backgrounds supprimés - conserve uniquement les couleurs d'origine */
    border: 2px solid rgba(51, 102, 204, 0.2);
    box-shadow: 0 8px 24px rgba(51, 102, 204, 0.1);
}

body.light-mode .card,
body.light-mode .config-card {
    /* Backgrounds supprimés - conserve uniquement les couleurs d'origine */
    border: 1px solid rgba(51, 102, 204, 0.25);
    box-shadow: 0 8px 24px rgba(51, 102, 204, 0.08);
    border-radius: 12px;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px); /* Effet glass pour les cartes */
}

body.light-mode .card:hover {
    background: linear-gradient(135deg, rgba(248, 251, 255, 0.6) 0%, rgba(240, 248, 255, 0.7) 100%);
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(51, 102, 204, 0.15);
}

/* Inputs et formulaires */
body.light-mode input,
body.light-mode select,
body.light-mode textarea {
    background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
    border: 2px solid rgba(113, 128, 150, 0.2);
    color: #2d3748;
    border-radius: 8px;
    transition: all 0.3s ease;
}

body.light-mode input:focus,
body.light-mode select:focus,
body.light-mode textarea:focus {
    border-color: #718096;
    box-shadow: 0 0 0 3px rgba(113, 128, 150, 0.1);
    background: #ffffff;
}

/* Contenu principal en mode clair amélioré */
/*body.light-mode .hero-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(247, 250, 252, 0.9) 50%, rgba(237, 242, 247, 0.85) 100%);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(74, 85, 104, 0.08);
}*/

/* 🎨 GRAPHIQUES EN MODE LIGHT */
body.light-mode .bt-graph-block {
    background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
    border: 2px solid rgba(113, 128, 150, 0.2);
    box-shadow: 0 12px 32px rgba(74, 85, 104, 0.1);
}

body.light-mode .chart-area {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    border: 1px solid rgba(113, 128, 150, 0.15);
}

body.light-mode .rsi-panel,
body.light-mode .macd-panel {
    background: linear-gradient(135deg, rgba(113, 128, 150, 0.08) 0%, rgba(74, 85, 104, 0.05) 100%);
    border: 1px solid rgba(113, 128, 150, 0.2);
    color: #2d3748;
}

/* Canvas et graphiques */
body.light-mode canvas {
    background: #ffffff !important;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(74, 85, 104, 0.08);
}

/* 🎨 ACCORDÉONS EN MODE LIGHT */
body.light-mode .accordion-section .accordion-header {
    color: #1a365d;
    /* Background supprimé - conserve uniquement les couleurs d'origine */
    border: 2px solid rgba(51, 102, 204, 0.3);
    padding: 15px 20px; /* Même padding que défini dans backtest.css */
    margin: 0; /* Supprime les marges externes pour éviter le décalage */
    border-radius: 8px 8px 0 0; /* Arrondi seulement en haut */
}

body.light-mode .accordion-section .accordion-header:hover {
    color: #1a202c;
    /* Background supprimé - conserve uniquement les couleurs d'origine */
    border-color: rgba(51, 102, 204, 0.5);
    text-shadow: none;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

body.light-mode .accordion-icon {
    color: #2d5aa0;
    margin-right: 0; /* Supprime la marge droite pour que le triangle soit au bord */
}

body.light-mode .accordion-section .accordion-content {
    /* Background supprimé - conserve uniquement les couleurs d'origine */
    border-left: 2px solid rgba(51, 102, 204, 0.3);
    border-right: 2px solid rgba(51, 102, 204, 0.3);
    border-bottom: 2px solid rgba(51, 102, 204, 0.3);
    border-radius: 0 0 8px 8px;
    padding: 15px 20px; /* Alignement avec le header */
    backdrop-filter: blur(6px); /* Effet glass plus subtil pour le contenu */
}

/* 🎨 EFFETS VISUELS POUR MODE LIGHT - PRÉSERVATION DES EFFETS */
/* Textes avec ombres adaptées au mode light */
body.light-mode .stat-value {
    color: #2563eb;
    text-shadow: 0 1px 3px rgba(37, 99, 235, 0.2);
    filter: drop-shadow(0 0 4px rgba(37, 99, 235, 0.3));
}

body.light-mode .logo {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #1e40af 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: logoGlowLight 3s ease-in-out infinite alternate;
}

@keyframes logoGlowLight {
    from { 
        filter: drop-shadow(0 0 4px rgba(37, 99, 235, 0.4)); 
    }
    to { 
        filter: drop-shadow(0 0 12px rgba(37, 99, 235, 0.7)); 
    }
}

/* Boutons avec effets préservés */
body.light-mode .bt-btn:hover,
body.light-mode .primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Cartes avec effets glow adaptés */
body.light-mode .indicator-card:hover {
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.15);
    border-color: #2563eb;
    transform: translateY(-2px);
}

/* Focus et interactions avec glow bleu */
body.light-mode input:focus,
body.light-mode select:focus,
body.light-mode textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1), 0 0 12px rgba(37, 99, 235, 0.2);
    background: #ffffff;
}

/* 🎨 PRÉSERVATION DES EFFETS BACKTEST EN MODE LIGHT */
body.light-mode .accordion-section .accordion-header:hover {
    color: #1a202c;
    /*background: linear-gradient(135deg, #ddeeff 0%, #b3daff 100%);*/
    border-color: rgba(51, 102, 204, 0.5);
    text-shadow: 0 1px 2px rgba(26, 32, 44, 0.1); /* Ombre adaptée au light */
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15); /* Glow subtil */
}

/* SUPPRESSION COMPLÈTE de TOUS les effets hover sur les sections */
/* Plus aucun effet quand on passe la souris sur le background des sections */

/* RÉTABLISSEMENT de l'animation de bordure SANS effet sur les textes en mode light */
/* HOVER SECTION SUPPRIMÉ EN MODE LIGHT - INTERFÈRE AVEC LES TABLES */

/* Effet UNIQUEMENT sur les PETITS tableaux d'indicateurs (pas la grande table) */
body.light-mode .bt-indicator-cards .indicator-card:hover {
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.12);
}

/* AUCUN effet texte - les couleurs restent inchangées partout */

/* Effets spéciaux préservés avec adaptation */
body.light-mode .glow-effect {
    animation: glowLight 2s ease-in-out infinite alternate;
}

@keyframes glowLight {
    from { 
        filter: drop-shadow(0 0 4px rgba(37, 99, 235, 0.3));
        box-shadow: 0 0 8px rgba(37, 99, 235, 0.2);
    }
    to { 
        filter: drop-shadow(0 0 12px rgba(37, 99, 235, 0.6));
        box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
    }
}

body.light-mode .hero-title {
    color: #1e293b;
    text-shadow: 0 4px 8px rgba(99, 102, 241, 0.1);
    background: linear-gradient(135deg, #1e293b 0%, #4338ca 50%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.light-mode .hero-subtitle {
    color: #64748b;
    font-weight: 400;
}

body.light-mode .btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 50%, #3730a3 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
    border: none;
    font-weight: 600;
}

body.light-mode .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(99, 102, 241, 0.4);
}

body.light-mode .btn-secondary {
    /* Background supprimé - conserve uniquement les couleurs d'origine */
    color: #4338ca;
    border: 2px solid rgba(99, 102, 241, 0.3);
    font-weight: 600;
}

body.light-mode .btn-secondary:hover {
    /* Background supprimé - conserve uniquement les couleurs d'origine */
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.25);
}

body.light-mode .section {
    /* Background supprimé - conserve uniquement les couleurs d'origine */
    color: #374151;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.1);
}

body.light-mode .card {
    /* Background supprimé - conserve uniquement les couleurs d'origine */
    border: 1px solid rgba(99, 102, 241, 0.15);
    color: #374151;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.1);
}

body.light-mode h1, body.light-mode h2, body.light-mode h3, body.light-mode h4, body.light-mode h5, body.light-mode h6 {
    color: #1e293b;
    font-weight: 700;
}

body.light-mode p, body.light-mode span, body.light-mode div {
    color: #475569;
}

/* DARK THEME - Thème sombre moderne */
body.dark-theme {
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 30%, #16213e 70%, #0f3460 100%);
    color: #e2e8f0;
    min-height: 100vh;
}

body.dark-theme .top-header {
    background: linear-gradient(135deg, rgba(15, 15, 35, 0.95) 0%, rgba(26, 26, 46, 0.95) 50%, rgba(22, 33, 62, 0.95) 100%);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    box-shadow: 0 8px 25px rgba(120, 89, 197, 0.3), 0 0 50px rgba(60, 137, 198, 0.2);
}

body.dark-theme .sidebar-menu {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-right: 1px solid rgba(0, 212, 255, 0.15);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

body.dark-theme .sidebar-header {
    background: linear-gradient(135deg, #00d4ff 0%, #7b68ee 100%);
    color: #0f0f23;
}

body.dark-theme .sidebar-title {
    color: #0f0f23;
    font-weight: 700;
}

body.dark-theme .sidebar-close {
    color: #0f0f23;
}

body.dark-theme .menu-item {
    color: #cbd5e1;
}

body.dark-theme .menu-item:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(123, 104, 238, 0.1) 100%);
    color: #00d4ff;
    transform: translateX(8px);
    border-left: 3px solid #00d4ff;
}

body.dark-theme .submenu-item {
    color: #94a3b8;
}

body.dark-theme .submenu-item:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(123, 104, 238, 0.08) 100%);
    color: #00d4ff;
    transform: translateX(6px);
}

/* === INTERFACE DE CHAT FLOTTANTE - AVATAR === */
.tradeguru-avatar {
    position: absolute;
    top: -53px;
    left: -70px;
    width: 106px;
    height: 106px;
    background: url('../img/logo3.png') center/cover no-repeat;
    border-radius: 10px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(0, 212, 255, 0.4));
    /*border: 3px solid rgba(255, 215, 0, 0.3);*/
}

.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    filter: drop-shadow(0 0 15px rgba(0, 212, 255, 0.4));
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* === MESSAGERIE AI TRADEGURU - GLOBAL === */
.tradeguru-call-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 80px;
    height: 80px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
    transform-origin: center center;
    will-change: transform;
}

.tradeguru-call-btn:hover {
    transform: scale(1.1);
}

.tradeguru-call-btn::before {
    content: "💬";
    font-size: 3rem;
    color: #00d4ff;
    line-height: 1;
    display: block;
}

.floating-interface {
    position: fixed;
    bottom: 120px;
    right: 30px;
    width: 320px;
    height: 400px;
    background: rgba(20, 20, 40, 0.95);
    border: 2px solid;
    border-image: linear-gradient(45deg, #00d4ff, #7b68ee, #00d4ff) 1;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
    z-index: 999;
    transform: translateY(100vh);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backdrop-filter: blur(10px);
    cursor: move;
}

.floating-interface.active {
    transform: translateY(0);
}

.floating-interface.dragging {
    transition: none;
}

.chat-header {
    padding: 0.8rem;
    border-bottom: 1px solid rgba(0, 212, 255, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
}

.chat-header:hover {
    background: rgba(0, 212, 255, 0.05);
}

.chat-title {
    color: #00d4ff;
    font-size: 1.2rem;
    font-weight: bold;
    flex: 1;
    margin-right: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.close-btn {
    background: none;
    border: none;
    color: #00d4ff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    min-width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: white;
    transform: rotate(90deg);
}

.history-btn {
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 5px;
    padding: 0.3rem 0.6rem;
    color: #00d4ff;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.history-btn:hover {
    background: rgba(0, 212, 255, 0.3);
}

.chat-messages {
    height: 240px;
    overflow-y: auto;
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.message.user {
    flex-direction: row-reverse;
}

.message-bubble {
    max-width: 70%;
    padding: 0.8rem;
    border-radius: 15px;
    position: relative;
}

.message-bubble.tradeguru {
    background: linear-gradient(135deg, #00d4ff, #7b68ee);
    color: white;
}

.message-bubble.user {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.chat-input {
    padding: 0.8rem;
    border-top: 1px solid rgba(0, 212, 255, 0.3);
    display: flex;
    gap: 0.4rem;
}

.input-field {
    flex: 1;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 20px;
    padding: 0.6rem 0.8rem;
    color: white;
    outline: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.input-field:focus {
    border-color: #00d4ff;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.input-field::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.send-btn {
    background: linear-gradient(135deg, #00d4ff, #7b68ee);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.typing-indicator {
    display: none;
    align-items: center;
    gap: 0.5rem;
    color: #00d4ff;
    font-style: italic;
    opacity: 0.7;
    padding: 0.5rem 0.8rem;
}

.typing-dots {
    display: flex;
    gap: 2px;
}

.typing-dots span {
    width: 4px;
    height: 4px;
    background: #00d4ff;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

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

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.5);
    border-radius: 5px;
}

/* Support du thème clair pour la messagerie */
body.light-mode .floating-interface {
    background: rgba(255, 255, 255, 0.95);
    border-image: linear-gradient(45deg, #7b68ee, #00d4ff, #7b68ee) 1;
}

body.light-mode .chat-title {
    color: #7b68ee;
}

body.light-mode .close-btn,
body.light-mode .history-btn {
    color: #7b68ee;
}

body.light-mode .history-btn {
    background: rgba(123, 104, 238, 0.2);
    border: 1px solid rgba(123, 104, 238, 0.3);
}

body.light-mode .message-bubble.user {
    background: rgba(123, 104, 238, 0.2);
    color: #7b68ee;
    border: 1px solid rgba(123, 104, 238, 0.3);
}

body.light-mode .input-field {
    background: rgba(123, 104, 238, 0.1);
    border: 1px solid rgba(123, 104, 238, 0.3);
    color: #3a3b4d;
}

body.light-mode .input-field::placeholder {
    color: rgba(58, 59, 77, 0.5);
}

body.light-mode .typing-indicator {
    color: #7b68ee;
}

body.light-mode .typing-dots span {
    background: #7b68ee;
}

/* =============================================
   SUPPORT RTL COMPLET - GLOBAL (Hébreu & Arabe)
   ============================================= */

/* Header RTL */
body[dir="rtl"] .header-container {
    flex-direction: row-reverse !important;
}

body[dir="rtl"] .sidebar-toggle {
    order: 3 !important;
}

body[dir="rtl"] .logo-section {
    order: 2 !important;
}

body[dir="rtl"] .header-actions {
    order: 1 !important;
    flex-direction: row-reverse !important;
}

/* RÈGLES IDENTIQUES pour HÉBREU et ARABE */
html[lang="he"] .header-container,
html[lang="ar"] .header-container {
    flex-direction: row-reverse !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

/* EN RTL : Hamburger va à DROITE */
html[lang="he"] .sidebar-toggle,
html[lang="ar"] .sidebar-toggle {
    order: 3 !important;
}

/* EN RTL : Logo reste au CENTRE */  
html[lang="he"] .logo-section,
html[lang="ar"] .logo-section {
    order: 2 !important;
}

/* EN RTL : Icônes langue/user vont à GAUCHE */
html[lang="he"] .header-actions,
html[lang="ar"] .header-actions {
    order: 1 !important;
    flex-direction: row-reverse !important;
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
}

/* Sidebar RTL - IDENTIQUE pour HÉBREU et ARABE */
body[dir="rtl"] .sidebar-menu,
html[lang="he"] body .sidebar-menu,
html[lang="ar"] body .sidebar-menu {
    right: -var(--sidebar-width) !important;
    left: auto !important;
    text-align: right !important;
    border-right: none !important;
    border-left: 1px solid var(--border-color) !important;
    transition: right 0.3s ease !important;
}

body[dir="rtl"] .sidebar-menu.active,
body[dir="rtl"] .sidebar-menu.show,
html[lang="he"] body .sidebar-menu.active,
html[lang="he"] body .sidebar-menu.show,
html[lang="ar"] body .sidebar-menu.active,
html[lang="ar"] body .sidebar-menu.show {
    right: 0 !important;
    left: auto !important;
}

body[dir="rtl"] .sidebar-header {
    flex-direction: row-reverse;
    text-align: right;
}

body[dir="rtl"] .sidebar-close {
    order: 1;
}

body[dir="rtl"] .sidebar-logo {
    order: 3;
}

body[dir="rtl"] .sidebar-title {
    order: 2;
}

body[dir="rtl"] .menu-item {
    text-align: right;
    flex-direction: row-reverse;
}

body[dir="rtl"] .menu-item i {
    margin-left: 12px;
    margin-right: 0;
}

body[dir="rtl"] .submenu {
    padding-right: 20px;
    padding-left: 0;
}

body[dir="rtl"] .submenu-item {
    text-align: right;
    flex-direction: row-reverse;
}

body[dir="rtl"] .submenu-item i {
    margin-left: 10px;
    margin-right: 0;
}

/* Menu accordéon RTL */
body[dir="rtl"] .accordion-arrow {
    order: 1;
    margin-left: 0;
    margin-right: auto;
}

/* Dropdowns RTL */
body[dir="rtl"] .language-selector .lang-dropdown {
    right: 0;
    left: auto;
    text-align: right;
}

body[dir="rtl"] .lang-item {
    text-align: right;
    direction: rtl;
    flex-direction: row-reverse;
}

body[dir="rtl"] .user-menu .user-dropdown {
    right: 0;
    left: auto;
    text-align: right;
}

body[dir="rtl"] .user-item {
    text-align: right;
    flex-direction: row-reverse;
}

body[dir="rtl"] .user-item i {
    margin-left: 10px;
    margin-right: 0;
}

/* Boutons header RTL */
body[dir="rtl"] .lang-btn {
    flex-direction: row-reverse;
}

body[dir="rtl"] .lang-btn i {
    margin-left: 8px;
    margin-right: 0;
}

body[dir="rtl"] .user-btn {
    flex-direction: row-reverse;
}

body[dir="rtl"] .auth-buttons {
    flex-direction: row-reverse;
    gap: 10px;
}

/* Overlay RTL */
body[dir="rtl"] .sidebar-overlay {
    right: 0;
    left: auto;
}

/* Container RTL */
body[dir="rtl"] .container {
    direction: rtl;
}

/* Responsive RTL */
@media (max-width: 768px) {
    body[dir="rtl"] .sidebar-menu {
        right: -100% !important;
        left: auto !important;
        width: 100%;
    }
    
    body[dir="rtl"] .sidebar-menu.active,
    body[dir="rtl"] .sidebar-menu.show {
        right: 0 !important;
        left: auto !important;
    }
    
    body[dir="rtl"] .header-actions {
        gap: 5px;
    }
}

/* Animations RTL */
body[dir="rtl"] .sidebar-menu {
    transform: translateX(100%);
}

body[dir="rtl"] .sidebar-menu.active,
body[dir="rtl"] .sidebar-menu.show {
    transform: translateX(0);
}

/* Focus states RTL */
body[dir="rtl"] .menu-item:focus,
body[dir="rtl"] .submenu-item:focus {
    outline-offset: -2px;
}

/* Text alignment fixes */
body[dir="rtl"] .logo-text {
    text-align: center;
}

body[dir="rtl"] .lang-current {
    text-align: center;
}

/* Check marks et listes RTL */
body[dir="rtl"] ul li,
body[dir="rtl"] .card-features li,
body[dir="rtl"] .features-list li {
    text-align: right;
    padding-left: 0;
    padding-right: 25px;
}

body[dir="rtl"] ul li::before,
body[dir="rtl"] .card-features li::before,
body[dir="rtl"] .features-list li::before {
    left: auto;
    right: 0;
    margin-left: 8px;
    margin-right: 0;
}

/* 🎨 CORRECTION DES STATISTIQUES EN MODE LIGHT */
body.light-mode .stat-card,
body.light-mode .stats-grid .stat-card,
body.light-mode .small-stat-card {
    border: 2px solid rgba(37, 99, 235, 0.3);
    color: #1a365d;
}

body.light-mode .stat-card:hover,
body.light-mode .stats-grid .stat-card:hover,
body.light-mode .small-stat-card:hover {
    border-color: rgba(37, 99, 235, 0.5);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.2);
}

body.light-mode .stat-value {
    color: #2563eb;
    font-weight: bold;
}

body.light-mode .stat-label {
    color: #4a5568;
}

/* Support spécifique pour l'hébreu et l'arabe */
html[lang="he"] body ul li::before,
html[lang="he"] body .card-features li::before,
html[lang="he"] body .features-list li::before,
html[lang="ar"] body ul li::before,
html[lang="ar"] body .card-features li::before,
html[lang="ar"] body .features-list li::before {
    left: auto !important;
    right: 0 !important;
    margin-left: 8px !important;
    margin-right: 0 !important;
}

/* === FOOTER FIXE EN BAS AVEC BANDE TRANSPARENTE === */
.main-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8); /* Bande transparente */
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    padding: 0;
    margin: 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    text-align: center;
}

.footer-content p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Mode light pour le footer */
body.light-mode .main-footer {
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode .footer-content p {
    color: var(--text-primary);
}

/* === STYLES POUR INPUTS/SELECTS EN MODE DARK === */
/* Mode DARK (par défaut) - avec !important pour override styles.css */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
    background: #2a2d3a !important;
    color: #ffffff !important;
    border: 1px solid #4a5568 !important;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    background: #353945 !important;
    border-color: #6366F1 !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

input[readonly],
select[disabled] {
    background: #1e2028 !important;
    color: #6b7280 !important;
    cursor: not-allowed;
    opacity: 0.7;
}
/* Mode LIGHT */
body.light-mode input[type="text"],
body.light-mode input[type="number"],
body.light-mode input[type="email"],
body.light-mode input[type="password"],
body.light-mode select,
body.light-mode textarea {
    background: #f8fafc !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
}   border: 1px solid rgba(99, 102, 241, 0.3) !important;
}

body.light-mode input[type="text"]:focus,
body.light-mode input[type="number"]:focus,
body.light-mode input[type="email"]:focus,
body.light-mode input[type="password"]:focus,
body.light-mode select:focus,
body.light-mode textarea:focus {
    background: #ffffff !important;
    border-color: #6366F1 !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

body.light-mode input[readonly],
body.light-mode select[disabled] {
    background: #e2e8f0 !important;
    color: #64748b !important;
    opacity: 0.7;
}

/* Style spécial pour le champ "Montant avec levier" */
.leveraged-input {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #10b981 !important;
    font-weight: bold;
    border-color: rgba(16, 185, 129, 0.4) !important;
}

body.light-mode .leveraged-input {
    background: #e8f5e9 !important;
    color: #1b5e20 !important;
    border-color: rgba(27, 94, 32, 0.3) !important;
}

/* Ajuster le padding-bottom du body pour éviter que le footer cache le contenu */
body {
    padding-bottom: 0;
}

/* Animations pour modal Premium */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* === BOUTONS FILTRES QUOTE (USDT, BTC, ETH...) === */
.quote-btn {
    background: #3a3a3a !important;
    color: #ffffff !important;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quote-btn:hover {
    background: #4a4a4a !important;
    transform: translateY(-1px);
}

.quote-btn.active {
    background: #6366F1 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

body.light-mode .quote-btn {
    background: #3a3a3a !important;
    color: #ffffff !important;
}

body.light-mode .quote-btn:hover {
    background: #4a4a4a !important;
}

body.light-mode .quote-btn.active {
    background: #6366F1 !important;
    color: #ffffff !important;
}
