:root{

--hdr-bg: rgba(132, 129, 138, 0.121); /* translucent to let the blur show */
--text: #e7e9f3;
--muted: #aab1c7;
--ring: 0 0 0 2px rgba(138,54,255,.15);
--primary1: #2a3fc7;
--primary2: #8a36ff;
--primary3: #8f4383;
--radius: 14px;
--headRad: linear-gradient(10deg, rgba(255, 255, 255, 0.35) 0%, rgb(255 255 255 / 38%) 20%, rgb(65 116 181 / 5%) 100%);
--headRad_reverse: linear-gradient(0deg, rgb(255 255 255 / 0%), rgb(255 255 255 / 0%) 86%), rgb(243 243 243 / 38%);
--logoTxt: rgb(25 24 27 / 72%);
}
html[data-theme="dark"][data-theme-lock="on"]{
--headRad: linear-gradient(10deg, rgb(27, 30, 29) 10%, rgb(34 34 44 / 0%) 100%), rgba(37, 108, 157, 0.32) 10%;
--headRad_reverse: transparent;

--logoTxt:white;
}

/* -- Enveloppe globale du header -- */
header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    height: var(--header-height, 50px);
    backdrop-filter: saturate(100%) blur(4px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    background: var(--headRad);
    padding: 0 12px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    position: fixed;
    top: 0;
    z-index: 99;
  }

  .logoContainer {
    display: flex;
    align-items: center;
    font-family: "LtpEB";
    flex-shrink: 0;
    MARGIN-LEFT: -5PX;
    GAP: 5PX;
  }

  .logoContainer .logo img {
    max-height: 42px;
    width: auto;             
  }
  

  .logoTxt {
    margin-top: 0px;
    margin-left: 6px;
    font-size: 24px;
  } 

  .logoTxt a{
    text-decoration: none;
  }
  /* -- Logo à gauche -- */
  .logo img {
    max-height: 40px;    
    height: auto;
    width: auto;
    display: flex;      /* Pour éviter les petits décalages d’images inline */
  }

  #logoTxtA{
    color: var(--logoTxt);
  }
  #backLogoB
  {
    background: linear-gradient(11deg, rgba(255,93,133,1) 0%, rgba(63,63,255,1) 73%);
    background-clip: border-box;
    background-origin: border-box;
    border: solid 1px transparent;
    border-radius: 5px;
    margin-left: 12px;
  }
  #logoBimg
  {
    width: 25px;
    height: auto;
  }

  #logoTxtB{
    background-color: rgb(243, 243, 243);
    border-radius: 5px;
  }

  #logoTxtB2{
    background: linear-gradient(11deg, rgba(255,93,133,1) 0%, rgba(63,63,255,1) 73%);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-top: 0px;
    padding-bottom: 3px;
    padding-left: 5px;
    padding-right: 5px;
    font-size: 20px; 
  }


  
 
  
  .logoutContainer {
    margin-left: auto;
    display: flex;
    align-items: center;
  }

  nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
  }

  nav ul li a {
    text-decoration: none;
    color: var(--text-primary, #323232);
    padding: 6px 14px;
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
    border: 1px solid transparent;
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
  }
  nav ul li a:hover {
    background: var(--bg-tertiary, #f0f0f0);
    border-color: var(--border-btn, #c0c5e9a3);
  }
  /* Bouton "Connexion" mis en avant */
  nav ul li:first-child a {
    background: #6b4798;
    color: #fff;
    border-color: transparent;
  }
  nav ul li:first-child a:hover {
    background: var(--purple-hover, #7b1ae1);
    border-color: transparent;
  }
  
  /* -- Thread info toolbar -- */
  .threadInfo-container {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    justify-content: center;
  }

.thread-toolbar {
    position: relative;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #98bbe829 0%, #f5f7ff00 60%, #c6e0ff30 100%);
    border-radius: 999px;
    padding: 0px 0px 0px 0px;
    border: 1px solid #2377ff21;
    /* box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -8px rgba(99, 102, 241, 0.15), inset 0 1px 0 rgba(255, 255, 255, 1); */
    gap: 6px;
    transition: all 0.25s ease;
    max-width: 810px;
}



.thread-toolbar::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #6366f1, #a855f7, transparent);
  opacity: 0.4;
}

/* Chat title input */
.chat-title {
  flex: 1;
  min-width: 180px;
  font-size: 15px;
  font-weight: 600;
  color: #688297;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  outline: none;
  font-family: inherit;
  letter-spacing: -0.01em;
  transition: all 0.2s;
}

.chat-title:hover {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(99, 102, 241, 0.15);
}

.chat-title:focus {
  background: #ffffff;
 
}

#nameStatusMsg {
  font-size: 0.9em;
  color: #28a745;
}

/* Delete button */
.btn-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 29px;
  height: 29px;
  min-width: 34px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-delete svg {
  width: 16px;
  height: 16px;
}

.btn-delete:hover {
  background: linear-gradient(180deg, #fff 0%, #fef2f2 100%);
  color: #ef4444;
  box-shadow: 0 1px 2px rgba(239, 68, 68, 0.12);
}

/* Share button — same shape as delete, blue accent on hover */
.btn-share {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 29px;
  height: 29px;
  min-width: 34px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.btn-share svg { width: 16px; height: 16px; }
.btn-share:hover {
  background: linear-gradient(180deg, #fff 0%, #eff6ff 100%);
  color: #2563eb;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.12);
}
[data-theme="dark"] .btn-share:hover {
  background: rgba(37, 99, 235, 0.12);
  color: #93c5fd;
}

/* Dark theme toolbar */
[data-theme="dark"] .thread-toolbar {
background: linear-gradient(135deg, #1e293b 0%, #1e1b4b45 100%);  border-color: #312e81;

}

[data-theme="dark"] .chat-title {
  color: #f1f5f9;
}

[data-theme="dark"] .chat-title:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] .chat-title:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: #6366f1;
}

[data-theme="dark"] .btn-delete {
  color: #64748b;
}

[data-theme="dark"] .btn-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  box-shadow: none;
}
  
/* ── Folder custom dropdown ── */
.folder-dropdown-wrapper {
  position: relative;
  flex-shrink: 0;
}

.folder-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  border: 0px solid #7c839b4a;
  background: linear-gradient(44deg, #e4eaff29 0%, #68686a17 100%);
  font-size: 13px;
  font-weight: 600;
  color: #473466c2;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(99, 102, 241, 0.06);
  white-space: nowrap;
}

.folder-trigger:hover {
  background: linear-gradient(180deg, #ffffff 0%, #eef2ff 100%);
  border-color: #c7d2fe;
}

.folder-trigger[aria-expanded="true"] {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.folder-trigger-icon { font-size: 14px; }

.folder-trigger-chevron {
  width: 14px;
  height: 14px;
  opacity: 0.5;
  transition: transform 0.2s, opacity 0.2s;
}

.folder-trigger[aria-expanded="true"] .folder-trigger-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.folder-trigger--loading .folder-trigger-icon {
  display: inline-block;
  animation: folder-spin 0.6s linear infinite;
}

@keyframes folder-spin {
  to { transform: rotate(360deg); }
}

/* Panel */
.folder-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 210px;
  max-height: 320px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #e0e7ff;
  border-radius: 14px;
  box-shadow:
    0 8px 32px -4px rgba(99, 102, 241, 0.18),
    0 2px 8px -2px rgba(15, 23, 42, 0.08);
  z-index: 1000;
  padding: 6px;
}

.folder-panel[hidden] { display: none; }

.folder-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  transition: background 0.12s;
  outline: none;
}

.folder-item:hover,
.folder-item:focus {
  background: #f5f3ff;
  color: #4338ca;
}

.folder-item--selected {
  background: #eef2ff;
  color: #4338ca;
  font-weight: 600;
}

.folder-item--child {
  padding-left: 28px;
  font-size: 12px;
  color: #6b7280;
}

.folder-item--child:hover,
.folder-item--child:focus {
  color: #4338ca;
}

.folder-item-icon { font-size: 14px; flex-shrink: 0; }

.folder-item--parent { justify-content: flex-start; }

.folder-item-toggle {
  margin-left: auto;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.4;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: opacity 0.15s, background 0.15s;
}

.folder-item-toggle svg {
  width: 12px;
  height: 12px;
  transition: transform 0.2s;
}

.folder-item--collapsed .folder-item-toggle svg {
  transform: rotate(-90deg);
}

.folder-item-toggle:hover {
  opacity: 1;
  background: rgba(99, 102, 241, 0.12);
}

[data-theme="dark"] .folder-item-toggle:hover {
  background: rgba(99, 102, 241, 0.2);
}

.folder-panel-separator {
  height: 1px;
  background: #e0e7ff;
  margin: 4px 2px;
}

/* Dark */
[data-theme="dark"] .folder-trigger {
  background: linear-gradient(180deg, #2246b038 0%, #1e1b4b00 100%);  border-color: #4338ca8a;
  color: #d9cce5cc;
}

[data-theme="dark"] .folder-trigger:hover {
  background: linear-gradient(180deg, #3830a39d 0%, #312e8175 100%);
}

[data-theme="dark"] .folder-trigger[aria-expanded="true"] {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

[data-theme="dark"] .folder-panel {
  background: #1e293b;
  border-color: #312e81;
  box-shadow: 0 8px 32px -4px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .folder-item { color: #c7d2fe; }

[data-theme="dark"] .folder-item:hover,
[data-theme="dark"] .folder-item:focus {
  background: rgba(99, 102, 241, 0.15);
  color: #e0e7ff;
}

[data-theme="dark"] .folder-item--selected {
  background: rgba(99, 102, 241, 0.25);
  color: #e0e7ff;
}

[data-theme="dark"] .folder-item--child { color: #818cf8; }

[data-theme="dark"] .folder-panel-separator { background: #312e81; }

.header-actions {
  display: grid;
  grid-auto-flow: column;    /* aligne les items en ligne */
  grid-auto-columns: max-content;
  gap: 8px;                  /* espace entre les icônes */
  align-items: center;
  margin-left: auto;
}

.lookup-toggle_icon {
  display: inline-block;
  width: 28px;
  height: 28px;
  background-image: url('../img/icon_gen/lookupSmall.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: white;
  border: transparent;
  border-radius: 5px;
  cursor: pointer;

}

.apps-launcher-toggle-btn {
  display: inline-block;
  width: 28px;
  height: 28px;
  background-image: url('../img/icon_gen/apps.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: white;
  border: transparent;
  border-radius: 5px;
  cursor: pointer;  
}

.logoutBox {
  display: inline-block;         
  width: 28px;
  height: 28px;
  background-image: url('../img/icon_gen/logout.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 5px;
}



#theme-toggle  {
  width: 28px;
  height: 28px;
  background-image: url('../img/icon_gen/sun.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border: transparent;
  border-radius: 5px;
  cursor: pointer;
  }

    /* ── Notifications ── */
#notification-container {
  position: fixed;
  top: 85px;
  right: 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9000;
  max-width: 400px;
  width: 360px;
  pointer-events: none;
}

.notification {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.13);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateX(120%);
  pointer-events: auto;
  font-family: "LtpR", Helvetica, sans-serif;
  font-size: 0.9rem;
  line-height: 1.45;
}

.notification.notif-visible {
  animation: notif-in 0.3s cubic-bezier(0.34, 1.3, 0.64, 1) forwards;
}

.notification.notif-hiding {
  animation: notif-out 0.22s ease-in forwards;
}

@keyframes notif-in  { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes notif-out { from { transform: translateX(0);    opacity: 1; } to { transform: translateX(120%); opacity: 0; } }

.notif-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  margin-top: 1px;
}

.notif-body {
  flex: 1;
  min-width: 0;
}

.notif-title {
  font-weight: 600;
  margin-bottom: 3px;
}

.notif-message {
  word-break: break-word;
}

.notif-close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 0 0 4px;
  opacity: 0.6;
  color: inherit;
  transition: opacity 0.15s;
}

.notif-close:hover { opacity: 1; }

.notif-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: rgba(88, 88, 88, 0.18);
  animation: notif-progress linear forwards;
  transform-origin: left;
}

@keyframes notif-progress { from { width: 100%; } to { width: 0%; } }

/* ── Types ── */
.notification-success {
  background-color: #edfaf1;
  border-color: #a3d9b1;
  color: #1a5e35;
}
.notification-success .notif-progress { background: rgba(13, 70, 26, 0.22); }

.notification-error {
  background-color: #fff0f0;
  border-color: #f5b8bb;
  color: #8b1a1a;
}
.notification-error .notif-progress { background: rgba(114, 28, 36, 0.22); }

.notification-warning {
  background-color: #fffbec;
  border-color: #f5d87a;
  color: #6b4e00;
}
.notification-warning .notif-progress { background: rgba(133, 100, 4, 0.22); }

.notification-info {
  background-color: #eff8ff;
  border-color: #93c5fd;
  color: #1e4d78;
}
.notification-info .notif-progress { background: rgba(12, 84, 96, 0.22); }

/* ── Dark mode ── */
[data-theme="dark"] .notification-success { background-color: #0d2e1a; border-color: #2d6a3f; color: #7dd89a; }
[data-theme="dark"] .notification-error   { background-color: #2e0d0d; border-color: #7a2222; color: #f4a0a0; }
[data-theme="dark"] .notification-warning { background-color: #2e2200; border-color: #7a5a00; color: #f5d06a; }
[data-theme="dark"] .notification-info    { background-color: #0d1e2e; border-color: #1e5a8a; color: #7db8e8; }