/* ── Variables Zeebra ──────────────────────────────────────────────────── */
:root {
  --zeebra-blue:      #24bddc;
  --zeebra-dark:      #1285A3;
  --zeebra-orange:    #ffc618;
  --zeebra-rose:      #fd94c2;
  --zeebra-green:     #98c464;
  --zeebra-grey:      #7e7f7e;
  --zeebra-grey-light:#f4f5f7;
  --zeebra-grey-mid:  #e2e4e8;
  --text-dark:        #222222;
  --text-mid:         #444444;
  --radius:           12px;
  --radius-sm:        8px;
  --shadow:           0 2px 16px rgba(0,0,0,0.08);
  --shadow-strong:    0 4px 32px rgba(0,0,0,0.16);
  --sidebar-width:    280px;
  --font:             'Arial', sans-serif;
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: var(--font); background: var(--zeebra-grey-light); color: var(--text-dark); }

/* ── Layout ─────────────────────────────────────────────────────────────── */
body { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: #fff;
  border-right: 1px solid var(--zeebra-grey-mid);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  box-shadow: 2px 0 8px rgba(0,0,0,0.04);
}

.sidebar-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--zeebra-grey-mid);
}
.logo { height: 36px; object-fit: contain; }

.project-selector {
  padding: 16px 20px;
  border-bottom: 1px solid var(--zeebra-grey-mid);
}
.section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--zeebra-grey);
  margin-bottom: 6px;
}
.project-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--zeebra-dark);
  margin-bottom: 8px;
  word-break: break-word;
}

.steps-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
}
.step-item:hover:not(.locked) { background: var(--zeebra-grey-light); }
.step-item.active { background: #e8f8fc; }
.step-item.locked { opacity: 0.45; cursor: not-allowed; }

.step-number {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--zeebra-grey-mid);
  color: var(--zeebra-grey);
}
.step-item.active    .step-number { background: var(--zeebra-blue); color: #fff; }
.step-item.done      .step-number { background: var(--zeebra-green); color: #fff; }
.step-item.validated .step-number { background: var(--zeebra-dark); color: #fff; }

.step-label {
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.3;
}
.step-item.active    .step-label { color: var(--zeebra-dark); font-weight: 600; }

.step-status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-left: auto;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--zeebra-grey-mid);
  font-size: 11px;
  color: var(--zeebra-grey);
}

/* ── Main ────────────────────────────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
}

/* ── Step Header ─────────────────────────────────────────────────────────── */
.step-header {
  padding: 16px 28px;
  background: #fff;
  border-bottom: 1px solid var(--zeebra-grey-mid);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}
.step-badge {
  background: var(--zeebra-blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.step-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--zeebra-dark);
  flex: 1;
}
.step-actions { display: flex; gap: 10px; align-items: center; }

/* ── Chat Area ───────────────────────────────────────────────────────────── */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
}
.messages { display: flex; flex-direction: column; gap: 20px; max-width: 820px; width: 100%; margin: 0 auto; }

/* ── Messages ────────────────────────────────────────────────────────────── */
.message {
  display: flex;
  gap: 12px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

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

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}
.message.assistant .avatar { background: var(--zeebra-blue); color: #fff; }
.message.user      .avatar { background: var(--zeebra-dark); color: #fff; }

.bubble {
  max-width: 78%;
  padding: 14px 18px;
  border-radius: var(--radius);
  line-height: 1.65;
  font-size: 14px;
}
.message.assistant .bubble {
  background: #fff;
  border: 1px solid var(--zeebra-grey-mid);
  color: var(--text-dark);
  border-top-left-radius: 4px;
  box-shadow: var(--shadow);
}
.message.user .bubble {
  background: var(--zeebra-dark);
  color: #fff;
  border-top-right-radius: 4px;
}

/* Markdown-like dans les bulles assistant */
.bubble h1 { font-size: 18px; color: var(--zeebra-dark); margin: 16px 0 8px; border-bottom: 2px solid var(--zeebra-blue); padding-bottom: 4px; }
.bubble h2 { font-size: 15px; color: var(--zeebra-dark); margin: 14px 0 6px; }
.bubble h3 { font-size: 13px; color: var(--zeebra-grey); margin: 10px 0 4px; }
.bubble p  { margin-bottom: 8px; }
.bubble ul, .bubble ol { padding-left: 20px; margin-bottom: 8px; }
.bubble li { margin-bottom: 4px; }
.bubble strong { color: var(--zeebra-dark); }
.bubble em { font-style: italic; }
.bubble code { background: var(--zeebra-grey-light); padding: 1px 5px; border-radius: 3px; font-size: 12px; }
.bubble hr { border: none; border-top: 1px solid var(--zeebra-grey-mid); margin: 12px 0; }
.bubble blockquote { border-left: 3px solid var(--zeebra-blue); padding-left: 12px; color: var(--zeebra-grey); font-style: italic; margin: 8px 0; }
.bubble table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0; }
.bubble th { background: var(--zeebra-dark); color: #fff; padding: 6px 10px; text-align: left; }
.bubble td { padding: 5px 10px; border-bottom: 1px solid var(--zeebra-grey-mid); }
.bubble tr:nth-child(even) td { background: var(--zeebra-grey-light); }

/* Tag livrable */
.deliverable-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e8f8e8;
  border: 1px solid var(--zeebra-green);
  color: #2a7a2a;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  margin-top: 10px;
}

/* Typing indicator */
.typing { display: flex; align-items: center; gap: 4px; padding: 14px 18px; }
.typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--zeebra-blue);
  animation: bounce 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-8px); } }

/* ── Input Area ──────────────────────────────────────────────────────────── */
.input-area {
  padding: 16px 28px 20px;
  background: #fff;
  border-top: 1px solid var(--zeebra-grey-mid);
  flex-shrink: 0;
}
.file-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.file-chip {
  background: #e8f8fc;
  border: 1px solid var(--zeebra-blue);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 11px;
  color: var(--zeebra-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}
.file-chip button { background: none; border: none; cursor: pointer; color: var(--zeebra-grey); font-size: 14px; line-height: 1; }

.input-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--zeebra-grey-light);
  border: 1px solid var(--zeebra-grey-mid);
  border-radius: var(--radius);
  padding: 8px 12px;
  transition: border-color 0.15s;
}
.input-row:focus-within { border-color: var(--zeebra-blue); }

.btn-attach {
  cursor: pointer;
  color: var(--zeebra-grey);
  font-size: 18px;
  padding: 4px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.btn-attach:hover { color: var(--zeebra-blue); }

.message-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-dark);
  resize: none;
  outline: none;
  max-height: 140px;
  line-height: 1.5;
}
.message-input::placeholder { color: var(--zeebra-grey); }

.btn-send {
  background: var(--zeebra-blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.btn-send:hover { background: var(--zeebra-dark); }
.btn-send:disabled { background: var(--zeebra-grey-mid); cursor: not-allowed; }

/* ── Boutons ─────────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--zeebra-blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--zeebra-dark); }
.btn-large { padding: 13px 32px; font-size: 15px; border-radius: var(--radius); }

.btn-secondary {
  background: none;
  border: 1px solid var(--zeebra-grey-mid);
  color: var(--zeebra-grey);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  width: 100%;
  margin-top: 4px;
}
.btn-secondary:hover { border-color: var(--zeebra-blue); color: var(--zeebra-blue); }

.btn-success {
  background: var(--zeebra-green);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-success:hover { filter: brightness(0.92); }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px;
  max-width: 520px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-strong);
}
.modal-title { font-size: 20px; font-weight: 700; color: var(--zeebra-dark); margin-bottom: 20px; }
.modal-subtitle { font-size: 15px; font-weight: 600; color: var(--zeebra-dark); margin-bottom: 12px; }
.modal-divider { border: none; border-top: 1px solid var(--zeebra-grey-mid); margin: 20px 0; }

.projects-list { display: flex; flex-direction: column; gap: 8px; }
.project-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid var(--zeebra-grey-mid);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.project-card:hover { border-color: var(--zeebra-blue); box-shadow: 0 0 0 2px rgba(36,189,220,0.15); }
.project-card-name { font-weight: 600; font-size: 14px; color: var(--zeebra-dark); }
.project-card-client { font-size: 12px; color: var(--zeebra-grey); }

.new-project-form { display: flex; flex-direction: column; gap: 10px; }
.form-input {
  padding: 10px 14px;
  border: 1px solid var(--zeebra-grey-mid);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-dark);
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--zeebra-blue); }

/* ── Modal Intro ─────────────────────────────────────────────────────────── */
.intro-modal { max-width: 620px; text-align: center; }
.intro-logo { height: 48px; margin-bottom: 20px; }
.intro-title { font-size: 24px; font-weight: 700; color: var(--zeebra-dark); margin-bottom: 6px; }
.intro-subtitle { font-size: 15px; color: var(--zeebra-blue); margin-bottom: 16px; font-style: italic; }
.intro-description { font-size: 14px; color: var(--text-mid); line-height: 1.7; margin-bottom: 24px; text-align: left; }
.steps-intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 28px;
  text-align: left;
}
.step-intro-item {
  background: var(--zeebra-grey-light);
  border-left: 3px solid var(--zeebra-blue);
  padding: 8px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
  color: var(--text-mid);
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--zeebra-grey-mid); border-radius: 3px; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .sidebar { display: none; }
  .bubble { max-width: 92%; }
  .chat-area { padding: 16px; }
  .input-area { padding: 12px 16px 16px; }
  .step-header { padding: 12px 16px; }
  .steps-intro-grid { grid-template-columns: 1fr; }
}
