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

/* =====================
   LAYOUT GLOBAL
   ===================== */

/* Le body prend exactement la hauteur de l'écran */
body {
  display: flex;
  flex-direction: column;
  height: 100vh;        /* ← change min-height en height */
  overflow: hidden;     /* ← ajoute cette ligne */
}

/* =====================
   SITE HEADER
   ===================== */

.site-header {
  width: 100%;
  padding: 14px 40px;
  background: #1c1c26;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.site-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f0f0f0;
}

.site-header-left i {
  font-size: 20px;
  background: linear-gradient(135deg, #6c63ff, #3ecfcf);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.site-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.site-nav {
  display: flex;
  gap: 24px;
}

.site-nav a {
  color: #6c6c80;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.site-nav a:hover {
  color: #f0f0f0;
}

/* =====================
   MAIN
   ===================== */

/* Le main prend l'espace restant entre header et footer */
.main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 20px;
  overflow: hidden;     /* ← ajoute cette ligne */
  min-height: 0;        /* ← important ! sans ça flex ne rétrécit pas correctement */
}

/* =====================
   SITE FOOTER
   ===================== */

.site-footer {
  width: 100%;
  padding: 14px 40px;
  background: #1c1c26;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  font-size: 12px;
  color: #444455;
}

.site-footer strong {
  color: #6c63ff;
}

.footer-stack {
  color: #333344;
  font-size: 11px;
  letter-spacing: 0.5px;
}

body {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  background: #0f0f13;
  color: #e8e8e8;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

/* Le container s'adapte à l'espace disponible */
.container {
  width: 100%;
  max-width: 780px;
  height: 100%;          /* ← change 92vh en 100% */
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  background: #16161d;
}

/* Header */
.header {
  padding: 18px 28px;
  background: #1c1c26;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #6c63ff, #3ecfcf);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.header-info h1 {
  font-size: 16px;
  font-weight: 600;
  color: #f0f0f0;
}

.header-info span {
  font-size: 12px;
  color: #6c6c80;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #3ecfcf;
  border-radius: 50%;
  margin-left: auto;
  box-shadow: 0 0 8px #3ecfcf;
}

/* Messages */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scrollbar-width: thin;
  scrollbar-color: #2a2a38 transparent;
}

.message-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

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

.msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.msg-avatar.bot {
  background: linear-gradient(135deg, #6c63ff, #3ecfcf);
}

.msg-avatar.user {
  background: #2a2a38;
}

.bubble {
  max-width: 72%;
  padding: 13px 18px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.bubble.bot {
  background: #1f1f2e;
  color: #dddde8;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.bubble.user {
  background: linear-gradient(135deg, #6c63ff, #5a54d4);
  color: white;
  border-bottom-right-radius: 4px;
}

.bubble.loading {
  background: #1f1f2e;
  color: #555568;
  border-bottom-left-radius: 4px;
  font-style: italic;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.bubble.recherche {
  background: rgba(62, 207, 207, 0.08);
  color: #3ecfcf;
  border: 1px solid rgba(62, 207, 207, 0.2);
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 10px;
}

/* Input zone */
.input-zone {
  padding: 20px 28px;
  background: #1c1c26;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

textarea {
  flex: 1;
  padding: 13px 18px;
  background: #0f0f13;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: #e8e8e8;
  font-size: 14.5px;
  font-family: inherit;
  resize: none;
  outline: none;
  max-height: 120px;
  transition: border-color 0.2s;
}

/* Cibler le textarea spécifique */
textarea::-webkit-scrollbar {
    width: 10px;               /* Largeur de la barre verticale */
    height: 10px;              /* Hauteur de la barre horizontale */
}

textarea:focus {
  border-color: #6c63ff;
}

textarea::placeholder {
  color: #444455;
}

.btn-send {
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, #6c63ff, #3ecfcf);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.2s,
    transform 0.1s;
  flex-shrink: 0;
}

.btn-send:hover {
  opacity: 0.85;
  transform: scale(1.05);
}
.btn-send:disabled {
  opacity: 0.3;
  transform: none;
  cursor: not-allowed;
}

.btn-send svg {
  width: 18px;
  height: 18px;
  fill: white;
}

/* Stats bar */
.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stats {
  font-size: 11px;
  color: #444455;
  display: flex;
  gap: 16px;
}

.btn-reset {
  background: transparent;
  border: none;
  color: #444455;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s;
  padding: 4px 8px;
  border-radius: 6px;
}

.btn-reset:hover {
  color: #e8e8e8;
  background: rgba(255, 255, 255, 0.05);
}

/* =====================
   RESPONSIVE MOBILE
   ===================== */

@media (max-width: 600px) {

  .site-header {
    padding: 12px 20px;
  }

  .site-nav {
    display: none; /* Cache le nav sur mobile */
  }

  .main {
    padding: 10px;
  }

  .container {
    border-radius: 12px;
  }

  .bubble {
    max-width: 88%;
    font-size: 13.5px;
  }

  .site-footer {
    padding: 10px 20px;
    font-size: 11px;
  }

  .footer-stack {
    display: none; /* Cache la stack tech sur mobile */
  }
}