/* ─────────────────────────────────────────
   terminal.css  —  layout & chrome terminal
   ───────────────────────────────────────── */

/* Variables globales */
:root {
  --bg-app:        #0d1117;
  --bg-surface:    #161b22;
  --bg-input:      #0d1117;
  --border:        #30363d;
  --text-primary:  #e6edf3;
  --text-muted:    #8b949e;
  --text-dim:      #484f58;
  --accent-blue:   #58a6ff;
  --font-mono:     "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
  --radius:        4px;
}

/* Reset minimal */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: #000;
}

body {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  /* Centre l'app sur grands écrans */
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 16px;
}

/* ── Conteneur principal ── */
#app {
  width: 100%;
  max-width: 860px;
  min-height: calc(100vh - 48px);
  background: var(--bg-app);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Barre de titre ── */
.term-bar {
  flex-shrink: 0;
  background: var(--bg-surface);
  border-bottom: 0.5px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}


.term-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.term-mode {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Fenêtre de chat ── */
.chat-window {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* Scroll fluide */
  scroll-behavior: smooth;
}

/* Scrollbar discrète */
.chat-window::-webkit-scrollbar       { width: 4px; }
.chat-window::-webkit-scrollbar-track { background: transparent; }
.chat-window::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Barre de saisie ── */
.input-bar {
  flex-shrink: 0;
  border-top: 0.5px solid var(--border);
  background: var(--bg-surface);
  padding: 10px 14px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.input-bar textarea {
  flex: 1 1 auto;
  min-width: 0;
  background-color: #0d1117 !important;
  color: #e6edf3 !important;
  border: 0.5px solid #30363d;
  border-radius: 4px;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 13px;
  padding: 8px 10px;
  outline: none;
  resize: vertical;
  min-height: 60px;
  max-height: 200px;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.input-bar textarea:focus {
  border-color: #58a6ff;
}

.input-bar textarea::placeholder {
  color: #484f58 !important;
}



#sendBtn {
  background: #1f6feb;
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.15s;
}

#sendBtn:hover    { background: #388bfd; }
#sendBtn:disabled { background: var(--bg-surface); color: var(--text-dim); cursor: default; }

/* ── Barre d'actions ── */
.actions-bar {
  flex-shrink: 0;
  border-top: 0.5px solid var(--border);
  background: var(--bg-app);
  padding: 8px 14px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.action-btn {
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 10px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.action-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

/* ── Indicateur de frappe ── */
.typing-indicator {
  color: var(--text-dim);
  font-size: 12px;
  padding: 2px 4px;
  animation: blink 1.1s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1;   }
  50%       { opacity: 0.2; }
}

/* ── Responsive ── */
@media (max-width: 600px) {
  body {
    padding: 0;
    align-items: stretch;
  }

  #app {
    min-height: 100vh;
    border-radius: 0;
    border: none;
  }

  .actions-bar {
    gap: 4px;
  }

  .action-btn {
    font-size: 10px;
    padding: 4px 8px;
  }
}
