/* ===================================
   BACKTEST CSS - HARMONISÉ AVEC LANDING PAGE
   Couleurs et style de CryptoLearn/TradeGuru
   =================================== */

/* === Variables CSS pour cohérence === */
:root {
  --primary-gradient: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
  --accent-blue: #00d4ff;
  --accent-purple: #7b68ee;
  --accent-gold: #ffd700;
  --text-gradient: linear-gradient(45deg, #00d4ff, #7b68ee, #ffd700);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --button-gradient: linear-gradient(45deg, #00d4ff, #7b68ee);
  --success-color: #27ae60;
  --danger-color: #e74c3c;
  --warning-color: #f39c12;
}

/* === Reset et base === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
  /* Background géré par global.css et les thèmes */
}

/* Background par défaut (thème sombre) seulement si aucune classe de thème */
body:not(.light-mode):not(.dark-theme),
body.dark-theme,
html.theme-loading-dark body {
  background: var(--primary-gradient);
  color: #ffffff;
}

/* Thème de chargement light temporaire */
html.theme-loading-light body {
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 30%, #eef4ff 70%, #e3edff 100%);
  color: #2c3e50;
}

/* === Effets d'arrière-plan animés === */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    repeating-linear-gradient(
      0deg,
      rgba(0, 212, 255, 0.02) 0px,
      transparent 1px,
      transparent 30px,
      rgba(0, 212, 255, 0.02) 31px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(0, 212, 255, 0.02) 0px,
      transparent 1px,
      transparent 30px,
      rgba(0, 212, 255, 0.02) 31px
    );
  pointer-events: none;
  z-index: 1;
  animation: gridPulse 6s ease-in-out;
  animation-fill-mode: forwards;
}

/* Chiffres volants en fond */
.flying-numbers {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.number {
  position: absolute;
  font-size: 14px;
  font-weight: bold;
  opacity: 0.4;
  animation: flyNumber 8s infinite linear;
}

@keyframes flyNumber {
  0% { 
    transform: translateY(100vh) translateX(0) scale(0) rotate(0deg);
    opacity: 0;
  }
  10% { 
    opacity: 0.4;
    transform: translateY(90vh) translateX(10px) scale(1) rotate(180deg);
  }
  90% { 
    opacity: 0.4;
    transform: translateY(10vh) translateX(-10px) scale(1) rotate(360deg);
  }
  100% { 
    transform: translateY(-10vh) translateX(0) scale(0) rotate(540deg);
    opacity: 0;
  }
}

/* Grille de trading subtile */
.trading-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    repeating-linear-gradient(
      0deg,
      rgba(0, 212, 255, 0.02) 0px,
      transparent 1px,
      transparent 30px,
      rgba(0, 212, 255, 0.02) 31px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(0, 212, 255, 0.02) 0px,
      transparent 1px,
      transparent 30px,
      rgba(0, 212, 255, 0.02) 31px
    );
  pointer-events: none;
  z-index: 1;
  animation: gridPulse 6s ease-in-out infinite;
}

@keyframes gridPulse {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.4; }
}

/* === Conteneur principal === */
.main-content {
  position: relative;
  z-index: 10;
  max-width: 1650px; /* Élargi pour avoir plus d'espace pour le graphique */
  margin: 0 auto;
  margin-top: 20px !important; /* Espace entre header et contenu - Force l'application */
  padding: 20px;
  padding-top: 40px !important; /* Alternative avec padding-top */
  padding-bottom: 300px !important; /* Espace en bas pour les bulles longues */
}

/* Force l'espace au premier élément */
.main-content > *:first-child,
.main-content .bt-section:first-child {
  margin-top: 20px !important;
}

/* === Header harmonisé === */
header {
  padding: 20px 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--glass-border);
}

.logo {
  font-size: 26px;
  font-weight: bold;
  background: var(--text-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: logoGlow 3s ease-in-out;
  animation-fill-mode: forwards;}

@keyframes logoGlow {
  from { filter: drop-shadow(0 0 5px rgba(0, 212, 255, 0.3)); }
  to { filter: drop-shadow(0 0 15px rgba(0, 212, 255, 0.6)); }
}

/* === Sections === */
.bt-section {
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  border-radius: 25px;
  padding: 30px;
  margin: 30px 0;
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}

.bt-section::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--accent-blue) 0%, var(--accent-purple) 30%, var(--accent-purple) 70%, var(--accent-blue) 100%);
  border-radius: 27px;
  z-index: -1;
  /*animation: borderRotate 6s linear infinite; */
  opacity: 0;
  transition: opacity 0.3s;
}

.bt-section:hover::before {
  /* animation: borderRotate 1s linear; */
  /* animation-fill-mode: forwards; */
  opacity: 0;
}

/* Protection du texte pendant l'animation colorée - SUPPRIMÉ POUR ÉVITER CHANGEMENTS DE POLICE AU HOVER */
/* body:not(.light-mode) .bt-section:hover * {
  color: #ffffff !important;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.8) !important;
} */

/* MODE LIGHT : AUCUN EFFET HOVER GLOBAL - SUPPRIMÉ POUR ÉVITER LES INTERFÉRENCES */

/* EXCEPTION en mode light pour la table Marché et Financement */
body.light-mode .bt-section:hover .bt-marche-card *,
body.light-mode .bt-section:hover .bt-marche-card label,
body.light-mode .bt-section:hover .bt-marche-card input,
body.light-mode .bt-section:hover .bt-marche-card select,
body.light-mode .bt-section:hover .bt-marche-card button {
  color: inherit !important; /* Annule le forçage de couleur pour tous les éléments */
  text-shadow: none !important; /* Supprime l'ombre */
}

@keyframes borderRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(180deg); }
}

/* === Accordéons === */
.accordion-section .accordion-header {
  cursor: pointer;
  font-size: 1.3rem;
  font-weight: bold;
  padding: 15px 20px; /* Marges internes */
  color: var(--accent-blue);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  margin: 0; /* Pas de marge externe pour éviter décalage */
  border-radius: 8px 8px 0 0; /* Arrondi seulement en haut */
}

.accordion-section .accordion-header:hover {
  color: var(--accent-gold);
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
  background: rgba(255, 255, 255, 0.05); /* Fond subtil au hover */
}

/* En-têtes de section en mode dark avec bandeau dégradé */
body.dark-mode .accordion-section .accordion-header {
  background: linear-gradient(135deg, rgba(0, 56, 184, 0.3) 0%, rgba(0, 0, 0, 0.6) 100%) !important;
  backdrop-filter: blur(5px) !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(0, 56, 184, 0.2) !important;
}

/* En-têtes de section en mode light avec bandeau dégradé blanc */
body.light-mode .accordion-section .accordion-header {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 245, 255, 0.9) 50%, rgba(230, 240, 255, 0.85) 100%) !important;
  backdrop-filter: blur(3px) !important;
  border: 1px solid rgba(99, 102, 241, 0.2) !important;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.15) !important;
}

/* Bloc d'explication dans les modals - Mode light */
body.light-mode .modal-explanation-section {
  background: #ffffff !important;
  border-bottom: 1px solid rgba(99, 102, 241, 0.2) !important;
}

body.light-mode .modal-explanation-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(79, 70, 229, 0.05)) !important;
  border-left-color: #6366f1 !important;
}

body.light-mode .modal-explanation-box p,
body.light-mode .modal-explanation-box div {
  color: #1e293b !important;
}

.accordion-section .accordion-content {
  max-height: 2000px;
  overflow: hidden;
  transition: max-height 0.4s ease;
  padding: 15px 20px; /* Alignement avec le header */
}

.accordion-section.collapsed .accordion-content {
  max-height: 0;
}

.accordion-icon {
  transition: transform 0.3s ease;
  margin-right: 0; /* Triangle au bord droit */
  font-size: 14px; /* Taille du triangle */
}

.accordion-section.collapsed .accordion-icon {
  transform: rotate(-90deg);
}

/* === Cards et indicateurs === */
.indicator-card {
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 25px;
  margin: 15px;
  min-width: 280px;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.indicator-card:hover {
  box-shadow: 0 20px 40px rgba(0, 212, 255, 0.2);
  border-color: var(--accent-blue);
}

.indicator-card.grayed {
  opacity: 0.4;
  background: rgba(100, 100, 100, 0.1);
}

/* HOVER SUPPRIMÉ - INTERFÈRE AVEC LES TABLES */

/* Animation hover pour les cartes d'indicateurs SAUF celles des sections de tables */
/* SUPPRIMÉ - FORÇAIT LA COULEUR BLANCHE SUR LES INPUTS AU HOVER */
/* .bt-indicator-cards .indicator-card:hover *,
.indicator-card:not([style*="max-width:95%"]):hover * {
  color: #ffffff !important;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.8) !important;
} */

/* Animation de rotation borderRotate pour les cartes d'indicateurs - EFFET ORIGINAL */
.bt-indicator-cards .indicator-card::before,
.indicator-card:not([style*="max-width:95%"])::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--accent-blue) 0%, var(--accent-purple) 30%, var(--accent-purple) 70%, var(--accent-blue) 100%);
  border-radius: 27px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s;
}

.bt-indicator-cards .indicator-card:hover::before,
.indicator-card:not([style*="max-width:95%"]):hover::before {
  /* animation: borderRotate 1s linear; */
  /* animation-fill-mode: forwards; */
  opacity: 0;
}

/* Assurer que le contenu reste au-dessus de l'animation */
.bt-indicator-cards .indicator-card > *,
.indicator-card:not([style*="max-width:95%"]) > * {
  position: relative;
  z-index: 1;
}

/* Protection du texte pendant l'animation colorée pour les cartes d'indicateurs - SUPPRIMÉ POUR ÉVITER CHANGEMENTS DE POLICE AU HOVER */
/* .indicator-card:hover * {
  color: #ffffff !important;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.8) !important;
} */

/* === Boutons === */
.bt-btn, .primary-btn, .secondary-btn {
  background: var(--button-gradient);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.bt-btn::before, .primary-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.bt-btn:hover::before, .primary-btn:hover::before {
  left: 100%;
}

.bt-btn:hover, .primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 212, 255, 0.3);
}

.bt-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(100, 100, 100, 0.3);
}

.secondary-btn {
  background: transparent;
  color: var(--accent-blue);
  border: 2px solid var(--accent-blue);
}

.secondary-btn:hover {
  background: var(--accent-blue);
  color: #000;
  transform: translateY(-2px);
}

.bt-btn-danger, .bt-btn-small.bt-btn-danger {
  background: linear-gradient(45deg, var(--danger-color), #c0392b);
}

.bt-btn-small {
  padding: 8px 16px;
  font-size: 0.9rem;
  margin: 0 4px;
}

/* === Inputs et selects === */
input, select, textarea {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 6px 12px; /* Réduit pour s'adapter à la hauteur 36px */
  color: #ffffff;
  font-size: 15px; /* Augmenté pour une meilleure lisibilité */
  font-family: inherit;
  transition: all 0.3s ease;
  line-height: 1.2; /* Optimisé pour le centrage */
  vertical-align: middle; /* Centre le texte verticalement */
  display: flex;
  align-items: center; /* Force l'alignement vertical */
  height: 36px; /* Hauteur uniforme pour tous les inputs/selects */
  box-sizing: border-box;
  text-align: center; /* Centre le texte horizontalement */
}

/* Spécial pour les inputs de type date - permet l'affichage du calendrier */
input[type="date"] {
  display: inline-block !important; /* Override le flex pour permettre le calendrier */
  text-align: left !important; /* Alignement à gauche pour les dates */
  padding-right: 10px !important; /* Augmenté de 8px à 10px pour plus d'espace pour l'icône */
  position: relative !important; /* Nécessaire pour le positionnement de l'icône */
  min-width: 140px !important; /* Augmenté pour donner plus d'espace au texte */
  color: #ffffff !important; /* Retour au blanc par défaut */
  font-weight: 500 !important; /* Un peu plus gras pour ressortir */
}

/* Style pour l'icône calendrier des dates */
input[type="date"]::-webkit-calendar-picker-indicator {
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="white" viewBox="0 0 16 16"><path d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z"/></svg>') center/contain no-repeat !important;
  color: transparent !important;
  cursor: pointer !important;
  width: 12px !important; /* Réduit de 16px à 12px */
  height: 12px !important; /* Réduit de 16px à 12px */
  opacity: 1 !important;
  position: relative !important;
  z-index: 2 !important;
  margin-left: 6px !important; /* Augmenté de 4px à 6px pour plus d'espace */
}

/* Assurer que tous les inputs de type date fonctionnent */
#bt_from, #bt_to {
  display: inline-block !important;
  text-align: left !important;
  position: relative !important;
  color: #ffffff !important; /* Retour au blanc par défaut */
  font-weight: 500 !important; /* Un peu plus gras pour ressortir */
}

#bt_from::-webkit-calendar-picker-indicator, 
#bt_to::-webkit-calendar-picker-indicator {
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="white" viewBox="0 0 16 16"><path d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z"/></svg>') center/contain no-repeat !important;
  cursor: pointer !important;
  opacity: 1 !important;
  z-index: 10 !important;
  width: 12px !important; /* Réduit de 16px à 12px */
  height: 12px !important; /* Réduit de 16px à 12px */
  margin-left: 6px !important; /* Augmenté de 4px à 6px pour plus d'espace */
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
  background: rgba(255, 255, 255, 0.15);
}

input:disabled, select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* === Styles pour les options des select (déroulants) === */
select option {
  background: #ffffff !important; /* Fond blanc pour les options */
  color: #000000 !important; /* Texte noir pour les options */
  padding: 8px 12px !important;
  border: none !important;
}

select option:hover,
select option:focus,
select option:checked {
  background: var(--accent-blue) !important; /* Fond bleu pour l'option sélectionnée/hover */
  color: #ffffff !important; /* Texte blanc sur fond bleu pour le contraste */
}

/* === Labels === */
label {
  color: var(--accent-blue);
  font-weight: 500;
  margin-bottom: 5px;
  display: block;
}

/* === Stats cards === */
.bt-stat-card {
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  border-radius: 15px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.bt-stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 212, 255, 0.2);
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent-gold);
  margin-bottom: 8px;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.stat-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* === Strips scrollables === */
.bt-indicator-strip {
  display: flex;
  align-items: center;
  gap: 15px;
  position: relative;
}

.bt-indicator-cards {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 10px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-blue) transparent;
}

.bt-indicator-cards::-webkit-scrollbar {
  height: 6px;
}

.bt-indicator-cards::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.bt-indicator-cards::-webkit-scrollbar-thumb {
  background: var(--button-gradient);
  border-radius: 3px;
}

.bt-scroll-btn {
  background: var(--button-gradient);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bt-scroll-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4);
}

/* === Grid layouts === */
.bt-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.bt-marche-row {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.bt-marche-top {
  display: flex;
  align-items: flex-end; /* Aligne sur la base pour éviter les décalages */
  gap: 20px;
  margin-bottom: 20px;
  justify-content: flex-start;
  flex-wrap: wrap;
  min-height: 50px; /* Hauteur minimale pour stabiliser l'alignement */
}

.bt-marche-top > * {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.bt-marche-top label {
  margin-bottom: 8px; /* Augmenté de 6px à 8px pour plus d'espace */
  font-size: 20px; /* Augmenté de 18px à 20px pour "Liste tokens" */
  font-weight: 600;
  color: var(--accent-blue);
  white-space: nowrap;
  padding-bottom: 4px; /* Augmenté de 2px à 4px pour plus de hauteur */
}

.bt-marche-row > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 60px; /* Assurer une hauteur minimale pour éviter les coupures */
}

.bt-marche-row > div label {
  margin-bottom: 8px; /* Augmente l'espace sous le label */
  font-size: 16px; /* Augmenté de 14px à 16px */
  font-weight: 500;
  color: var(--accent-blue);
  white-space: nowrap; /* Empêche les labels de se couper */
  line-height: 1.2; /* Améliore l'espacement des lignes */
  display: block;
  width: 100%;
  text-align: center; /* Centre tous les labels de la rangée marché */
}

/* Style spécial pour le label "Marché" */
label[for="execution_mode"] {
  text-align: center !important; /* Force le centrage du label Marché */
}

/* Style pour le bouton Reset */
.bt-btn-reset {
  background: rgba(255, 255, 255, 0.1); /* Même fond que les inputs/selects */
  border: 1px solid var(--glass-border); /* Même bordure que les cellules */
  color: #ffffff;
  padding: 6px 25px; /* Ajusté pour s'harmoniser avec les inputs */
  border-radius: 10px; /* Même radius que les inputs */
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px; /* Augmenté de 2px à 4px pour plus d'espace entre icône et texte */
  height: 36px; /* Même hauteur que les autres cellules */
  min-width: 140px; /* Plus large */
  box-sizing: border-box;
}

.bt-btn-reset::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.bt-btn-reset:hover::before {
  left: 100%;
}

.bt-btn-reset:hover {
  border-color: var(--accent-blue); /* Bordure bleue au hover comme les inputs */
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.3); /* Même effet glow que les inputs */
  background: rgba(255, 255, 255, 0.15); /* Même effet que les inputs:focus */
  transform: translateY(-1px); /* Léger effet de lift */
}

.bt-marche-card {
  padding: 25px;
}

/* === MODE LIGHT - Marché et Financement === */
body.light-mode .bt-marche-card {
  background: rgba(255, 255, 255, 0.3) !important; /* Fond blanc plus accentué */
}

/* Désactiver l'animation de bordure sur cette table */
body.light-mode .bt-marche-card:hover::before {
  animation: none !important; /* Supprime l'animation de bordure */
  opacity: 0 !important; /* Cache l'effet */
}

/* === GESTION AVANCÉE - Table interne seulement === */
/* Fond blanc pour la table interne de Gestion Avancée */
body.light-mode .bt-section .indicator-card[style*="max-width: none"] {
  background: rgba(255, 255, 255, 0.3) !important; /* Même fond blanc */
}

/* Désactiver l'animation de bordure sur la table interne */
body.light-mode .bt-section:hover .indicator-card[style*="max-width: none"]::before {
  animation: none !important; /* Supprime l'animation de bordure */
  opacity: 0 !important; /* Cache l'effet */
}

/* Retirer l'effet de couleur de la table interne (qui contient "Sens du Trade") */
body.light-mode .bt-section:hover .indicator-card[style*="max-width: none"] *,
body.light-mode .bt-section:hover .indicator-card[style*="max-width: none"] label,
body.light-mode .bt-section:hover .indicator-card[style*="max-width: none"] input,
body.light-mode .bt-section:hover .indicator-card[style*="max-width: none"] select,
body.light-mode .bt-section:hover .indicator-card[style*="max-width: none"] button {
  color: inherit !important; /* Garde les couleurs d'origine pour la table interne */
  text-shadow: none !important; /* Supprime l'ombre */
}

/* Suppression des effets de couleur au hover */
body.light-mode .bt-marche-card:hover *,
body.light-mode .bt-section:hover .bt-marche-card *,
body.light-mode .accordion-section:hover .bt-marche-card * {
  color: inherit !important; /* Garde les couleurs d'origine */
}

/* === Tables === */
.bt-results-table, .bt-config-table, .bt-detailed-trades-table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  backdrop-filter: blur(10px);
  border-radius: 15px;
  overflow: hidden;
}

.bt-results-table th,
.bt-results-table td,
.bt-config-table th,
.bt-config-table td,
.bt-detailed-trades-table th,
.bt-detailed-trades-table td {
  padding: 12px 15px;
  text-align: center;
  border-bottom: 1px solid var(--glass-border);
}

.bt-results-table th,
.bt-config-table th,
.bt-detailed-trades-table th {
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent-blue);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* === GESTION AVANCÉE - LABELS ET CELLULES === */
/* Labels en gris foncé pour la table Gestion Avancée */
body.light-mode .indicator-card[style*="max-width: none"] label {
  color: #2d3748 !important; /* Gris foncé pour les labels */
}

/* Cellules avec texte gris foncé et bordure gris clair */
body.light-mode .indicator-card[style*="max-width: none"] input,
body.light-mode .indicator-card[style*="max-width: none"] select {
  color: #2d3748 !important; /* Même gris foncé que les labels */
  border: 1px solid #cbd5e0 !important; /* Bordure gris clair */
}

/* === SECTION STATISTIQUES === */
/* Contour gris pour toutes les cartes de statistiques */
body.light-mode .bt-stat-card {
  border: 1px solid #a0aec0 !important; /* Bordure gris légèrement plus foncé */
}

/* Dégradé violet clair pour la carte "Levier utilisé" */
body.light-mode #leverage-card {
  background: linear-gradient(135deg, #b794f6, #9f7aea) !important; /* Dégradé violet clair */
}

/* === MODE LIGHT - Marché et Financement === */
body.light-mode .bt-marche-card label {
  color: #2563eb !important; /* Labels en bleu */
}

body.light-mode .bt-marche-card input,
body.light-mode .bt-marche-card select {
  color: #000000 !important; /* Texte des champs en noir foncé */
  font-weight: bold !important; /* Bold comme les dates */
}

/* Dates spécifiquement par ID */
body.light-mode #bt_from,
body.light-mode #bt_to {
  color: #000000 !important; /* Dates début et fin en noir */
  font-weight: bold !important; /* Bold */
}

/* Tous les autres champs spécifiques */
body.light-mode #symbol,
body.light-mode #timeframe,
body.light-mode #execution_mode,
body.light-mode #config_id_display {
  color: #000000 !important; /* Noir foncé */
  font-weight: bold !important; /* Bold */
}

/* Bouton reset - contour noir */
body.light-mode #reset-backtest-btn,
body.light-mode .bt-btn-reset {
  border: 2px solid #000000 !important; /* Contour noir */
  color: #000000 !important; /* Texte noir */
}

/* NEUTRALISATION de l'effet hover blanc sur la section Marché et Financement */
body.light-mode .bt-marche-card:hover *,
body.light-mode .bt-section:hover .bt-marche-card *,
body.light-mode .accordion-section:hover .bt-marche-card * {
  color: inherit !important; /* Empêche le texte blanc forcé au hover */
}

/* Réapplication des couleurs au hover pour cette section */
body.light-mode .bt-marche-card:hover label,
body.light-mode .bt-section:hover .bt-marche-card label,
body.light-mode .accordion-section:hover .bt-marche-card label {
  color: #2563eb !important; /* Labels restent bleu */
}

body.light-mode .bt-marche-card:hover input,
body.light-mode .bt-marche-card:hover select,
body.light-mode .bt-section:hover .bt-marche-card input,
body.light-mode .bt-section:hover .bt-marche-card select,
body.light-mode .accordion-section:hover .bt-marche-card input,
body.light-mode .accordion-section:hover .bt-marche-card select {
  color: #000000 !important; /* Champs restent noir bold */
  font-weight: bold !important;
}

body.light-mode .bt-marche-card:hover label {
  color: #2563eb !important; /* Labels restent bleu au hover */
}

body.light-mode .bt-marche-card:hover input,
body.light-mode .bt-marche-card:hover select {
  color: #000000 !important; /* Champs restent noir au hover */
  font-weight: bold !important; /* Gardent le bold */
}

body.light-mode .bt-marche-card:hover #bt_from,
body.light-mode .bt-marche-card:hover #bt_to {
  color: #000000 !important; /* Dates restent noir au hover */
  font-weight: bold !important; /* Gardent le bold */
}

/* === Graphiques === */
.bt-graph-block {
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 15px; /* Réduit de 30px à 15px */
  margin: 20px 0;
  width: 100%; /* Prend toute la largeur disponible */
  box-sizing: border-box; /* Inclut le padding dans la largeur */
  overflow: visible; /* Supprime le scroll */
}

.chart-area {
  position: relative;
  min-height: 500px; /* Remis à 500px pour éviter les déformations */
  width: 100%; /* Prend toute la largeur disponible */
  text-align: center; /* Centre les canvas */
  padding: 5px; /* Réduit de 10px à 5px */
  box-sizing: border-box;
}

.rsi-panel, .macd-panel {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 10px;
  margin: 10px 0;
  transition: all 0.3s ease;
}

/* Premier panneau visible ajoute l'espace en haut */
.rsi-panel:not(.hidden):first-of-type,
.macd-panel:not(.hidden):first-of-type {
  margin-top: 20px;
}

/* Quand les panneaux sont cachés, ils ne prennent aucun espace */
.rsi-panel.hidden, .macd-panel.hidden {
  display: none !important;
}

/* === Support/Résistance Panel === */
.sr-floating-panel {
  position: fixed;
  top: 20%;
  right: 20px;
  width: 350px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  z-index: 9999;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  cursor: grab;
}

.sr-floating-panel:active {
  cursor: grabbing;
}

.sr-floating-panel.dragging {
  transition: none !important;
  transform: none !important;
}

.sr-floating-header {
  padding: 20px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
}

.sr-floating-header h3 {
  color: var(--accent-blue);
  margin: 0;
}

.sr-close-btn {
  background: var(--danger-color);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sr-close-btn:hover {
  transform: scale(1.1);
}

.sr-floating-content {
  padding: 20px;
}

.sr-slider-row {
  margin-bottom: 20px;
}

.sr-slider-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--accent-blue);
  font-weight: 500;
}

.sr-slider-value {
  color: var(--accent-gold);
  font-weight: bold;
}

.sr-slider-input {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.sr-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--button-gradient);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 212, 255, 0.3);
  transition: all 0.3s ease;
}

.sr-slider-input::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.sr-stats-floating {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 20px;
}

.sr-stat-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  transition: all 0.3s ease;
}

.sr-stat-box.updated {
  background: rgba(76, 175, 80, 0.2);
  border-color: #4caf50;
  animation: statUpdate 0.6s ease;
}

@keyframes statUpdate {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.sr-stat-number {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--accent-gold);
  margin-bottom: 5px;
}

.sr-stat-text {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.support-stat {
  border-left: 3px solid var(--success-color);
}

.resistance-stat {
  border-left: 3px solid var(--danger-color);
}

.sr-tune-btn {
  background: var(--button-gradient);
  border: none;
  border-radius: 15px;
  padding: 10px 15px;
  color: white;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  width: 100%;
  margin-top: 10px;
}

.sr-tune-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 212, 255, 0.3);
}

.sr-tune-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(100, 100, 100, 0.3);
}

/* === Toggle switches === */
.trades-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.toggle-switch {
  position: relative;
  width: 50px;
  height: 25px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.2);
  transition: 0.3s;
  border-radius: 25px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 19px;
  width: 19px;
  left: 3px;
  bottom: 3px;
  background: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background: var(--button-gradient);
}

input:checked + .toggle-slider:before {
  transform: translateX(25px);
}

/* === Effets spéciaux === */
.glow-effect {
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from { 
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
  }
  to { 
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.8), 0 0 30px rgba(123, 104, 238, 0.3);
  }
}

/* === Responsive === */
/* Version desktop normale (1200px et plus) */
@media (min-width: 1200px) {
  .main-content {
    max-width: 1650px;
  }
}

/* Zone critique 900px-1199px - Affichage scroll horizontal */
@media (max-width: 1199px) and (min-width: 769px) {
  body {
    overflow-x: auto; /* Force l'affichage du scroll horizontal */
  }
  
  .main-content {
    min-width: 1200px; /* Garde la largeur minimale */
    max-width: none;
    overflow-x: auto;
  }
  
  /* Indicateurs en ligne avec scroll horizontal */
  .bt-indicator-cards {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 10px;
  }
  
  .indicator-card {
    flex-shrink: 0; /* Empêche la compression */
    min-width: 280px;
  }
  
  /* Marché en ligne avec scroll si nécessaire */
  .bt-marche-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    min-width: 1000px;
  }
  
  .bt-marche-row > div {
    flex-shrink: 0;
    min-width: 140px;
  }
}

/* Tablette grande (1024px et moins) */
@media (max-width: 1024px) {
  .main-content {
    max-width: 95%;
    padding: 15px;
  }
  
  .bt-section {
    padding: 25px 20px;
    margin: 20px 0;
  }
  
  .bt-marche-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
  }
  
  .bt-marche-row > div {
    min-width: 120px;
  }
  
  .bt-indicator-cards {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .indicator-card {
    min-width: 250px;
    margin: 10px;
  }
}

/* Tablette (768px et moins) */
@media (max-width: 768px) {
  .main-content {
    padding: 10px;
    margin-top: 20px !important;
    max-width: 100%;
  }
  
  .bt-section {
    padding: 20px 15px;
    margin: 15px 0;
    border-radius: 15px;
  }
  
  .accordion-header {
    font-size: 1.1rem !important;
    padding: 12px 15px !important;
  }
  
  .bt-marche-row {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  
  .bt-marche-row > div {
    width: 100%;
    max-width: 280px;
    text-align: center;
  }
  
  .bt-marche-row label {
    display: block;
    margin-bottom: 5px;
    text-align: center;
  }
  
  .bt-marche-row input,
  .bt-marche-row select {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .bt-stats-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .bt-indicator-cards {
    flex-direction: column;
    align-items: center;
  }
  
  .indicator-card {
    min-width: auto;
    width: 100%;
    max-width: 100%;
    margin: 10px 0;
  }
  
  /* Tables responsive */
  .bt-results-table,
  .bt-config-table,
  .bt-detailed-trades-table {
    font-size: 12px;
    overflow-x: auto;
  }
  
  .bt-results-table th,
  .bt-results-table td,
  .bt-config-table th,
  .bt-config-table td,
  .bt-detailed-trades-table th,
  .bt-detailed-trades-table td {
    padding: 8px 6px;
    white-space: nowrap;
  }
  
  /* Boutons responsive */
  .bt-btn-row {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }
  
  .bt-btn {
    width: 100%;
    max-width: 250px;
    margin: 5px 0 !important;
  }
}

/* Mobile (480px et moins) */
@media (max-width: 480px) {
  .main-content {
    padding: 8px;
  }
  
  .bt-section {
    padding: 15px 10px;
    margin: 10px 0;
    border-radius: 12px;
  }
  
  .accordion-header {
    font-size: 1rem !important;
    padding: 10px 12px !important;
  }
  
  .bt-marche-row > div {
    max-width: 100%;
  }
  
  .indicator-card {
    padding: 15px;
  }
  
  .bt-results-table,
  .bt-config-table,
  .bt-detailed-trades-table {
    font-size: 11px;
  }
  
  .bt-results-table th,
  .bt-results-table td,
  .bt-config-table th,
  .bt-config-table td,
  .bt-detailed-trades-table th,
  .bt-detailed-trades-table td {
    padding: 6px 4px;
  }
  
  .sr-floating-panel {
    width: 95%;
    right: 2.5%;
    left: 2.5%;
    padding: 15px;
  }
  
  .sr-stats-floating {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* === Animations d'entrée === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bt-section {
  animation: fadeInUp 0.6s ease-out;
}

.bt-section:nth-child(even) {
  animation-delay: 0.1s;
}

.bt-section:nth-child(odd) {
  animation-delay: 0.2s;
}

/* === Utilitaires === */
.text-gradient {
  background: var(--text-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass-effect {
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
}

.hidden {
  display: none !important;
}

.disabled {
  opacity: 0.5 !important;
  pointer-events: none !important;
}

/* Forcer RSI à rester toujours visible et actif */
.mon-indicateur-rsi.disabled,
.mon-indicateur-rsi.disabled *,
.mon-indicateur-rsi .disabled {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Empêcher JavaScript de désactiver les inputs RSI */
.mon-indicateur-rsi input:disabled,
.mon-indicateur-rsi select:disabled {
  opacity: 1 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

/* === Configuration spéciale pour l'affichage ID === */
#config_id_display {
  background: transparent !important;
  border: 2px solid var(--accent-purple) !important;
  color: var(--accent-purple) !important;
  font-weight: bold !important;
  text-align: center !important;
  box-shadow: 0 0 10px rgba(168, 71, 243, 0.3) !important;
}

#config_id_display:focus {
  border-color: var(--accent-gold) !important;
  color: var(--accent-gold) !important;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.4) !important;
}

/* SYSTÈME DE BULLES - À ajouter à ton CSS */
.explanation-bubble {
    position: fixed;
    max-width: 330px;
    padding: 20px 20px 20px 20px;
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.9) 100%);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    color: #333;
    z-index: 10005;
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 2px solid rgba(139, 92, 246, 0.3);
    pointer-events: none;
}

/* Bulle élargie pour contenu long (Configs Sauvegardées) */
.explanation-bubble.wide {
    max-width: 450px !important;
}

.explanation-bubble.show {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.explanation-bubble::before {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 15px solid rgba(255,255,255,0.95);
}

/* ✅ SUPPRESSION DE LA FLÈCHE UNIQUEMENT POUR MARCHÉ & FINANCEMENT */
.explanation-bubble.no-arrow::before {
    display: none;
}

.bubble-guru {
    position: absolute;
    right: 15px;
    width: 200px;
    height: 200px;
    opacity: 1 !important; /* ← Force l'opacité à 100% */
    transform: scale(1) !important; /* ← Force l'affichage */
    transition: all 0.4s ease;
}

.bubble-guru.show {
    opacity: 1 !important;
    transform: scale(1) !important;
}

.guru-avatar {
    width: 100%;
    height: 100%;
    background: url('../../assets/img/logo3.png') center/cover no-repeat;
    animation: guruFloat 4s ease-in-out infinite;
}

@keyframes guruFloat {
    0%, 100% { transform: translateY(0px) rotate(-1deg); }
    50% { transform: translateY(-20px) rotate(1deg); }
}

/* ✅ MODE SOMBRE - BULLES D'EXPLICATION */
body.dark-mode .explanation-bubble {
    background: rgba(30, 30, 40, 0.95);
    border: 2px solid rgba(124, 167, 255, 0.3);
    color: #f0f4ff;
}

/* ✅ CORRECTION : Forcer le style light même en dark-mode */
body.light-mode .explanation-bubble {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.9) 100%) !important;
    border: 2px solid rgba(139, 92, 246, 0.3) !important;
    color: #2c3e50 !important; /* Gris très foncé au lieu de #333 */
}

body.light-mode .explanation-bubble::before {
    border-top: 15px solid rgba(255,255,255,0.95) !important;
}

/* ✅ TEXTES SPÉCIFIQUES EN GRIS FONCÉ */
body.light-mode .bubble-title {
    color: #1a202c !important; /* Noir/gris très foncé pour le titre */
}

body.light-mode .bubble-content {
    color: #2d3748 !important; /* Gris foncé pour le contenu */
}

body.light-mode .bubble-tip {
    background: linear-gradient(90deg, #B794F6, #D1A7F7) !important; /* Violet plus clair */
    color: #2c3e50 !important; /* TEXTE gris foncé au lieu de blanc */
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3) !important;
    border-left: 3px solid #8B5CF6 !important; /* Bordure violette au lieu de bleue */
    font-size: 13px !important; /* Taille plus grande : était 12px dans le style de base */
}

/* ✅ NOUVEAUX STYLES : Titres des stratégies et textes des erreurs */
body.light-mode .strategy-item h5 {
    color: #1a202c !important; /* Titres des stratégies en gris très foncé */
}

body.light-mode .strategy-desc {
    color: #2d3748 !important; /* Descriptions des stratégies en gris foncé */
}

body.light-mode .mistakes-list .mistake-fix {
    color: #2d3748 !important; /* Textes des erreurs en gris foncé */
}

body.dark-mode .explanation-bubble::before {
    border-top: 15px solid rgba(30, 30, 40, 0.95);
}

/* ✅ SUPPRESSION DE LA FLÈCHE EN MODE SOMBRE POUR MARCHÉ & FINANCEMENT */
body.dark-mode .explanation-bubble.no-arrow::before {
    display: none;
}

body.dark-mode .bubble-title {
    color: #7ba7ff;
}

body.dark-mode .bubble-content {
    color: #e2e8f0;
}

body.dark-mode .bubble-tip {
    background: rgba(124, 167, 255, 0.15);
    color: #7ba7ff;
    border-left: 3px solid #7ba7ff;
}

.bubble-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 15px; /* ← Augmente de 10px à 15px */
    padding-left: 30px; /* ← AJOUTE cette ligne pour décaler */
}

/* === STYLES SPÉCIFIQUES POUR FRANÇAIS (LTR) === */
[dir="ltr"] .explanation-bubble,
body.ltr .explanation-bubble,
body:not(.rtl) .explanation-bubble {
    direction: ltr;
    text-align: left;
}

[dir="ltr"] .bubble-title,
body.ltr .bubble-title,
body:not(.rtl) .bubble-title {
    flex-direction: row;
    padding-left: 30px;
    padding-right: 0;
    text-align: left;
}

[dir="ltr"] .bubble-guru,
body.ltr .bubble-guru,
body:not(.rtl) .bubble-guru {
    right: 15px;
    left: auto;
}

.bubble-content {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 25px;
}

.bubble-tip {
    background: linear-gradient(90deg, #8B5CF6, #A855F7);
    color: white;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.guru-control {
    display: flex;
    align-items: center;
    gap: 10px; /* Réduit de 15px à 10px pour plus de compacité */
    padding: 6px 12px; /* Encore plus réduit pour une hauteur minimale */
    background: rgba(139, 92, 246, 0.1);
    border-radius: 10px; /* Légèrement réduit pour plus de compacité */
    border: 1px solid rgba(139, 92, 246, 0.3);
    min-height: 36px; /* Aligné sur la hauteur des autres contrôles */
}

.mini-guru {
    width: 36px; /* Encore réduit pour s'harmoniser parfaitement avec la hauteur 36px */
    height: 36px; /* Même hauteur que les autres contrôles */
    position: relative;
}

.mini-guru-avatar {
    width: 100%;
    height: 100%;
    background: url('../../assets/img/logo3.png') center/cover no-repeat;
    border-radius: 50%;
    animation: miniGuruFloat 3s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

@keyframes miniGuruFloat {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-5px) scale(1.05); }
}

.guru-checkbox {
    display: flex;
    align-items: center;
    gap: 6px; /* Réduit de 8px à 6px pour plus de compacité */
    color: #8B5CF6;
    font-size: 14px; /* Légèrement réduit de 16px à 14px pour s'adapter à la taille */
    font-weight: bold;
    cursor: pointer;
}

.guru-checkbox input[type="checkbox"] {
    accent-color: #8B5CF6;
}

/* === THÈME LIGHT POUR BACKTESTING === */
body.light-mode {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 30%, #eef4ff 70%, #e3edff 100%) !important;
    color: #2c3e50 !important;
}

body.light-mode .main-content {
    color: #2c3e50;
    margin-top: 20px !important; /* Garder l'espace aussi en mode light */
}

body.light-mode .bt-section {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.1);
}

body.light-mode .indicator-card {
    background: transparent;
    border: 1px solid rgba(99, 102, 241, 0.7);
    color: #374151;
}

body.light-mode .accordion-header {
    color: #1e293b;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 245, 255, 0.9) 50%, rgba(230, 240, 255, 0.85) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.15);
}

body.light-mode .bt-btn {
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    color: white;
    border: none;
}

body.light-mode .bt-btn:hover {
    background: linear-gradient(135deg, #5b21b6 0%, #3730a3 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

body.light-mode input, 
body.light-mode select {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: #374151;
}

body.light-mode input:focus,
body.light-mode select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

body.light-mode label {
    color: #4b5563;
    font-weight: 500;
}

/* Animation quand désactivé */
.mini-guru.disabled .mini-guru-avatar {
    filter: grayscale(100%) opacity(0.5);
    animation: none;
}

/* === GESTION AVANCÉE HARMONISÉE === */
.bt-section .accordion-content .indicator-card .ind-vars .bt-advcat-row {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(320px, 320px)) !important;
    gap: 20px !important;
    margin-bottom: 20px !important;
    justify-content: center !important;
    padding: 0 10px !important;
    flex-wrap: nowrap !important;
}

.bt-section .accordion-content .indicator-card .ind-vars .bt-advcat-row > div {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    padding: 15px !important;
    min-width: 320px !important;
    max-width: 320px !important;
    width: 320px !important;
    margin: 0 auto !important;
    flex: none !important;
}

.bt-advcat-row label {
    font-size: 18px !important;
    font-weight: 600 !important;
    margin-bottom: 8px !important;
    color: #e2e8f0 !important;
}

.bt-advcat-row input[type="number"] {
    width: 100% !important;
    height: 32px !important;
    padding: 8px 12px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    text-align: center !important;
}

.bt-help {
    font-size: 14px !important;
    color: #94a3b8 !important;
    margin-top: 5px !important;
    line-height: 1.4 !important;
}

.bt-advcat-title {
    font-size: 20px !important;
    font-weight: bold !important;
    color: #8B5CF6 !important;
    margin-bottom: 15px !important;
    padding-bottom: 8px !important;
    border-bottom: 2px solid rgba(139, 92, 246, 0.3) !important;
    transition: color 0.3s ease !important; /* Transition fluide */
}

/* Effet hover - titre devient blanc quand on survole la zone de contenu */
.indicator-card:hover .bt-advcat-title {
    color: #ffffff !important; /* Titre en blanc quand on survole la card */
}

/* Responsive pour gestion avancée */
@media (max-width: 768px) {
    .bt-section .accordion-content .indicator-card .ind-vars .bt-advcat-row {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .bt-section .accordion-content .indicator-card .ind-vars .bt-advcat-row > div {
        min-width: 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }
}

/* ===============================================
   FOOTER STYLES - Position en bas de page
   =============================================== */

/* Structure flexbox pour positionner le footer en bas */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1; /* Prend tout l'espace disponible */
}

footer {
    margin-top: auto;
    padding: 20px 15px;
    background-color: rgba(0,0,0,0.05);
    border-top: 1px solid rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

/* Footer en mode sombre */
body:not(.light-mode) footer,
body.dark-theme footer {
    background-color: rgba(255,255,255,0.05);
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Footer en mode clair */
body.light-mode footer {
    background-color: rgba(0,0,0,0.05);
    border-top: 1px solid rgba(0,0,0,0.1);
}

/* ===============================================
   BULLE STRATÉGIE - DESIGN LÉGER ET ÉLÉGANT
   =============================================== */

.strategy-bubble {
    position: fixed;
    width: 500px;
    max-height: 600px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 255, 0.95) 100%);
    backdrop-filter: blur(25px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(139, 92, 246, 0.3), 0 0 0 1px rgba(139, 92, 246, 0.2);
    z-index: 10000;
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

/* ✅ CORRECTION : Bulle en mode light */
body.light-mode .strategy-bubble {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 255, 0.95) 100%) !important;
    box-shadow: 0 20px 60px rgba(139, 92, 246, 0.3), 0 0 0 1px rgba(139, 92, 246, 0.2) !important;
}

body.light-mode .strategy-bubble-content {
    color: #2c3e50 !important;
}

body.light-mode .bubble-header h3 {
    color: #8B5CF6 !important;
}

body.light-mode .bubble-section p {
    color: #4a5568 !important;
}

body.light-mode .bubble-param .param-name {
    color: #64748b !important;
}

body.light-mode .bubble-signal .signal-text {
    color: #4a5568 !important;
}

.strategy-bubble.show {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Bouton fermer */
.strategy-bubble-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: rgba(139, 92, 246, 0.1);
    border: none;
    border-radius: 50%;
    color: #8B5CF6;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.strategy-bubble-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    transform: rotate(90deg);
}

/* Guru flottant dans la bulle */
.strategy-bubble-guru {
    position: absolute;
    top: 30px; /* MODIFIÉ : Baissé de 40px pour éviter que la tête soit coupée */
    right: 60px;
    width: 100px;
    height: 100px;
    z-index: 5;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-delay: 0.2s;
}

.strategy-bubble.show .strategy-bubble-guru {
    opacity: 1;
    transform: scale(1);
}

.strategy-bubble-guru .strategy-guru-avatar {
    width: 100%;
    height: 100%;
    background: url('../../assets/img/logo3.png') center/cover no-repeat;
    filter: drop-shadow(0 8px 20px rgba(139, 92, 246, 0.4));
    animation: bubbleGuruFloat 3.5s ease-in-out infinite;
}

@keyframes bubbleGuruFloat {
    0%, 100% { transform: translateY(0px) rotate(-2deg); }
    50% { transform: translateY(-15px) rotate(2deg); }
}

/* Contenu de la bulle */
.strategy-bubble-content {
    padding: 25px;
    max-height: 600px;
    overflow-y: auto;
    color: #2c3e50;
}

/* Scrollbar personnalisée */
.strategy-bubble-content::-webkit-scrollbar {
    width: 6px;
}

.strategy-bubble-content::-webkit-scrollbar-track {
    background: rgba(139, 92, 246, 0.05);
    border-radius: 3px;
}

.strategy-bubble-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #8B5CF6, #A855F7);
    border-radius: 3px;
}

/* Header de la bulle */
.bubble-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(139, 92, 246, 0.15);
}

/* RTL: Inverser la direction pour les langues RTL (arabe, hébreu) */
[lang="ar"] .bubble-header,
[lang="he"] .bubble-header,
html[lang="ar"] .bubble-header,
html[lang="he"] .bubble-header {
    flex-direction: row-reverse;
}

/* RTL: Déplacer le guru avatar à gauche pour les langues RTL */
[lang="ar"] .strategy-bubble-guru,
[lang="he"] .strategy-bubble-guru,
html[lang="ar"] .strategy-bubble-guru,
html[lang="he"] .strategy-bubble-guru {
    left: 60px;
    right: auto;
}

.bubble-icon {
    font-size: 36px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #8B5CF6, #A855F7);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.25);
}

.bubble-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #8B5CF6;
    flex: 1;
    line-height: 1.3;
}

/* Sections */
.bubble-section {
    margin-bottom: 20px;
}

.bubble-section h4 {
    font-size: 16px;
    font-weight: 700;
    color: #8B5CF6;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bubble-section p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #4a5568;
    margin: 0;
}

/* Paramètres */
.bubble-param {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(139, 92, 246, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.bubble-param:hover {
    background: rgba(139, 92, 246, 0.1);
    transform: translateX(5px);
}

.bubble-param .param-name {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

.bubble-param .param-value {
    font-size: 14px;
    font-weight: 700;
    color: #8B5CF6;
}

/* Signaux */
.bubble-signal {
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    border-left: 4px solid;
    transition: all 0.2s ease;
}

.bubble-signal:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.bubble-signal-buy {
    background: rgba(16, 185, 129, 0.08);
    border-left-color: #10b981;
}

.bubble-signal-sell {
    background: rgba(239, 68, 68, 0.08);
    border-left-color: #ef4444;
}

.bubble-signal-neutral {
    background: rgba(107, 114, 128, 0.08);
    border-left-color: #6b7280;
}

.bubble-signal .signal-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.bubble-signal-buy .signal-title {
    color: #10b981;
}

.bubble-signal-sell .signal-title {
    color: #ef4444;
}

.bubble-signal-neutral .signal-title {
    color: #6b7280;
}

.bubble-signal .signal-text {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #4a5568;
}

/* Loader */
.strategy-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 15px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(139, 92, 246, 0.2);
    border-top: 3px solid #8B5CF6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.strategy-loading p {
    color: #8B5CF6;
    font-weight: 600;
    font-size: 14px;
}

/* Mode sombre */
body.dark-mode .strategy-bubble {
    background: linear-gradient(135deg, rgba(30, 30, 45, 0.98) 0%, rgba(25, 25, 40, 0.95) 100%);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(139, 92, 246, 0.4);
}

body.dark-mode .strategy-bubble-content {
    color: #e2e8f0;
}

body.dark-mode .bubble-header h3 {
    color: #A78BFA;
}

body.dark-mode .bubble-section p {
    color: #cbd5e0;
}

body.dark-mode .bubble-param {
    background: rgba(139, 92, 246, 0.1);
}

body.dark-mode .bubble-param:hover {
    background: rgba(139, 92, 246, 0.15);
}

body.dark-mode .bubble-param .param-name {
    color: #94a3b8;
}

body.dark-mode .bubble-signal .signal-text {
    color: #cbd5e0;
}

/* ========================================
   STYLES PÉDAGOGIQUES POUR BULLE STRATEGY
   ======================================== */

/* Stratégies pédagogiques */
.pedagogy-strategies {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.strategy-item {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), rgba(168, 85, 247, 0.03));
    border-radius: 12px;
    padding: 18px;
    border-left: 4px solid #8B5CF6;
    transition: all 0.3s ease;
}

.strategy-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.15);
}

.strategy-item.conservative {
    border-left-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(16, 185, 129, 0.03));
}

.strategy-item.balanced {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), rgba(245, 158, 11, 0.03));
}

.strategy-item.aggressive {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(239, 68, 68, 0.03));
}

.strategy-item h5 {
    margin: 0 0 12px 0;
    font-size: 15px;
    font-weight: 700;
    color: #374151;
}

.strategy-signals {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.signal-buy, .signal-sell {
    font-size: 13px;
    line-height: 1.5;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
}

.signal-buy {
    border-left: 3px solid #10b981;
}

.signal-sell {
    border-left: 3px solid #ef4444;
}

.strategy-desc {
    font-size: 13px;
    line-height: 1.6;
    color: #6b7280;
    font-style: italic;
    margin: 0;
}

/* Conseils avancés */
.advanced-tips {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tip-item {
    background: rgba(59, 130, 246, 0.05);
    border-radius: 10px;
    padding: 15px;
    border-left: 3px solid #3b82f6;
}

.tip-item h6 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #3b82f6;
}

.tip-item p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #4b5563;
}

/* Erreurs à éviter */
.mistakes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mistake-item {
    background: rgba(239, 68, 68, 0.05);
    border-radius: 10px;
    padding: 15px;
    border-left: 3px solid #ef4444;
}

.mistake-title {
    font-size: 14px;
    font-weight: 600;
    color: #ef4444;
    margin-bottom: 6px;
}

.mistake-fix {
    font-size: 13px;
    line-height: 1.6;
    color: #4b5563;
}

/* Mode sombre - Styles pédagogiques */
body.dark-mode .strategy-item {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(168, 85, 247, 0.05));
}

body.dark-mode .strategy-item h5 {
    color: #e2e8f0;
}

body.dark-mode .signal-buy, 
body.dark-mode .signal-sell {
    background: rgba(0, 0, 0, 0.2);
}

body.dark-mode .strategy-desc {
    color: #9ca3af;
}

body.dark-mode .tip-item {
    background: rgba(59, 130, 246, 0.1);
}

body.dark-mode .tip-item h6 {
    color: #60a5fa;
}

body.dark-mode .tip-item p {
    color: #d1d5db;
}

body.dark-mode .mistake-item {
    background: rgba(239, 68, 68, 0.1);
}

body.dark-mode .mistake-title {
    color: #fca5a5;
}

body.dark-mode .mistake-fix {
    color: #d1d5db;
}

/* ========================================
   ILLUSTRATION GRAPHIQUE MINI-CHART
   ======================================== */

.chart-illustration-wrapper {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.02), rgba(168, 85, 247, 0.01));
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.chart-illustration-wrapper .strategy-illustration {
    margin: 0 !important;
    padding: 0 !important;
}

.chart-illustration-wrapper canvas {
    max-height: 200px !important;
    width: 100% !important;
}

.chart-illustration {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.02), rgba(168, 85, 247, 0.01));
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.mini-chart {
    width: 100%;
    height: auto;
    max-height: 200px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
}

.chart-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 11px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-color {
    width: 12px;
    height: 3px;
    border-radius: 2px;
}

.legend-item span {
    color: #4b5563;
    font-size: 11px;
    font-weight: 500;
}

/* Mode sombre - Illustration */
body.dark-mode .chart-illustration {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), rgba(168, 85, 247, 0.02));
    border-color: rgba(139, 92, 246, 0.2);
}

body.dark-mode .mini-chart {
    background: rgba(0, 0, 0, 0.2);
}

body.dark-mode .legend-item span {
    color: #d1d5db;
}

/* ✅ Désactiver COMPLÈTEMENT tous les événements de la carte parente quand on survole le bouton */
.indicator-card:has(.strategy-info-btn:hover) {
    pointer-events: none !important;
}

/* Mais réactiver les événements sur le bouton lui-même */
.strategy-info-btn:hover {
    pointer-events: auto !important;
}

/* ✅ Désactiver la bulle de hover sur le bouton "Voir Stratégie" */
.strategy-info-btn {
    position: relative;
    pointer-events: auto !important; /* Force les événements sur le bouton */
}

/* Empêcher COMPLÈTEMENT la propagation des événements du bouton vers la card */
.indicator-card .strategy-info-btn {
    isolation: isolate; /* Crée un nouveau contexte d'empilement */
}

/* Empêcher la bulle d'explication d'apparaître sur ce bouton */
.strategy-info-btn:hover + .explanation-bubble,
.strategy-info-btn ~ .explanation-bubble {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Responsive */
@media (max-width: 768px) {
    .strategy-bubble {
        width: 95vw;
        max-width: 450px;
        max-height: 80vh;
    }
    
    .strategy-bubble-guru {
        width: 80px;
        height: 80px;
        right: 50px;
    }
    
    .bubble-icon {
        width: 50px;
        height: 50px;
        font-size: 28px;
    }
    
    .bubble-header h3 {
        font-size: 18px;
    }
}

/* ✅ Faire que les cards d'indicateurs aient le bouton en bas */
.indicator-card {
    display: flex;
    flex-direction: column;
}

.indicator-card .mon-indicateur-rsi,
.indicator-card .mon-indicateur-macd,
.indicator-card .mon-indicateur-ema,
.indicator-card .mon-indicateur-bb,
.indicator-card .mon-indicateur-atr,
.indicator-card .mon-indicateur-ichimoku,
.indicator-card .mon-indicateur-fibonacci,
.indicator-card .mon-indicateur-sr {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.indicator-card .strategy-info-btn {
    margin-top: auto !important;
}

/* ✅ Désactiver la bulle de hover pour les cards TP et SL */
.bt-indicator-cards[id="tp-strip"] .indicator-card,
.bt-indicator-cards[id="sl-strip"] .indicator-card,
.bt-indicator-cards[id="tp-strip"] .indicator-card *,
.bt-indicator-cards[id="sl-strip"] .indicator-card * {
    pointer-events: auto !important; /* La card reste cliquable */
}

/* Empêcher TOTALEMENT la bulle d'explication d'apparaître sur les cards TP et SL */
.bt-indicator-cards[id="tp-strip"] .indicator-card,
.bt-indicator-cards[id="sl-strip"] .indicator-card {
    position: relative !important;
}

/* ✅ CODE SUPPRIMÉ - Les boutons TP/SL doivent fonctionner normalement */

/* ===== ICHIMOKU COMPLETE SECTIONS - VERSION AMÉLIORÉE ===== */

/* Les 3 Blocs de Base */
.ichimoku-basic-blocks {
    display: grid;
    gap: 1.2rem;
    margin: 1.5rem 0;
}

.ichimoku-block {
    background: linear-gradient(135deg, rgba(147, 197, 253, 0.15), rgba(196, 181, 253, 0.1));
    border: 2px solid rgba(147, 197, 253, 0.4);
    border-radius: 12px;
    padding: 1.2rem;
    position: relative;
    transition: all 0.3s ease;
}

.ichimoku-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(147, 197, 253, 0.2);
    border-color: rgba(147, 197, 253, 0.6);
}

.ichimoku-block h6 {
    font-size: 16px;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 0.8rem;
}

.ichimoku-block p {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 0.6rem;
}

.ichimoku-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    color: white;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: bold;
    margin-right: 0.6rem;
}

/* Les 5 Composants */
.ichimoku-components {
    margin: 2rem 0;
    background: rgba(167, 243, 208, 0.15);
    border-left: 4px solid #34d399;
    border-radius: 10px;
    padding: 1.8rem;
}

.ichimoku-components h5 {
    color: #059669;
    margin-bottom: 1.2rem;
    font-size: 16px;
    font-weight: 600;
}

.component-item {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(167, 243, 208, 0.4);
    border-radius: 10px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.component-item:hover {
    background: rgba(167, 243, 208, 0.2);
    border-color: rgba(167, 243, 208, 0.6);
    transform: translateY(-1px);
}

.component-item h6 {
    color: #047857;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    font-size: 15px;
    font-weight: 600;
}

.component-item p {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 0.4rem;
}

/* Les 7 Stratégies */
.ichimoku-strategies {
    margin: 2rem 0;
    background: rgba(252, 165, 165, 0.15);
    border-left: 4px solid #f87171;
    border-radius: 10px;
    padding: 1.8rem;
}

.ichimoku-strategies h5 {
    color: #dc2626;
    margin-bottom: 1.2rem;
    font-size: 16px;
    font-weight: 600;
}

.strategy-item {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(252, 165, 165, 0.4);
    border-radius: 12px;
    padding: 1.4rem;
    margin-bottom: 1.2rem;
    transition: all 0.3s ease;
}

.strategy-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(252, 165, 165, 0.15);
    border-color: rgba(252, 165, 165, 0.6);
}

.strategy-item h6 {
    font-size: 15px;
    font-weight: 600;
    color: #b91c1c;
    margin-bottom: 0.8rem;
}

.strategy-signals {
    background: rgba(243, 244, 246, 0.8);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.strategy-signals p {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.strategy-tip {
    background: rgba(254, 215, 170, 0.3);
    border: 1px solid rgba(251, 191, 36, 0.4);
    border-radius: 8px;
    padding: 0.8rem;
    font-size: 14px;
    color: #92400e;
    margin-top: 1rem;
    line-height: 1.4;
}

/* Conseils Avancés */
.ichimoku-advanced-tips {
    margin: 2rem 0;
    background: rgba(254, 215, 170, 0.15);
    border-left: 4px solid #fbbf24;
    border-radius: 10px;
    padding: 1.8rem;
}

.ichimoku-advanced-tips h5 {
    color: #d97706;
    margin-bottom: 1.2rem;
    font-size: 16px;
    font-weight: 600;
}

.tip-item {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(254, 215, 170, 0.4);
    border-radius: 10px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.tip-item:hover {
    background: rgba(254, 215, 170, 0.2);
    border-color: rgba(254, 215, 170, 0.6);
}

.tip-item h6 {
    color: #b45309;
    margin-bottom: 0.6rem;
    font-size: 15px;
    font-weight: 600;
}

.tip-item p {
    font-size: 14px;
    line-height: 1.5;
}

/* Erreurs Fatales */
.ichimoku-mistakes {
    margin: 2rem 0;
    background: rgba(254, 202, 202, 0.15);
    border-left: 4px solid #f87171;
    border-radius: 10px;
    padding: 1.8rem;
}

.ichimoku-mistakes h5 {
    color: #dc2626;
    margin-bottom: 1.2rem;
    font-size: 16px;
    font-weight: 600;
}

.mistake-item {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(254, 202, 202, 0.4);
    border-radius: 10px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.mistake-item:hover {
    background: rgba(254, 202, 202, 0.15);
    border-color: rgba(254, 202, 202, 0.6);
}

.mistake-item h6 {
    color: #b91c1c;
    margin-bottom: 0.6rem;
    font-size: 15px;
    font-weight: 600;
}

.mistake-item p {
    font-size: 14px;
    line-height: 1.5;
}

/* Combos Ultimes */
.ichimoku-combos {
    margin: 2rem 0;
    background: rgba(196, 181, 253, 0.15);
    border-left: 4px solid #a78bfa;
    border-radius: 10px;
    padding: 1.8rem;
}

.ichimoku-combos h5 {
    color: #7c3aed;
    margin-bottom: 1.2rem;
    font-size: 16px;
    font-weight: 600;
}

.combo-item {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(196, 181, 253, 0.4);
    border-radius: 10px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.combo-item:hover {
    background: rgba(196, 181, 253, 0.2);
    border-color: rgba(196, 181, 253, 0.6);
    transform: translateY(-1px);
}

.combo-item h6 {
    color: #6d28d9;
    margin-bottom: 0.6rem;
    font-size: 15px;
    font-weight: 600;
}

.combo-item p {
    font-size: 14px;
    line-height: 1.5;
}

/* Guide Rapide */
.ichimoku-quick-guide {
    margin: 2rem 0;
    background: rgba(165, 243, 252, 0.15);
    border-left: 4px solid #22d3ee;
    border-radius: 10px;
    padding: 1.8rem;
}

.ichimoku-quick-guide h5 {
    color: #0891b2;
    margin-bottom: 1.2rem;
    font-size: 16px;
    font-weight: 600;
}

.guide-item {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    font-size: 14px;
    line-height: 1.5;
}

.guide-item.bullish {
    border-left: 4px solid #34d399;
    background: rgba(167, 243, 208, 0.2);
}

.guide-item.bearish {
    border-left: 4px solid #f87171;
    background: rgba(252, 165, 165, 0.2);
}

.guide-item.confusion {
    border-left: 4px solid #fbbf24;
    background: rgba(254, 215, 170, 0.2);
}

.guide-item strong {
    font-size: 15px;
    font-weight: 600;
}

/* Règle d'Or */
.ichimoku-golden-rule {
    margin: 2rem 0;
    background: linear-gradient(135deg, rgba(254, 215, 170, 0.2), rgba(252, 211, 77, 0.1));
    border: 2px solid rgba(251, 191, 36, 0.5);
    border-radius: 14px;
    padding: 2.2rem;
    text-align: center;
}

.ichimoku-golden-rule h5 {
    color: #b45309;
    margin-bottom: 1.2rem;
    font-size: 17px;
    font-weight: 700;
}

.golden-rule-desc {
    font-size: 15px;
    color: #92400e;
    font-weight: 500;
    margin-bottom: 1.8rem;
    font-style: italic;
    line-height: 1.4;
}

.golden-principles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
    margin-top: 1.8rem;
}

.principle-item {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(251, 191, 36, 0.4);
    border-radius: 12px;
    padding: 1.4rem;
    text-align: center;
    transition: all 0.3s ease;
}

.principle-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.6);
}

.principle-icon {
    font-size: 2rem;
    margin-bottom: 0.6rem;
}

.principle-item strong {
    display: block;
    color: #b45309;
    margin-bottom: 0.6rem;
    font-size: 15px;
    font-weight: 600;
}

.principle-item p {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.4;
}

/* Mode Sombre pour toutes les sections Ichimoku - VERSION AMÉLIORÉE */
body.dark-mode .ichimoku-block {
    background: linear-gradient(135deg, rgba(147, 197, 253, 0.25), rgba(196, 181, 253, 0.15));
    border-color: rgba(147, 197, 253, 0.5);
}

body.dark-mode .ichimoku-components {
    background: rgba(167, 243, 208, 0.2);
}

body.dark-mode .ichimoku-strategies {
    background: rgba(252, 165, 165, 0.2);
}

body.dark-mode .ichimoku-advanced-tips {
    background: rgba(254, 215, 170, 0.2);
}

body.dark-mode .ichimoku-mistakes {
    background: rgba(254, 202, 202, 0.2);
}

body.dark-mode .ichimoku-combos {
    background: rgba(196, 181, 253, 0.2);
}

body.dark-mode .ichimoku-quick-guide {
    background: rgba(165, 243, 252, 0.2);
}

body.dark-mode .ichimoku-golden-rule {
    background: linear-gradient(135deg, rgba(254, 215, 170, 0.3), rgba(252, 211, 77, 0.15));
    border-color: rgba(251, 191, 36, 0.6);
}

body.dark-mode .component-item,
body.dark-mode .strategy-item,
body.dark-mode .tip-item,
body.dark-mode .mistake-item,
body.dark-mode .combo-item,
body.dark-mode .guide-item,
body.dark-mode .principle-item {
    background: rgba(241, 233, 249, 0.6);
    color: #8496bc;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .strategy-signals {
    background: rgba(232, 225, 233, 0.4);
}

body.dark-mode .strategy-tip {
    background: rgba(254, 215, 170, 0.2);
    border-color: rgba(251, 191, 36, 0.4);
    color: #fbbf24;
}

body.dark-mode .golden-rule-desc {
    color: #e764f1;
}

body.dark-mode .principle-item p {
    color: #d1d5db;
}

body.dark-mode .ichimoku-block h6,
body.dark-mode .component-item h6,
body.dark-mode .strategy-item h6,
body.dark-mode .tip-item h6,
body.dark-mode .mistake-item h6,
body.dark-mode .combo-item h6 {
    color: #535a68;
}

body.dark-mode .ichimoku-components h5 {
    color: #6ee7b7;
}

body.dark-mode .ichimoku-strategies h5 {
    color: #fca5a5;
}

body.dark-mode .ichimoku-advanced-tips h5 {
    color: #fcd34d;
}

body.dark-mode .ichimoku-mistakes h5 {
    color: #fca5a5;
}

body.dark-mode .ichimoku-combos h5 {
    color: #c4b5fd;
}

body.dark-mode .ichimoku-quick-guide h5 {
    color: #67e8f9;
}

body.dark-mode .ichimoku-golden-rule h5 {
    color: #fcd34d;
}

/* Responsive pour mobile - VERSION AMÉLIORÉE */
@media (max-width: 768px) {
    .ichimoku-basic-blocks {
        gap: 1rem;
    }
    
    .ichimoku-block,
    .component-item,
    .strategy-item,
    .tip-item,
    .mistake-item,
    .combo-item {
        padding: 1rem;
    }
    
    .ichimoku-components,
    .ichimoku-strategies,
    .ichimoku-advanced-tips,
    .ichimoku-mistakes,
    .ichimoku-combos,
    .ichimoku-quick-guide {
        padding: 1.2rem;
    }
    
    .ichimoku-golden-rule {
        padding: 1.5rem;
    }
    
    .golden-principles {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .principle-item {
        padding: 1.2rem;
    }
    
    /* Titres plus petits sur mobile */
    .ichimoku-block h6,
    .component-item h6,
    .strategy-item h6,
    .tip-item h6,
    .mistake-item h6,
    .combo-item h6 {
        font-size: 15px;
    }
    
    .ichimoku-components h5,
    .ichimoku-strategies h5,
    .ichimoku-advanced-tips h5,
    .ichimoku-mistakes h5,
    .ichimoku-combos h5,
    .ichimoku-quick-guide h5,
    .ichimoku-golden-rule h5 {
        font-size: 15px;
    }
    
    .golden-rule-desc {
        font-size: 14px;
    }
    
    .principle-item strong {
        font-size: 14px;
    }
    
    .principle-item p {
        font-size: 13px;
    }
}

/* ===== END ICHIMOKU COMPLETE SECTIONS - VERSION AMÉLIORÉE ===== */

/* ========================================
   🌍 RTL SUPPORT - GURU AVATARS
   Position des Guru avatars à GAUCHE en mode RTL (hébreu, arabe)
   ======================================== */

/* 1. Guru dans les titres des blocs de gestion avancée (float: right devient float: left) */
[lang="ar"] .bt-advcat-title .guide-trigger-card,
[lang="he"] .bt-advcat-title .guide-trigger-card,
html[lang="ar"] .bt-advcat-title .guide-trigger-card,
html[lang="he"] .bt-advcat-title .guide-trigger-card {
    float: left !important;
    margin-left: -20px !important;
    margin-right: 0 !important;
}

/* 2. Guru dans les headers d'accordéon (position absolute: right devient left) */
[lang="ar"] .accordion-header .guide-trigger-card,
[lang="he"] .accordion-header .guide-trigger-card,
html[lang="ar"] .accordion-header .guide-trigger-card,
html[lang="he"] .accordion-header .guide-trigger-card {
    left: 50px !important;
    right: auto !important;
}

/* 3. Guru dans les cartes d'indicateurs (position bottom) */
[lang="ar"] .guide-buttons-wrapper,
[lang="he"] .guide-buttons-wrapper,
html[lang="ar"] .guide-buttons-wrapper,
html[lang="he"] .guide-buttons-wrapper {
    flex-direction: row-reverse !important;
}

[lang="ar"] .guide-buttons-wrapper .guide-trigger-card,
[lang="he"] .guide-buttons-wrapper .guide-trigger-card,
html[lang="ar"] .guide-buttons-wrapper .guide-trigger-card,
html[lang="he"] .guide-buttons-wrapper .guide-trigger-card {
    margin-right: 0 !important;
    margin-left: 10px !important;
}

/* 4. Ajustement du padding pour les textes RTL */
[lang="ar"] .bt-advcat-title,
[lang="he"] .bt-advcat-title,
html[lang="ar"] .bt-advcat-title,
html[lang="he"] .bt-advcat-title {
    padding-left: 60px !important;
    padding-right: 10px !important;
}

/* 5. Icône de stratégie (75%) reste à droite en RTL, devient à gauche */
[lang="ar"] .guide-buttons-wrapper .btn-strategy,
[lang="he"] .guide-buttons-wrapper .btn-strategy,
html[lang="ar"] .guide-buttons-wrapper .btn-strategy,
html[lang="he"] .guide-buttons-wrapper .btn-strategy {
    margin-right: 0 !important;
    margin-left: auto !important;
}

/* 6. Bubble Guru position en RTL - À DROITE (en dehors de la bulle) */
[lang="ar"] .bubble-guru,
[lang="he"] .bubble-guru,
html[lang="ar"] .bubble-guru,
html[lang="he"] .bubble-guru {
    right: -200px !important;
    left: auto !important;
}

/* 7. Ajustement général des headers pour RTL */
[lang="ar"] .accordion-header,
[lang="he"] .accordion-header,
html[lang="ar"] .accordion-header,
html[lang="he"] .accordion-header {
    padding-left: 100px !important;
    padding-right: 50px !important;
}

/* ===== END RTL SUPPORT ===== */