/* --- STYLES GLOBAUX --- */
:root{--bg:#0f1724;--surface:#0b1220;--surface-2:#1a2333;--primary:#7dd3fc;--secondary:#ff6b6b;--green:#4ade80;--muted:#94a3b8;--border-color:rgba(255, 255, 255, 0.08);--radius:12px;font-family:Inter,system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif}
*{box-sizing:border-box}
html,body{height:100%;margin:0;background:var(--bg);color:#e6eef6;font-size:16px;overflow:hidden}
.hidden{display:none!important}
.btn{padding:.75rem 1.25rem;border:none;border-radius:8px;font-weight:600;cursor:pointer;transition:all .2s}
.btn-primary{background:var(--primary);color:var(--bg)}.btn-primary:hover{filter:brightness(1.1)}
.btn-secondary{background-color:rgba(255,255,255,.1);color:#e6eef6}.btn-secondary:hover{background-color:rgba(255,255,255,.15)}
.btn-success{background:var(--green);color:var(--bg)}.btn-success:disabled{background:var(--muted);cursor:not-allowed;opacity:.6}
.btn:disabled{background:var(--muted)!important;color:var(--surface)!important;cursor:not-allowed;opacity:.6}
@keyframes spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}
.spinner{border-top-color:var(--primary);animation:spin 1s linear infinite;display:inline-block;width:1.25rem;height:1.25rem;border-width:2px;border-style:solid;border-radius:50%}
/* --- THINKING TEXT ANIMATION --- */
.thinking-text{transition:opacity 0.2s ease-in-out;opacity:1;margin-left:0.5rem;color:var(--primary);font-style:italic}
/* --- CONSOLE VISUELLE (EFFET WAOUH) --- */
.thinking-console{background:var(--surface);border:1px solid var(--border-color);border-radius:8px;overflow:hidden;font-family:'Courier New',monospace;font-size:0.85rem}
.console-header{background:var(--surface-2);padding:0.5rem 0.75rem;display:flex;align-items:center;gap:0.5rem;border-bottom:1px solid var(--border-color)}
.console-dot{width:10px;height:10px;border-radius:50%;flex-shrink:0}
.console-dot.red{background:#ff5f56}
.console-dot.yellow{background:#ffbd2e}
.console-dot.green{background:#27c93f}
.console-title{color:var(--muted);font-size:0.75rem;font-weight:600;margin-left:0.25rem}
.console-logs{padding:0.75rem;max-height:200px;overflow-y:auto;background:#0a0e17}
.console-log-line{color:#7dd3fc;margin:0.25rem 0;padding:0.15rem 0;font-family:'Courier New',monospace;font-size:0.8rem;opacity:0;transform:translateY(-5px);transition:all 0.3s ease}
.console-log-line:last-child{color:var(--green)}
/* --- ÉCRAN DE CONNEXION --- */
#login-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100vh;gap:1.5rem;text-align:center}
#login-container .brand{display:flex;align-items:center;gap:1rem}
#login-container .brand .logo{width:40px;height:40px;border-radius:10px;background:linear-gradient(135deg,var(--primary),var(--secondary));display:flex;align-items:center;justify-content:center;font-weight:700;color:var(--surface)}
#login-container h1{margin:0}
#login-container p{color:var(--muted);max-width:400px}
#login-btn{display:flex;align-items:center;gap:.75rem;background-color:#fff;color:#333;padding:.75rem 1.5rem;font-size:1rem;border-radius:8px;border:1px solid #ccc;cursor:pointer;transition:background-color .2s}
#login-btn:hover{background-color:#f2f2f2}
#login-btn img{width:24px;height:24px}
/* --- STRUCTURE DE L'APP --- */
.app-container{display:flex;height:100vh;flex-direction:column}
.main-layout {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
    padding-bottom: 50px; /* <-- AJOUTEZ CETTE LIGNE (50px est la hauteur approximative du footer) */
}
.main-content{flex-grow:1;display:flex;flex-direction:column;position:relative}
/* --- TOP BAR --- */
.top-bar{padding:.75rem 1.5rem;border-bottom:1px solid var(--border-color);display:flex;justify-content:space-between;align-items:center;flex-shrink:0;background:rgba(11,18,32,.8);backdrop-filter:blur(10px);z-index:20;position:relative}
.brand{display:flex;align-items:center;gap:1rem}
.brand .logo{width:40px;height:40px;border-radius:10px;background:linear-gradient(135deg,var(--primary),var(--secondary));display:flex;align-items:center;justify-content:center;font-weight:700;color:var(--surface)}
.top-nav{display:flex;align-items:center;gap:.5rem}
.nav-item{position:relative}
.nav-button{background:transparent;border:0;color:var(--muted);padding:.5rem .75rem;border-radius:6px;font-weight:600;cursor:pointer;font-size:.9rem}
.nav-button:hover,.nav-button.is-active{background:rgba(255,255,255,.05);color:#fff}
#lang-selector{display:flex;gap:.5rem;margin-left:1rem}
#lang-selector button{background:0 0;border:1px solid var(--border-color);color:var(--muted);padding:.4rem .8rem;border-radius:6px;cursor:pointer;transition:all .2s;font-weight:600}
#lang-selector button:hover{color:var(--primary);border-color:var(--primary)}
#lang-selector button.active{background:var(--primary);color:var(--bg);border-color:var(--primary)}
.user-menu .nav-button{display:flex;align-items:center;gap:.5rem}
.user-menu img{width:28px;height:28px;border-radius:50%;background-color:var(--muted)}
.dropdown-menu{position:absolute;right:0;top:100%;margin-top:.5rem;min-width:200px;background:var(--surface-2);border:1px solid var(--border-color);border-radius:8px;padding:.5rem;box-shadow:0 8px 20px rgba(0,0,0,.4);z-index:10;opacity:0;visibility:hidden;transform:translateY(-10px);transition:all .2s ease;pointer-events:none}
.dropdown-menu.is-active{opacity:1;visibility:visible;transform:translateY(0);pointer-events:auto}
.dropdown-link{display:flex;align-items:center;gap:.75rem;padding:.5rem .75rem;border-radius:6px;text-decoration:none;color:var(--muted);font-size:.9rem}
.dropdown-link:hover{background:rgba(255,255,255,.08);color:#fff}
.dropdown-divider{height:1px;background:var(--border-color);margin:.5rem 0}
/* Style pour le slogan dans le header */
.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-text h1 {
    margin: 0;
    line-height: 1; /* Resserre la ligne du titre */
}
.header-slogan {
    margin: 0;
    font-size: 0.8rem; /* Plus petit que le titre */
    font-weight: 500;
    color: var(--muted); /* Couleur discrète */
    font-style: italic;
}
/* --- SIDEBAR --- */
.sidebar{width:280px;background:var(--surface);border-right:1px solid var(--border-color);padding:1.5rem;display:flex;flex-direction:column;flex-shrink:0}
.sidebar-btn{display:flex;align-items:center;gap:.75rem;width:100%;padding:.75rem;border-radius:8px;border:1px solid var(--border-color);background:transparent;color:inherit;font-weight:600;cursor:pointer;text-align:left;margin-bottom:1rem}
.sidebar-btn:hover{background:rgba(255,255,255,.05)}
.sidebar-section-title{font-size:.75rem;text-transform:uppercase;color:var(--muted);font-weight:600;margin-top:1.5rem;margin-bottom:.75rem;padding:0 .5rem}
.history-list{flex-grow:1;overflow-y:auto;margin-right:-1rem;padding-right:1rem}
.history-item{display:block;padding:.5rem .75rem;border-radius:6px;text-decoration:none;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.history-item:hover{background:rgba(255,255,255,.05);color:#fff}
/* --- CHAT VIEW --- */
.chat-view{display:flex;flex-direction:column;height:100%}
.chat-log{flex-grow:1;padding:1.5rem;overflow-y:auto}
.chat-log-inner{max-width:800px;margin:0 auto;display:flex;flex-direction:column;gap:1.5rem}
.chat-form-container{padding:1.5rem;border-top:1px solid var(--border-color);background:var(--surface-2)}
.chat-form{max-width:800px;margin:0 auto;display:flex;gap:1rem;align-items:center}
.file-input-container{display:flex;align-items:center;gap:0.25rem;flex-shrink:0;position:relative}
.btn-file-attach{background:transparent;border:1px solid var(--border-color);color:var(--muted);padding:0.75rem;border-radius:8px;cursor:pointer;font-size:1.2rem;transition:all 0.2s;flex-shrink:0}
.btn-file-attach:hover{background:rgba(255,255,255,0.1);border-color:var(--primary);color:var(--primary)}
.btn-file-attach:active{transform:scale(0.95)}
.action-menu-container{position:relative;flex-shrink:0}
.btn-action-menu{background:transparent;border:1px solid var(--border-color);color:var(--muted);padding:0.75rem;border-radius:8px;cursor:pointer;font-size:1.2rem;font-weight:bold;transition:all 0.2s;width:2.5rem;height:2.5rem;display:flex;align-items:center;justify-content:center}
.btn-action-menu:hover{background:rgba(255,255,255,0.1);border-color:var(--primary);color:var(--primary)}
.btn-action-menu:active{transform:scale(0.95)}
.action-menu-dropdown{position:absolute;bottom:100%;left:0;margin-bottom:0.5rem;background:var(--surface-2);border:1px solid var(--border-color);border-radius:8px;box-shadow:0 4px 12px rgba(0,0,0,0.3);min-width:200px;z-index:1000;overflow:hidden}
.action-menu-item{display:flex;align-items:center;gap:0.75rem;width:100%;padding:0.75rem 1rem;background:transparent;border:none;color:#e6eef6;cursor:pointer;font-size:0.9rem;transition:all 0.2s;text-align:left}
.action-menu-item:hover{background:rgba(255,255,255,0.1);color:var(--primary)}
.action-icon{font-size:1.2rem;flex-shrink:0}
.btn-file-remove{background:var(--secondary);color:white;border:none;border-radius:50%;width:24px;height:24px;cursor:pointer;font-size:1.2rem;font-weight:bold;display:flex;align-items:center;justify-content:center;opacity:0.7;transition:all 0.2s}
.btn-file-remove:hover{opacity:1;transform:scale(1.1)}
.btn-file-remove:active{transform:scale(0.9)}
#chat-input {
  flex-grow: 1;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: .75rem;
  color: inherit;
  font-size: 1rem;
  font-family: inherit; /* Assure la même police que le reste de la page */
  
  /* ▼▼▼ AJOUTS IMPORTANTS ▼▼▼ */
  min-height: 50px;   /* Donne une hauteur de départ plus confortable */
  resize: vertical;   /* Permet à l'utilisateur de l'agrandir vers le bas */
}
#chat-input:focus{outline:0;border-color:var(--primary)}
.chat-message{display:flex;gap:1rem;max-width:85%}
.avatar{width:40px;height:40px;border-radius:50%;background:var(--secondary);color:var(--surface);display:flex;justify-content:center;align-items:center;font-weight:600;flex-shrink:0;background-size:cover;background-position:center}
.message-content{padding:.75rem 1.25rem;border-radius:var(--radius);line-height:1.6;word-break:break-word}
.ai{align-self:flex-start}
.user{align-self:flex-end;flex-direction:row-reverse}
.user .avatar{background:var(--muted);font-size:1rem}
.user .message-content{background:var(--primary);color:var(--surface);border-top-right-radius:0}
/* --- STREAMING & PROGRESS BARS --- */
.message-content .stream-chunk{opacity:0;transition:opacity .5s ease}
.message-content .stream-chunk.visible{opacity:1}
.progress-container{margin-bottom:.5rem}
.progress-label{font-size:.8rem;color:var(--muted);margin-bottom:.25rem}
.progress-bar-bg{width:100%;background:rgba(255,255,255,.05);border-radius:4px;height:8px;overflow:hidden}
.progress-bar-fg{width:0%;height:100%;background:var(--primary);border-radius:4px;transition:width .5s ease-out}
/* --- MODULES (BP & Entreprise) --- */
.module-container{height:100%;display:flex;flex-direction:column;background:var(--surface)}
.module-header{padding:.75rem 1.5rem;border-bottom:1px solid var(--border-color);display:flex;justify-content:space-between;align-items:center;flex-shrink:0}
.module-header h1{margin:0;font-size:1.1rem}
.module-current-section-header{font-size:1rem;color:var(--muted);font-weight:500}
.module-chat-log{flex-grow:1;padding:1.5rem;overflow-y:auto;display:flex;flex-direction:column;gap:1.5rem}
.module-chat-log .message-content p:last-child,.module-chat-log .message-content ul:last-child,.module-chat-log .message-content ol:last-child{margin-bottom:0}
.module-chat-log .message-content h1,.module-chat-log .message-content h2,.module-chat-log .message-content h3{font-size:1.1rem;color:var(--primary);margin-bottom:.5rem}
.proposal-block{border:1px solid var(--border-color);margin-top:1rem;border-radius:8px;overflow:hidden}
.proposal-text{padding:1rem;background:rgba(0,0,0,.2);white-space:pre-wrap;font-family:'Courier New',Courier,monospace;max-height:200px;overflow-y:auto}
.proposal-actions{padding:.75rem 1rem;background:rgba(255,255,255,.05);text-align:right}
.module-chat-form{padding:1.5rem;border-top:1px solid var(--border-color);display:flex;flex-direction:column;gap:.75rem;flex-shrink:0}
.module-chat-form-main{display:flex;gap:1rem}
.module-user-input{flex-grow:1;background:rgba(255,255,255,.05);border:1px solid var(--border-color);border-radius:8px;padding:.75rem;color:inherit;resize:none;font-size:1rem}
.module-user-input:focus{outline:0;border-color:var(--primary)}
.module-user-input:disabled{background-color:rgba(255,255,255,.02);cursor:not-allowed}
.module-navigation-buttons{display:flex;justify-content:space-between;gap:1rem}
.analysis-block{border:1px solid var(--primary);margin-top:1rem;border-radius:8px;background:rgba(125,211,252,.05)}
.analysis-header{background:rgba(125,211,252,.1);padding:.5rem 1rem;font-weight:700}
.analysis-content{padding:1rem}
/* --- PREVIEW MODAL --- */
.preview-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.7);backdrop-filter:blur(5px);display:flex;justify-content:center;align-items:center;z-index:1000;opacity:0;visibility:hidden;transition:opacity .3s,visibility .3s}
.preview-overlay.visible{opacity:1;visibility:visible}
.preview-modal{width:90%;max-width:900px;height:90vh;background:var(--surface);border:1px solid var(--border-color);border-radius:var(--radius);display:flex;flex-direction:column}
.preview-modal-header{padding:1rem 1.5rem;border-bottom:1px solid var(--border-color);display:flex;justify-content:space-between;align-items:center;flex-shrink:0;gap:1rem}
.preview-modal-header h1{margin:0;font-size:1.25rem;flex-grow:1}
.preview-content-wrapper{flex-grow:1;overflow-y:auto}
.preview-content{padding:2rem;line-height:1.7}
.preview-content h2{color:var(--primary);border-bottom:1px solid var(--border-color);padding-bottom:.5rem;margin-top:1.5rem;margin-bottom:1rem;page-break-after:avoid}
.preview-content .graph-image{max-width:100%;height:auto;margin-top:1rem;margin-bottom:1rem;border-radius:8px;background:#fff;padding:1rem}
.preview-content>div{margin-bottom:1rem;border:1px solid var(--border-color);border-radius:8px;padding:1rem;background:rgba(255,255,255,.02);white-space:pre-wrap;page-break-inside:avoid}
.progress-bar-container{flex-grow:1;background-color:rgba(255,255,255,.05);border-radius:99px;height:10px;overflow:hidden}
.progress-bar{width:0%;height:100%;background:linear-gradient(90deg,var(--primary),var(--secondary));border-radius:99px;transition:width .5s ease-out}
.word-count{font-size:.875rem;color:var(--muted)}
/* ============================================== */
/* === STYLES POUR L'HISTORIQUE DES PROJETS === */
/* ============================================== */

.history-item-container {
  display: flex; /* La magie opère ici : aligne les enfants sur une ligne */
  justify-content: space-between; /* Pousse les enfants aux extrémités (nom à gauche, poubelle à droite) */
  align-items: center; /* Centre les enfants verticalement */
  width: 100%;
}

.history-item {
  /* Le lien prend toute la place disponible à gauche */
  flex-grow: 1; 
  /* On s'assure qu'il ne dépasse pas pour laisser la place à la poubelle */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0.5rem 0.75rem; /* On remet le padding ici */
  display: block; /* On s'assure qu'il se comporte bien */
}

.history-item-delete {
  cursor: pointer; /* Montre que la poubelle est cliquable */
  padding: 0.5rem;
  opacity: 0.5; /* La rend discrète par défaut */
  transition: opacity 0.2s ease-in-out;
}

.history-item-container:hover .history-item-delete {
  opacity: 1; /* La poubelle devient visible quand on passe la souris sur la ligne */
}

.history-item-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 0; /* Permet au texte de se tronquer */
}

.history-item-title {
  display: block;
  font-weight: 500;
  color: #e6eef6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* AJOUTE CE BLOC À LA FIN DE TON FICHIER style.css */

/* Style général pour le contenu d'un message de l'IA */
.chat-message.ai .message-content {
    line-height: 1.6; /* Augmente l'espace entre les lignes */
}

/* Style pour les paragraphes dans la réponse de l'IA */
.chat-message.ai .message-content p {
    margin-bottom: 1em; /* Ajoute un espace après chaque paragraphe */
}

/* Style pour les titres (si l'IA en génère) */
.chat-message.ai .message-content h1,
.chat-message.ai .message-content h2,
.chat-message.ai .message-content h3 {
    margin-top: 1.5em; /* Espace avant un titre */
    margin-bottom: 0.5em; /* Espace après un titre */
    line-height: 1.2;
}

/* Style pour les listes à puces */
.chat-message.ai .message-content ul,
.chat-message.ai .message-content ol {
    margin-left: 20px; /* Indentation de la liste */
    margin-bottom: 1em;
}

.chat-message.ai .message-content li {
    margin-bottom: 0.5em; /* Espace entre chaque item de la liste */
}

/* ======================================================= */
/*    STYLE FINAL CORRIGÉ POUR LA MODALE DU CV             */
/* ======================================================= */

/* La règle qui va GAGNER contre .hidden */
.preview-overlay#cv-overlay.visible {
    display: flex !important; /* On est obligé d'utiliser !important ici pour gagner */
}

/* Le style de base de l'overlay (il sera caché par la classe .hidden de base) */
.preview-overlay#cv-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    z-index: 9999;
    /* Pas de display: none ici, on laisse la classe .hidden faire le travail */
}

/* Le reste du style est identique, je le remets pour que tout soit au même endroit */
.cv-modal {
    width: 90vw;
    max-width: 1400px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    background-color: #1e1e2f;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}
.cv-modal .preview-modal-header {
    flex-shrink: 0;
}
.cv-modal .preview-content-wrapper {
    padding: 0; flex-grow: 1; overflow: hidden;
}
.cv-modal .preview-content {
    height: 100%; padding: 0;
}
.interactive-cv-container {
    display: flex; width: 100%; height: 100%; color: #e0e0e0; font-family: 'Helvetica Neue', Arial, sans-serif;
}
.cv-nav-side {
    position: relative; flex-shrink: 0; width: 220px; background: #2c2c3e; color: #fff; display: flex; flex-direction: column; padding: 2rem 1rem; border-right: 1px solid #3a3a5a;
}
.cv-nav-side .brand-cv {
    display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 2.5rem;
}
.cv-nav-side .brand-cv .logo {
    background: #4dabf7; color: #fff; border-radius: 50%; width: 40px; height: 40px; display: grid; place-items: center; font-weight: bold; font-size: 1.2rem;
}
.cv-nav-side .brand-cv h2 {
    margin: 0; color: #fff; font-size: 1.5rem;
}
.cv-nav-side button {
    background: none; border: none; color: #fff; text-align: left; padding: 0.8rem 1rem; margin-bottom: 0.5rem; cursor: pointer; font-size: 1rem; border-radius: 6px; transition: 0.3s;
}
.cv-nav-side button:hover, .cv-nav-side button.active {
    background: #4dabf7; color: #fff;
}
.cv-main-content {
    flex-grow: 1; position: relative; overflow: auto; padding: 2rem;
}
.cv-page {
    display: none; padding: 2rem; border-radius: 12px; background: #252535; border: 1px solid #3a3a5a;
}
.cv-page.active {
    display: block; animation: fadeIn 0.8s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.cv-page .section-title {
    color: #82c9ff; margin-bottom: 1rem; border-bottom: 2px solid #4dabf7; display: inline-block; padding-bottom: 0.3rem;
}

.cv-page ul {
    list-style: disc;
    padding-left: 1.2rem;
}

.cv-page ul li {
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.cv-page ul li:hover {
    transform: translateX(5px);
    color: #82c9ff;
}

.cv-page blockquote {
    font-style: italic;
    color: #adb5bd;
    border-left: 4px solid #4dabf7;
    margin: 1rem 0;
    padding-left: 1rem;
    background-color: #2c2c3e;
}

.cv-page .bilingual {
    font-size: 0.95rem;
    color: #888;
    margin-top: 0.5rem;
}


*/
.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    margin-top: 2rem;
    padding: 1rem 0;
}
.skill-circle {
    position: relative;
    width: 120px;
    height: 120px;
    display: grid;
    place-items: center;
}
.skill-circle svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.skill-circle circle {
    fill: none;
    stroke-width: 10;
}
.skill-circle .bg {
    stroke: #3a3a5a; /* Couleur de fond de la jauge */
}
.skill-circle .progress {
    stroke: #4dabf7; /* Couleur de la jauge de progression */
    stroke-dasharray: 339; /* Circonférence pour un rayon de 54 (2*PI*54) */
    stroke-dashoffset: 339; /* La jauge est vide au début */
    transition: stroke-dashoffset 1.5s ease-out; /* Animation douce */
}
.skill-text {
    position: relative; /* Pour s'assurer qu'il est au-dessus du SVG */
    font-size: 16px;
    font-weight: bold;
    color: #e0e0e0;
}

.mantra-text {
    font-size: 2rem;
    font-weight: 300;
    font-style: italic;
    color: #82c9ff;
    text-align: center;
    margin-top: 2rem;
}

/* Effet machine à écrire */
.cv-page .typewriter {
    display: inline-block;
    border-right: 2px solid #82c9ff;
    white-space: nowrap;
    overflow: hidden;
    animation: typing 2s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    50% { border-color: transparent; }
}
/* ======================================= */
/* ==   STYLE POUR LE PIED DE PAGE        == */
/* ======================================= */
.app-footer {
    position: fixed; /* Reste en place même si on scrolle */
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 10px 0;
    font-size: 0.8rem;
    background: var(--surface); /* Utilise la couleur de votre sidebar pour être cohérent */
    border-top: 1px solid var(--border-color);
    z-index: 50; /* S'assure qu'il est au-dessus du contenu mais sous les modales */
}

.app-footer a, .app-footer span {
    color: var(--muted);
    text-decoration: none;
    margin: 0 15px;
}

.app-footer a:hover {
    color: var(--primary);
}
/* ======================================= */
/* == STYLES POUR LE SANDBOX (FORCE)    == */
/* ======================================= */

/* Conteneur principal pour TOUTES les vues de chat (Chat général, Modules, Sandbox) */
.chat-view, #sandbox-chat-area {
  display: flex !important; /* Force l'affichage en colonne flexible */
  flex-direction: column;
  height: 100%;             /* Prend toute la hauteur disponible */
  overflow: hidden;         /* Empêche les débordements */
}

/* Conteneur des messages (la partie qui doit scroller) */
.chat-log {
  flex: 1;                  /* Prend tout l'espace vertical libre */
  overflow-y: auto;         /* Affiche la barre de scroll si nécessaire */
  padding: 1.5rem;
}

/* Conteneur du formulaire en bas */
.chat-form-container, .chat-form {
  flex-shrink: 0;           /* Empêche le formulaire de rétrécir */
}

/* Spécifiquement pour la zone de saisie du SANDBOX pour l'agrandir */
#sandbox-chat-area #chat-input {
    min-height: 80px; /* Donne une hauteur minimale plus confortable */
    resize: vertical; /* Permet à l'utilisateur de l'agrandir verticalement */
}
/* Style pour le groupe bouton + nom de fichier */
.file-input-group {
  display: flex;
  align-items: center;
  gap: 1rem; /* Espace entre le bouton et le nom du fichier */
  margin-top: 1rem;
}

/* Style pour le nom du fichier */
.file-name-display {
  color: var(--muted);
  font-style: italic;
}

/* ======================================= */
/* ==   BOÎTE DE DIALOGUE NOUVELLE DISCUSSION    == */
/* ======================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-overlay.hidden {
  display: none;
}

.modal-dialog {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  width: 90%;
  max-width: 500px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #e6eef6;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e6eef6;
}

.modal-body {
  padding: 1.5rem;
}

.modal-body p {
  margin: 0 0 1.5rem 0;
  color: var(--muted);
  line-height: 1.6;
}

.modal-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  color: #e6eef6;
}

.modal-option:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary);
}

.modal-option input[type="radio"] {
  margin: 0;
  cursor: pointer;
  accent-color: var(--primary);
}

.modal-option span {
  flex: 1;
  cursor: pointer;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* === CONSOLE AGENT GAMMA === */
.gamma-console-agent {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 400px;
  max-height: 500px;
  background: var(--surface-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.gamma-console-agent.visible {
  opacity: 1;
  transform: translateY(0);
}

.gamma-console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius) var(--radius) 0 0;
}

.gamma-console-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--primary);
}

.gamma-task-id {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: monospace;
}

.gamma-console-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.gamma-console-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.gamma-console-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-height: 400px;
}

.gamma-status {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gamma-status.pending {
  color: var(--muted);
}

.gamma-status.running {
  color: var(--primary);
}

.gamma-status.completed {
  color: var(--green);
}

.gamma-status.error {
  color: var(--secondary);
}

.gamma-logs {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.4;
}

.gamma-log-entry {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0;
  border-left: 2px solid transparent;
}

.gamma-log-info {
  border-left-color: var(--primary);
}

.gamma-log-error {
  border-left-color: var(--secondary);
  color: var(--secondary);
}

.gamma-log-warn {
  border-left-color: #ffa500;
  color: #ffa500;
}

.gamma-log-time {
  color: var(--muted);
  font-size: 0.75rem;
  min-width: 60px;
}

.gamma-download-link {
  margin-top: 0.5rem;
}

.gamma-download-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--green);
  color: var(--bg);
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  transition: all 0.2s;
}

.gamma-download-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 768px) {
  .gamma-console-agent {
    width: calc(100vw - 40px);
    bottom: 10px;
    right: 10px;
    left: 10px;
    max-height: 300px;
  }
}