/*
 Theme Name:  astra Child
 Template:    astra        
 Description: Child theme pour CORTICOMED
 Version:     1.0
*/

/* ======================================= */
/* ===== CORTICOMED: Toast "Copié !" ===== */
/* ======================================= */

.ctc-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: #111;
  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  z-index: 9999;
}

.ctc-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================== */
/* ====== LAYOUT & STRUCTURE PRINCIPALE (MENU LATERALE) ====== */
/* =========================================================== */

/* layout général */
.ctc-layout {
  display: flex !important; 
  flex-direction: row !important; 
  align-items: stretch;
  min-height: 100vh;
  background: #f8fafc;
}

/* barre latérale */
.ctc-sidebar {
  flex: 0 0 14%; /* Elle occupera toujours 20% de la largeur du parent */
  min-width: 10em; /* Sécurité pour ne pas qu'elle soit trop étroite sur petit écran */
  background: #ffffff;
  border-right: 1px solid rgba(0,0,0,0.05);
  min-height: 100vh;
  display: block; 
  padding-top: 2rem;
  padding-bottom: 2rem;
  box-sizing: border-box;  
}

/* CORRECTION MENU: Supprime les puces et les marges/padding par défaut */
.ctc-menu ul,
.ctc-menu li {
  list-style: none !important; 
  margin: 0;
  padding: 0;
}

.ctc-menu li {
  padding-left: 0 !important;
}

.ctc-menu a {
  display: block;
  padding: 10px 2px;
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ctc-menu a:hover {
  background-color: #f0f0f0;
}

.ctc-menu .current-menu-item > a,
.ctc-menu a.active {
  background-color: #e0e0e0;
  color: #000;
  font-weight: 600;
}

.ctc-submenu {
  padding-left: 15px;
  border-left: 3px solid #ccc;
  margin-top: 5px;
  margin-bottom: 5px;
}

.ctc-submenu a {
  font-weight: 400;
  font-size: 0.95em;
  padding-top: 6px;
  padding-bottom: 6px;
}

.ctc-menu .ctc-submenu {
  list-style: none !important;
  padding-left: 15px;
  background-color: white;
  margin: -40px 0px 5px 13em;
  display: block;
  z-index: 99999;
}

.has-submenu .submenu-toggle {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 20px;
  font-size: 1em;
  color: #333;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.has-submenu .submenu-toggle:hover {
  background-color: #f0f0f0;
}

.submenu-toggle .chevron {
  float: right;
  transition: transform 0.15s ease;
}

.has-submenu.open .submenu-toggle .chevron {
  transform: rotate(180deg);
}

/* contenu */
.ctc-content {
  flex: 1 1 auto; /* Le "1" permet de remplir tout l'espace disponible */
  padding: 1.5rem 0.2rem;
  min-height: 100vh;
  background: #f8fafc;
  min-width: 0;
}

/* ================================================================= */
/* ====== LAYOUT INTERNE (RÉFÉRENCE | RÉSULTAT | PROTOCOLE) ====== */
/* ================================================================= */

/* Styles de base pour les cartes */
.ref-card, .resultat-card, .protocol-block {
  background-color: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
  min-height: auto; 
}

.ref-title, .protocol-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #eee;
}

.ref-main {
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ref-table th, .ref-table td {
  border: 1px solid #e0e0e0;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

/* La colonne de gauche du tableau de référence est réduite au contenu */
.ref-table th {
  background-color: #f7f7f7;
  font-weight: 600;
  white-space: nowrap; 
}

/* Conteneur des tableaux générés (pour retirer le scroll) */
#weeksBehcet, #weeksAnca {
  max-height: none !important; 
  overflow: visible !important; 
}

/* LAYOUT PRINCIPAL : Deux colonnes (Gauche: Ref+Resultat / Droite: Protocole) */
.ctc-three-panel-layout {
  display: flex;
  flex-wrap: wrap; 
  gap: 0.5rem; 
  margin-top: 1.5rem;
  align-items: flex-start; /* Assure que les colonnes commencent au même niveau */
}

/* Colonne de gauche: Référence + Résultat (empilés) */
.ctc-three-panel-layout .left-stack {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  /* Rendre la colonne de gauche plus rigide pour la cohérence */
  flex: 0 0; 
}

/* Bloc Protocole (colonne de droite) */
.ctc-three-panel-layout .protocol-block {
  margin-top: 0; 
  /* Laisser prendre le reste de l'espace, mais avec un minimum requis */
  flex: 1 1;  
  height: auto;
}

/* Styles pour les TABLEAUX DYNAMIQUES générés (compacts, Excel-like) */
.tableau-lupus-kdigo table,
#weeksAnca table {
  width: auto; /* La largeur sera basée sur le contenu minimal */
  max-width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
}

.tableau-lupus-kdigo th,.tableau-lupus-consensus th,
.tableau-lupus-kdigo td, .tableau-lupus-consensus td,
#weeksAnca th,
#weeksAnca td {
  border: 1px solid #e0e0e0;
  padding: 0px 2px !important; 
  height: 1.9em !important; 
  font-size: 0.85rem;
  line-height: 1.2 !important; 
  vertical-align: middle;
  text-align: center; 
}

.tableau-lupus-kdigo th,
#weeksAnca th {
  background-color: #f7f7f7;
  font-weight: 600;
  text-align: center;
  min-width: 3em;
}

/* Style pour la colonne sélectionnée dans le tableau ANCA */
.schema-retenu-cell {
  background-color: #f8fafc; 
  font-weight: 700;
}

/* Nouveau: Règle pour les inputs dans les tableaux dynamiques (pour Behçet/ANCA) */
.tableau-lupus-kdigo input[type="number"],
.tableau-lupus-consensus input[type="number"],
#weeksAnca input[type="number"] {
  width: 50px; /* Largeur très compacte */
  padding: 2px 4px;
  text-align: center;
  box-sizing: border-box;
  -moz-appearance: textfield; 
}

.tableau-lupus-kdigo input::-webkit-outer-spin-button,
.tableau-lupus-kdigo input::-webkit-inner-spin-button,
#weeksAnca input::-webkit-outer-spin-button,
#weeksAnca input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Règle pour la colonne "Objectif" de Behçet (pour forcer le wrap) */
.tableau-lupus-kdigo .objectif-cell {
  min-width: 4em;
  white-space: normal;
  text-align: left; 
}

/* =============================================== */
/* ====== NOUVEAU LAYOUT MULTI-PANNEAU CSS ====== */
/* =============================================== */

/* Conteneur principal pour le layout en colonnes (Doublon gardé par sécurité selon consigne) */
.ctc-three-panel-layout {
  display: flex;
  gap: 0.5rem; 
  margin-top: 1rem;
}

/* Pile des éléments de gauche (Référence + Résultat) */
.ctc-three-panel-layout .left-stack {
  display: flex;
  flex-direction: column;
  gap: 20px; 
  flex: 2 1;
}

/* Bloc principal du protocole (Formulaire/Tableau) */
.ctc-three-panel-layout .protocol-block {
  flex: 2 1 0;
}

/* Style spécifique pour la carte de résultat */
.resultat-card {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 15px;
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.resultat-card .protocol-title {
  font-size: 1.1em;
  font-weight: 700;
  margin-bottom: 10px;
  color: #333;
  border-bottom: 2px solid #eee;
  padding-bottom: 5px;
}

/* Style pour les textarea de résultats */
#resultBehcet, #resultAnca, #resultDermato {
  font-family: monospace; 
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 0.8rem; 
}

/* ==================================================== */
/* --- NOUVELLE SECTION POUR BEHCET PROTOCOL LAYOUT --- */
/* ==================================================== */

.behcet-form-layout, .anca-inner-flex {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    width: 100%;
}

.behcet-controls, .dermato-controls, .acr-controls-vertical, kdigo-form-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 35%;
}

.behcet-controls label {
  margin-bottom: -5px; 
  font-weight: 500;
}

.behcet-controls input[type="number"],
.behcet-controls input[type="date"] {
  max-width: 100%; 
  padding: 2px 2px;
  box-sizing: border-box;
}

#weeksBehcet, #weeksDermato, #weeksLupusACR {
  flex: 1 1 auto;
   
}

.behcet-controls #doseCumulBehcet {
  margin-top: 10px; 
  margin-bottom: 0;
}

.behcet-controls button {
  margin-top: 10px; 
  padding: 10px 2px;
}

/* ========================================================================= */
/* ====== NOUVEAU LAYOUT PROTOCOLE DERMATOMYOSITE (Alignement) ====== */
/* ========================================================================= */

.dermato-form-layout {
  display: flex;
  gap: 20px; 
  align-items: flex-start; 
}
.still-form-vertical form {
  display: flex;
  flex-direction: column; 
  gap: 10px; 
  flex: 0 0; 
}

.dermato-controls label {
  margin-bottom: -5px; 
  font-weight: 500;
}

.dermato-controls input[type="date"] {
  max-width: 100%; 
  padding: 2px 2px;
  box-sizing: border-box;
}

.dermato-controls #doseCumulDermato {
  margin-top: 10px; 
  margin-bottom: 0;
}

.dermato-controls button {
  margin-top: 10px; 
  padding: 10px 2px;
}

.dermato-form-layout table.tableau-lupus-kdigo {
  flex: 1 1 auto;
  overflow-x: auto; 
  width: 100%;
  max-width: 100%;
}

/* ============================================================================ */
/* ====== STYLES DE TABLE DERMATOMYOSITE/LUPUS KDIGO (Nettoyage/Cohérence) ====== */
/* ============================================================================ */

.objectif-cell .objectif { 
  font-style: italic;
  color: #555;
  white-space: normal;
  text-align: left;
  display: block; 
}

.tableau-lupus-kdigo td:nth-child(2) {
  text-align: center; 
}

/* ======================================= */
/* ====== DIVERS & COOKIE BANNER ====== */
/* ======================================= */

#ctc-cookie-banner {
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  bottom: 30%;
  left: 25%;
  height: 17em;
  text-align: center;
  width: 50%;
  background: #e7f6ff;
  color: #000000;
  padding: 12px 20px;
  z-index: 9999;
  font-size: 0.9rem;
}

ul.ctc-menu {
  margin-left: inherit;
}

.elementor-widget-container {
  padding: 10px !important;
}

/* ======================================= */
/* ====== RESPONSIVE (MOBILE/TABLETTE) ====== */
/* ======================================= */

@media (max-width: 1000px) { 
  .behcet-form-layout, 
  .dermato-form-layout {
   /* flex-direction: column;*/
  }
  .behcet-controls, 
  .dermato-controls {
    flex: 1 1 100%; 
  }
}

@media (max-width: 880px) {
  .ctc-layout {
    flex-direction: column !important;
  }
  .ctc-sidebar {
    width: 100%;
    position: static;
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1rem;
  }
  .ctc-three-panel-layout {
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
  }
  .ctc-three-panel-layout .left-stack,
  .ctc-three-panel-layout .protocol-block {
    flex: 1 1 100%;
    max-width: 100%;
    min-width: 0;
    margin-top: 0;
  }
  .ref-card, .resultat-card, .protocol-block {
    padding: 1rem;
  }
}

@media (max-width: 768px) {
  .ctc-three-panel-layout {
    flex-direction: column;
  }
  .ctc-three-panel-layout .left-stack,
  .ctc-three-panel-layout .protocol-block {
    flex: 1 1 100%; 
    min-width: unset;
  }
}

/* Isolation du protocole Générique pour ne pas impacter les autres pages */
[data-ctc="generique"] .ref-card {
  width: 100%;
  box-sizing: border-box;
}

[data-ctc="generique"] .tableau-lupus-kdigo {
  width: 100% !important;
  margin-top: 0 !important;
}

[data-ctc="generique"] .tableau-lupus-kdigo input[type="number"] {
  width: 100%;
  height: 30px;
}

[data-ctc="generique"] .doseGenerique {
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

h1, h2, h3, h4, h5 {
font-family: Roboto, Arial, Helvetica, sans-serif !important;

}