/* --- FORCER L'INTERFACE AU-DESSUS DE TOUT (WordPress safe) --- */
.layout-container{
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: var(--app-height, 100dvh) !important;
  z-index: 999 !important;
}

/* évite que la page scroll derrière */
html, body{
  overflow: hidden !important;
}

/* sécurise le plan des calques internes */
.sidebar{ z-index: 2147483646 !important; }
.main-content{ position: relative !important; z-index: 1 !important; }

/* sur mobile, sidebar ouverte doit passer au-dessus du chatbot */
@media (max-width: 768px){
  .sidebar.open{ z-index: 2147483647 !important; }
}

/* --- RESET & POLICE --- */
*:not(i):not([class*="fa-"]) {
  box-sizing: border-box !important;
  margin: 0;
  padding: 0;
  font-family: 'Quicksand', sans-serif !important;
  line-height: normal;
}

.fa, .fas, .far, .fab, .fa-solid, .fa-regular {
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  display: inline-block !important;
}

body, html {
  height: 100% !important;
  width: 100% !important;
  overflow: hidden !important;
  position: fixed;
  background-color: #f8fafc;
}

/* --- LAYOUT --- */
.layout-container {
  display: flex !important;
  height: var(--app-height, 100dvh) !important;
  width: 100% !important;
  gap: 0 !important;
  background: #ffffff !important;
}

/* --- SIDEBAR --- */
.sidebar {
  background-color: #ffffff !important;
  position: relative;
  height: 100% !important;
  width: 270px !important;
  min-width: 270px !important;
  padding: 25px 18px !important;
  overflow-y: auto;
  display: flex !important;
  flex-direction: column !important;
  gap: 18px !important; /* réduit */
  border-right: 1px solid rgba(0,0,0,0.08) !important;
  overflow-x: hidden !important;

  background-image:
    radial-gradient(at 0% 0%, rgba(232, 13, 101, 0.08) 0%, transparent 45%),
    radial-gradient(at 100% 20%, rgba(147, 51, 234, 0.08) 0%, transparent 45%),
    radial-gradient(at 0% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 45%),
    radial-gradient(at 100% 80%, rgba(232, 13, 101, 0.08) 0%, transparent 45%),
    radial-gradient(at 0% 100%, rgba(147, 51, 234, 0.08) 0%, transparent 45%) !important;
  background-attachment: local;
}

/* --- BLOC LOGO --- */
.brand-block {
  background-color: transparent !important;
  border-radius: 18px;
  padding: 10px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 75px;
  position: relative;
}
.brand-block::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; width: 100%; height: 3px;
  background: linear-gradient(to right, #fcd34d, #f97316, #e11d48, #9333ea, #2563eb);
}
.brand-logo-img {
  width: auto !important;
  height: 52px !important;
  max-width: 100%;
  object-fit: contain !important;
}

/* --- TITRES / GROUPS --- */
.menu-group { display: flex !important; flex-direction: column !important; gap: 10px !important; }
.group-title {
  font-weight: 800 !important;
  color: #64748b !important;
  font-size: 0.72rem !important;
  margin: 6px 0 4px 8px !important;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* --- BOUTONS --- */
.menu-btn {
  background-color: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 16px !important;
  padding: 10px 15px !important;
  width: 100% !important;
  text-align: left !important;
  cursor: pointer;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  color: #1e293b !important;
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  transition: all 0.25s ease;
  text-decoration: none !important;
  min-height: 48px !important;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}
.menu-btn:hover {
  transform: translateY(-2px);
  background-color: #f8fafc !important;
  border-color: #94a3b8 !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12) !important;
}

/* ACTIF : MAGENTA */
.menu-btn.active {
  background-color: #ffffff !important;
  border-color: #D735C3 !important;
  box-shadow: inset 6px 0 0 #D735C3, 0 8px 25px rgba(215, 53, 195, 0.15) !important;
  padding-left: 22px !important;
  color: #D735C3 !important;
}
.menu-btn i {
  width: 20px !important;
  text-align: center;
  color: #475569 !important;
  font-size: 1.1rem !important;
  transition: color 0.2s ease;
}
.menu-btn:hover i,
.menu-btn.active i { color: #D735C3 !important; }

/* --- Mise en avant "Discussion libre" via bordure dégradée --- */
.menu-btn--primary{
  background-color: #ffffff !important;
  border: 2px solid transparent !important;
  background-image:
    linear-gradient(#ffffff, #ffffff),
    linear-gradient(90deg,#fcd34d,#f97316,#e11d48,#9333ea,#2563eb);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 6px 18px rgba(0,0,0,0.10) !important;
}
.menu-btn--primary i{ color: #475569 !important; }
.menu-btn--primary:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0,0,0,0.14) !important;
}

/* --- SUPPORT --- */
.help-block--support{ text-align: center; }
.support-title{
  font-weight: 800;
  font-size: 0.8rem;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}



/* --- MAIN CONTENT / CHATBOT --- */
.main-content {
  flex: 1 !important;
  background-color: #ffffff;
  position: relative !important;
  height: 100% !important;
  overflow: hidden !important;
  margin-left: 0 !important;
}
#botnation-chatbox-messenger-container, #chatbotgpt {
  height: 100% !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* --- HAMBURGER : caché desktop --- */
.hamburger-container { display: none !important; }

/* --- FIX hamburger: pas de cadre gris / pas d'outline --- */
.hamburger-btn{
  border: none !important;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
.hamburger-btn:focus,
.hamburger-btn:focus-visible{
  outline: none !important;
  box-shadow: none !important;
}

/* --- LOADER --- */
#ai-loading-overlay {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: none;
  width: 64px;
  height: 64px;
  background-color: white;
  border-radius: 50%;
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
  justify-content: center;
  align-items: center;
  animation: slideUpFade 0.3s ease-out, pulseRing 2s infinite;
}
.custom-loader-ring {
  width: 42px; height: 42px; border-radius: 50%;
  background: conic-gradient(#fcd34d, #f97316, #e11d48, #9333ea, #2563eb);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #fff 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #fff 0);
  animation: spinLoader 1s linear infinite;
}
@keyframes slideUpFade { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes spinLoader { to { transform: rotate(1turn); } }
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(215, 53, 195, 0.2); }
  70% { box-shadow: 0 0 0 20px rgba(215, 53, 195, 0); }
  100% { box-shadow: 0 0 0 0 rgba(215, 53, 195, 0); }
}

/* --- BACKDROP sidebar (clic à côté) --- */
#sidebar-backdrop{
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;

  /* IMPORTANT : par défaut on ne met PAS left:0 ici */
  left: 0;

  display: none;
  background: transparent; /* capte le clic sans masquer */
  z-index: 2147483644;     /* sous la sidebar */
  pointer-events: none;
}


/* --- MOBILE --- */
@media (max-width: 768px) {
  .hamburger-container { display: flex !important; justify-content: center; margin-bottom: 15px; }

  .sidebar {
    position: relative !important;
    width: 70px !important;
    min-width: 70px !important;
    padding: 15px 12px !important; /* padding côtés */
    height: 100% !important;
  }

  .sidebar:not(.open) .group-title,
  .sidebar:not(.open) .menu-btn span,
  .sidebar:not(.open) .help-block { display: none !important; }

  .sidebar:not(.open) .brand-block { background: transparent !important; border: none !important; box-shadow: none !important; min-height: auto !important; padding: 5px !important; }

  .sidebar:not(.open) .brand-logo-img {
    height: 38px !important;
    width: 38px !important;
  }

  .sidebar:not(.open) .menu-btn {
    padding: 0 !important;
    justify-content: center !important;
    height: 48px !important;
    width: 48px !important;
    margin: 0 auto !important;
    border-radius: 50% !important;
    box-shadow: 0 6px 15px rgba(0,0,0,0.1) !important;
  }

  .sidebar.open {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    height: 100% !important;
    width: 280px !important;
    min-width: 280px !important;
    box-shadow: 15px 0 30px rgba(0,0,0,0.15) !important;
  }

  .main-content {
    margin-left: 0 !important;
    width: auto !important;
    flex: 1 !important;
  }
}

/* --- iOS Safari FIX (barre blanche + zone saisie) --- */
.layout-container{
  top: var(--app-top, 0px) !important;
  height: var(--app-height, 100svh) !important;
}
.layout-container{
  padding-top: env(safe-area-inset-top) !important;
  padding-bottom: env(safe-area-inset-bottom) !important;
}
.main-content{
  padding-bottom: env(safe-area-inset-bottom) !important;
}

/* --- Logo plus grand sur desktop --- */
@media (min-width: 1024px) {
  .brand-logo-img{ height: 70px !important; }
}



/* === HELP BLOCK : rendu EXACT (carte + pill magenta centré) === */
.help-block.help-block--support{
  background-color: rgba(255, 255, 255, 0.6) !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 20px !important;
  padding: 12px !important;

  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 8px !important;

  box-shadow: 0 4px 15px rgba(0,0,0,0.03) !important;
  text-align: center !important;
}

.help-block--support .support-title{
  font-weight: 800 !important;
  font-size: 0.8rem !important;
  color: #334155 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
}




/* ===== HELP BLOCK (version finale) ===== */

/* la "carte" avec bordure comme ta capture */
.help-block.help-block--support{
  background-color: rgba(255, 255, 255, 0.6) !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 20px !important;
  padding: 12px !important;

  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;   /* empêche le stretch */
  gap: 8px !important;

  box-shadow: 0 4px 15px rgba(0,0,0,0.03) !important;
  text-align: center !important;
}

.help-block--support .support-title{
  font-weight: 800 !important;
  font-size: 0.8rem !important;
  color: #334155 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
}

/* le pill magenta FIN (comme ta capture) */
.help-block--support #supportBtn{
  appearance: none !important;
  -webkit-appearance: none !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: fit-content !important;   /* ultra robuste */
  max-width: 100% !important;
  min-width: 210px !important;     /* largeur du pill */
  padding: 7px 18px !important;    /* <= moins haut */
  height: 30px !important;         /* <= moins haut */
  line-height: 1 !important;

  background: linear-gradient(90deg, #6366f1, #9333ea) !important;
  color: #fff !important;

  border: 0 !important;
  border-radius: 999px !important;

  font-weight: 800 !important;
  font-size: 0.78rem !important;   /* <= moins gros */
  letter-spacing: 0.2px !important;

  box-shadow: 0 10px 22px rgba(99,102,241,0.20) !important;
  cursor: pointer !important;
  transform: none !important;      /* évite les décalages */
}

.help-block--support #supportBtn:hover{
  transform: translateY(-1px) !important;
  box-shadow: 0 14px 30px rgba(99,102,241,0.28) !important;
}