/* ===== Titre ===== */
h1 {
  font-size: 30px;
  background-image: linear-gradient(grey, white);
  text-align: center;
  margin: 0 0 0.2em 0;
  padding: 10px 0;
}

/* si tu utilises class="title" sur le h1 */
.title {
  color: #333;
  margin: 0 0 6px 0;
}



/* ===== Plein écran ===== */
html,
body {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background-color: #f5f5f5;
}

#pseudo {
  min-width: 180px;
}

#code {
  min-width: 320px;
}

/* ===== Conteneur plein écran ===== */
.container {
  width: 100%;
  max-width: none;
  height: 100vh;
  min-height: 0;
  margin: 0;
  background-color: white;
  padding: 16px;
  border-radius: 0;
  box-shadow: none;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* ===== Sous-titre ===== */
.subtitle {
  margin: 2px 0 10px 0;
  font-size: 13px;
  font-style: italic;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Bouton "Home" intégré au sous-titre */
.home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  text-decoration: none;
  background: #2f6feb;
  color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  transition: background 0.15s ease, transform 0.05s ease, opacity 0.15s ease;
}

.home-btn:hover {
  background: #9aa0a6;
}

.home-btn:active {
  transform: translateY(1px);
}

.home-btn:focus {
  outline: 2px solid rgba(47, 111, 235, 0.35);
  outline-offset: 2px;
}

/* ===== Zone principale (sous titre + boutons) ===== */
#zonePython {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ===== 2 colonnes 50/50 ===== */
.two-cols {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  gap: 20px;
  align-items: stretch;
}

/* Colonnes */
.left-col,
.right-col {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ===== Editeur ===== */
.editor-container {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* CodeMirror prend l'espace restant sous le titre + boutons */
.CodeMirror {
  flex: 1 1 auto;
  height: 100% !important;
  min-height: 200px !important;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* Ascenseur vertical interne */
.CodeMirror-scroll {
  overflow-y: scroll !important;
}

/* ===== Output ===== */
.output {
  background-color: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 15px;
  flex: 1 1 auto;
  min-height: 200px;
  overflow: auto;
  font-family: monospace;
  white-space: pre-wrap;
}

.loading {
  color: #666;
  font-style: italic;
}

/* ===== Zone p5 (en bas) ===== */
#graphicsOutput {
  border: 1px solid #ddd;
  margin-top: 15px;
  background-color: #fff;
  display: flex;
  justify-content: center;
}

/* ===== Responsive mobile ===== */
@media (max-width: 900px) {
  .two-cols {
    flex-direction: column;
  }

  .editor-container {
    min-height: 250px;
  }

  .CodeMirror {
    min-height: 250px !important;
  }
}

/* ===== Boutons : style global ===== */
button {
  background: #2f6feb;
  color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  transition: background 0.15s ease, transform 0.05s ease, opacity 0.15s ease;
  align-self: flex-start;
}

button:hover {
  background: #9aa0a6;
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Boutons sous le titre */
.top-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 18px;
}

/* ===============================
   menu connexion
================================= */

.muted {
  color: #666;
  font-size: 14px;
}

.ok {
  color: #0a7;
}

.warn {
  color: #a60;
}

/* ===============================
   Layout
================================= */

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin: 12px 0;
}

/* ===============================
   Inputs / boutons
================================= */

input[type="text"],
input[type="radio"] {
  font-size: 16px;
}

input[type="text"],
#code {
  padding: 10px;
  min-width: 320px;
}

/* ===============================
   Bloc choix rôle
================================= */

.rolebox {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fafafa;
  margin: 12px 0;
}

.role-title {
  font-size: 14px;
  color: #555;
  margin-right: 10px;
}

.role-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  cursor: pointer;
}

/* Amélioration visuelle des radios */
.role-option input[type="radio"] {
  transform: scale(1.2);
  cursor: pointer;
}

/* ===============================
   Admin panel
================================= */

.admin-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #f4f4f4;
}

.admin-header {
  margin-bottom: 8px;
  font-size: 14px;
  color: #444;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #e0e0e0;
  margin-left: 8px;
}

/* ===============================
   fin de menu connexion
================================= */

/* ===== Bouton flottant IA ===== */
.ia-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  font-size: 16px;
  background: #2f6feb;
  color: #fff;
}

/* ===== Panneau IA caché par défaut ===== */
.ia-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9998;
  background: #ffffff;
  border-top: 1px solid #ccc;
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.15);
  padding: 0;
  transform: translateY(100%);
  transition: transform 0.25s ease;
}

.ia-panel.ia-open {
  transform: translateY(0);
}

.ia-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #e5e5e5;
  background: #f7f7f7;
}

.ia-close-btn {
  border: none;
  background: transparent;
  color: #2f6feb;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 2px 8px;
  align-self: auto;
}

.ia-close-btn:hover {
  background: transparent;
  color: #1f4fa8;
}

.ia-body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ia-body label {
  font-weight: 600;
}

.ia-body select,
.ia-body input {
  padding: 10px;
  font-size: 14px;
  border: 1px solid #bbb;
  border-radius: 8px;
  box-sizing: border-box;
  max-width: 100%;
}

/* Première ligne : select + clé + bouton */
.ia-connect-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.ia-connect-row label {
  margin-right: 4px;
}

.ia-main-btn,
.ia-tool-btn {
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
}

.ia-main-btn {
  background: #2f6feb;
  color: #fff;
}

.ia-main-btn:hover {
  background: #1f4fa8;
}

.ia-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.ia-tool-btn {
  background: #efefef;
  color: #222;
}

.ia-tool-btn:hover {
  background: #dcdcdc;
}

.ia-status {
  min-height: 20px;
  font-size: 14px;
}

.ia-status.info {
  color: #333;
}

.ia-status.success {
  color: #0a7a31;
}

.ia-status.error {
  color: #b00020;
}

/* ===== Responsive menu IA ===== */
@media (max-width: 700px) {
  .ia-fab {
    right: 12px;
    bottom: 12px;
  }

  .ia-connect-row {
    flex-direction: column;
    align-items: stretch;
  }

  .ia-main-btn,
  .ia-tool-btn {
    width: 100%;
  }
}



/* Barre de boutons compacte pour la colonne de gauche */
.left-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

/* Boutons icône compacts */
.icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #bfc7d1;
  border-radius: 8px;
  background: #ffffff;
  color: #222;
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover:not(:disabled) {
  background: #f3f6fa;
  border-color: #8fa7c0;
  transform: translateY(-1px);
}

.icon-btn:active:not(:disabled) {
  transform: translateY(0);
}

.icon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Bouton texte conservé pour "Générer un lien" */
.text-btn {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #bfc7d1;
  border-radius: 8px;
  background: #ffffff;
  color: #222;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.text-btn:hover {
  background: #f3f6fa;
  border-color: #8fa7c0;
  transform: translateY(-1px);
}