/* Style for the entire scrollbar */
::-webkit-scrollbar {
  width: 8px; /* Width of the scrollbar */
  height: 8px; /* Height of the scrollbar (for horizontal scrollbar) */
}

/* Style for the scrollbar track */
::-webkit-scrollbar-track {
  background: #111; /* Background of the track */
  border-radius: 10px; /* Optional: Rounding the corners */
}

/* Style for the scrollbar thumb (draggable part) */
::-webkit-scrollbar-thumb {
  background-color: #888; /* Color of the scrollbar */
  border-radius: 10px; /* Optional: Rounding the thumb */
  border: 1px solid #111; /* Adds some padding and background to the thumb */
}

/* Style when hovering over the scrollbar */
::-webkit-scrollbar-thumb:hover {
  background-color: #555; /* Darker color on hover */
}

/* Optional: Customize the horizontal scrollbar (if needed) */
::-webkit-scrollbar-horizontal {
  height: 8px; /* Height of the horizontal scrollbar */
}

body{
  font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
  /*font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;*/
  font-size: medium;

  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--page-bg);
  color: var(--text-color);

}

/* Theme variables */
:root{
  --page-bg: #f2f6fb;
  --panel-bg: rgba(255,255,255,0.98);
  --text-color: #0f1720;
  --muted-color: #6b7280;
  --important-color: #3f524f;
  --accent-color: #1ff8ff;
  --accent-strong: #0ae0e0;
  --input-bg: #f8f9fb;
  --bubble-user-bg: #ffffff;
  --bubble-assistant-bg: #ffffff;
  --shadow: 0 14px 40px rgba(0,0,0,0.12);
  --state-bg: linear-gradient(90deg, rgba(31, 255, 236, 0.18), rgba(255,255,255,0.02));
}

/* Dark theme: add class 'dark-theme' on body or #app */
.dark-theme {
  --page-bg: #0b1220;
  --panel-bg: rgba(12,14,20,0.72);
  --text-color: #e6eefc;
  --muted-color: #9aa6bf;
  --important-color: #c6faef;
  --accent-color: #1ff8ff;
  --accent-strong: #0ae0e0;
  --input-bg: rgba(255,255,255,0.03);
  --bubble-user-bg: rgba(255,255,255,0.03);
  --bubble-assistant-bg: rgba(255,255,255,0.02);
  --shadow: 0 14px 40px rgba(0,0,0,0.5);
  --state-bg: linear-gradient(90deg, rgba(74, 240, 255, 0.12), rgba(255,255,255,0.01));
}

.match-cards {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.match-card {
  border: 1px solid color-mix(in srgb, var(--accent-strong) 35%, transparent);
  border-radius: 14px;
  padding: 12px;
  background: var(--bubble-assistant-bg);
  box-shadow: 0 5px 18px rgba(0,0,0,.08);
}

.match-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.match-card-head span, .match-card-subject { color: var(--muted-color); font-size: .88rem; }
.match-card-subject { margin-top: 5px; }
.match-card-contact { margin-top: 8px; overflow-wrap: anywhere; }
.match-route-button {
  margin-top: 10px;
  border: 0;
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--text-color);
  background: color-mix(in srgb, var(--accent-color) 18%, transparent);
  cursor: pointer;
}
.match-route-button i { margin-right: 5px; }
.match-route-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,.58);
}
.match-route-dialog {
  position: relative;
  width: min(520px, 94vw);
  padding: 18px;
  border-radius: 18px;
  color: var(--text-color);
  background: var(--panel-bg);
  box-shadow: 0 20px 70px rgba(0,0,0,.3);
}
.match-route-dialog h3 { margin-top: 0; }
.match-route-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: transparent;
  color: var(--text-color);
  font-size: 1.7rem;
  cursor: pointer;
}
.match-route-map { display: block; width: 100%; min-height: 260px; border-radius: 14px; background: linear-gradient(135deg, rgba(44,120,255,.18), rgba(40,190,150,.16)); }
.route-map-frame { display: block; width: 100%; height: min(68vh, 560px); border: 0; border-radius: 14px; background: #fff; }
.match-route-line { stroke: var(--accent-strong); stroke-width: 1.8; stroke-dasharray: 3 2; }
.match-route-start { fill: #1d9bf0; stroke: white; stroke-width: 1; }
.match-route-end { fill: #ef5350; stroke: white; stroke-width: 1; }
.match-route-label { fill: var(--text-color); font-size: 3.2px; font-weight: 600; }
.xover-link-dialog { width: min(900px, 96vw); }
.xover-link-dialog iframe { display: block; width: 100%; height: min(72vh, 680px); border: 0; border-radius: 12px; background: #fff; }
.xover-link-fallback { display: inline-flex; gap: 7px; align-items: center; margin-top: 10px; color: var(--accent-strong); }

.copy-btn {
  position: absolute;
  max-width: 70px;
  top: 0px;
  right: 5px;

  background: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: 1px;
  padding: 5px;
  font-size: 12px;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

strong {
  font-weight: bolder;
  color: var(--important-color);
  
}

pre {
  /*background: #eeeeee;
  color: #0d0d0d;*/
  padding: 10px 12px;
  border-radius: 6px;
  margin: 8px 0;
  font-family: "Fira Code", monospace;
  white-space: pre-wrap;
  overflow-x: auto;
  
}





.msgdateshow{
  padding-left: 5px;
  margin-bottom: 5px;
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted-color);
  font-family: 'Courier New', Courier, monospace;
  line-height: normal;
  
  border-left: var(--muted-color) solid 0.5px;
}

.fileWrapper{
  width: 48%;
  vertical-align: auto;
  display: inline-block;
  align-items: center;
  justify-content: center;
  background-color: #f0efef;
  border-radius: 10px;
  padding: 5px;

}

.fileImg{
  border-radius: 10px;
  width:100%;
  box-shadow: 2px 3px 3px rgba(0,0,0,0.3);
}

.comment-box{
  padding-left: 5px;
  margin-bottom: 5px;
  margin-top: 8px;
  font-size: small;
  color: var(--muted-color);
  font-family: 'Courier New', Courier, monospace;
  line-height: normal;
  border-left: var(--muted-color) solid 0.5px;
}

.comment-boxlg{
  padding-left: 10px;
  margin-bottom: 10px;
  margin-top: 5px;
  font-size:larger;
  color: var(--text-color);
  font-family: 'Courier New', Courier, monospace;
  line-height: normal;
  border-left: var(--muted-color) solid 0.2px;
}

.ident1-box{
  padding-left: 10px;
  margin: 5px;
  margin-bottom: 18px;
}

.ident2-box{
  padding-left: 10px;
  margin: 5px;
  margin-bottom: 5px;
}

b{
  font-size: 14px;
  color: var(--important-color);
}


.bigLogo{
  width:30px;
  height: auto;
  vertical-align:middle;
  display: inline-block;
  margin:3px;
}

 /* Loader plein écran */
 #loader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: linear-gradient(135deg, #fffffffa, #ddfffdea);
  color: rgb(15, 15, 15);
  z-index: 9999;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
}


.spinner {
  width: 50px;
  height: 50px;
  border: 6px solid rgba(204, 204, 203, 0.427);
  border-top-color: #222222;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 1px;
  animation: pulse 1.4s ease-in-out infinite;
  color: #1b1b1b;
}

.loading-textLite {
  font-size: 13px;
  font-weight: 300;
  
  animation: pulseLite 1.4s ease-in-out infinite;
  color: #242424;
}

@keyframes pulse {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

@keyframes pulseLite {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

/* Contenu principal */
#app {
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
  
}

#app.visible {
  opacity: 1;
}




#criticalAlerter {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: linear-gradient(135deg, #fffffffa, #ddfffdea);
  color: rgb(15, 15, 15);
  z-index: 10001;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#criticalAlerter.hidden {
  opacity: 0;
  visibility: hidden;
}


#Alerter {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: linear-gradient(135deg, #fffffffa, #ddfffdea);
  color: rgb(15, 15, 15);
  z-index: 10001;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#Alerter.hidden {
  opacity: 0;
  visibility: hidden;
}


#formBox{
  position: fixed;
  
  inset: 0;
  top: 14vh;
  height: 84vh;
  display: block;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: linear-gradient(135deg, #fffffffa, #ddfffdea);
  color: rgb(15, 15, 15);
  z-index: 10009;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  overflow-x: hidden;
  overflow-y: auto;
  padding-top: 12px;
  padding-bottom: 12px;
}

#formBox.hidden {
  opacity: 0;
  visibility: hidden;
}


#BigShowBox{
  position: fixed;
  
  inset: 0;
  top: 14vh;
  height: 84vh;
  display: block;
  text-align: left;
  align-items: left;
  justify-content: left;
  flex-direction: column;
  background: linear-gradient(135deg, #fffffffa, #ddfffdea);
  color: rgb(15, 15, 15);
  z-index: 10009;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  overflow-x: hidden;
  overflow-y: auto;
  padding-top: 13px;
  padding-bottom: 13px;
  padding-left: 10px;
  padding-right: 10px;
}

#BigShowBox.hidden {
  opacity: 0;
  visibility: hidden;
}


h1,h2,h3,h4{
  margin-top: 6px;
  margin-bottom: 3px;
}
h4{
  margin-left: 5px;
}
h1,h2,h3,h4,div::first-letter,b::first-letter,i::first-letter {
  text-transform: capitalize;
}




button {
  width: 98%;
  height: 45px;
  padding: 10px;
  background: black;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s ease;
  margin: 5px;
}

button:hover {
  background: rgb(19, 19, 19);
}
.sidebarXov {
  background: #030303;
  color: aliceblue;
  width: 15%;
  height:100vh;
  padding: 2px;
  text-align: left;
  font-size: small;
  position: fixed;
  left: 0;
  top: 0;
  
}

.sidebarXovHead {
  width: 100%;
  height:5vh;
  background-size: 100% 100%;
  padding: 5px;
  text-align: left;
  font-size: small;
  position: relative;
  
}

.sidebarXovBottom {
  width: 100%;
  height:15vh;
  background-size: 100% 100%;
  padding: 5px;
  text-align: left;
  font-size: small;
  position: relative;
  
}

.sidebarXovContent {
  width: 100%;
  height:75vh;
  background-size: 100% 100%;
  padding-left: 35px;
  padding-top: 25px;
  text-align: left;
  font-size: small;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  
}

/*chat*/


.headerBar {
  width: 100%;
  height: 7vh;
  position: sticky;
  position: -webkit-sticky;
  top: 0; /* ← indispensable pour activer sticky */
  position: sticky;
  z-index: 1000;

  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  
}

.header h1 {
  font-size: 24px;
  color: #333;
}

.menu {
  position: relative;
}

#menu-options {
  position: absolute;
  top: 30px;
  right: -50px;
  background-color: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 10px;
  display: none;
}

#menu-options li {
  list-style: none;
  padding: 5px 0;
  cursor: pointer;
}

.chat-container {
  width: 100%;
  max-width: 750px;
  margin: 0;
  top: 0;
  border: 0px solid #ccc;
  border-radius: 10px;
  padding: 10px;
  height: 100vh; /* Utilisation de 80% de la hauteur de la fenêtre */
  position: fixed;
  
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    overflow-x: hidden;
    overflow-y: auto;
  
}

.chat-box {
  width: 100%;
  height: 75%; /* Utilisation de 70% de la hauteur du chat-container */
  overflow-x: hidden;
  overflow-y: auto;
  border-bottom: 0px solid #f7f5f5;
  margin-bottom: 20px;
  padding-bottom: 60px;
  position: relative;
}

#previewBox {
  margin-top: 5px;
  border: 0px solid #ccc;
  padding: 10px;
  display: none; /* Hide initially */
  text-align: center;
  align-items: center;
  justify-items: center;
  width: 100%;
  max-height: 300px;
  overflow: auto;
  border-radius: 10px;
}
.previewBox {
  margin-top: 5px;
  border: 0px solid #ccc;
  padding: 10px;
  display: block; /* Hide initially */
  text-align: center;
  align-items: center;
  justify-items: center;
  display: inline-block;
  max-width: 49%;
  overflow: auto;
  border-radius: 10px;
  margin: 5px;
}
.filePreviewImgIn{
  border-radius: 10px;
  width: 90%;
  box-shadow: 2px 3px 3px rgba(0,0,0,0.3);
}
.filePreviewImg{
  border-radius: 10px;
  height: 150px;
  box-shadow: 2px 3px 3px rgba(0,0,0,0.3);
}
.filePreviewText{
  display:inline-flex;
  align-items:center;
  gap:10px;
  margin:5px;
  padding:10px 12px;
  border:1px solid rgba(42,120,255,.28);
  border-radius:12px;
  background:var(--panel-bg, #f7f9fc);
  text-align:left;
  max-width:260px;
}
.filePreviewText > i{font-size:24px;color:#2a78ff}
.filePreviewText span{display:flex;flex-direction:column;min-width:0}
.filePreviewText strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.filePreviewText small{opacity:.7;margin-top:3px}



#message-container{
  width: 100%;
  max-width: 900px;
  position: sticky;
  bottom: 5px;
  z-index: 1000;
  padding: 12px 14px;
  border-radius: 28px;
  background: var(--panel-bg);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#message-input {
  width: 100%;
  padding: 16px 18px;
  border: 0px solid rgb(255, 255, 255);
  vertical-align:middle;
  max-height: 240px;
  min-height: 46px;
  border-radius: 28px;
  background-color: var(--input-bg);
  color: var(--text-color);
  font-size: 16px;
  resize: none;
}

.buttonChat {
  
  padding: 2px;
 
  cursor: pointer;
  vertical-align: middle;
  
  display: inline-block;
  
}

#message-container .message-row{
  display: flex;
  align-items: center;
  gap: 12px;
}

.input-wrapper{
  flex: 1 1 auto;
  position: relative;
}

.input-wrapper textarea{
  width: 100%;
  padding: 12px 14px;
  border-radius: 20px;
  border: 1px solid rgba(0,0,0,0.06);
  resize: none;
  min-height: 48px;
  max-height: 220px;
  transition: all 200ms ease;
  background: var(--input-bg);
  color: var(--text-color);
  padding-right: 44px; /* space for expand button */
}

.input-wrapper.expanded textarea{
  min-height: 140px;
}

.expand-btn{
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 12;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--muted-color);
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 180ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.expand-btn:hover { background: rgba(0,0,0,0.04); }
.expand-btn.active { background: var(--accent-color); color: #fff; transform: translateY(-50%) scale(1.06); box-shadow: 0 8px 18px rgba(31,118,255,0.18); }
.expand-btn.active svg path { stroke: #fff; transition: stroke 160ms ease; }
.expand-btn svg path { transition: stroke 160ms ease; }

.controls-row{
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.control-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-color);
  color: #fff;
  border: none;
  box-shadow: 0 8px 18px rgba(31,118,255,0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  cursor: pointer;
  padding: 0;
}

.control-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(31,118,255,0.30);
}

#submitButton {
  display: none;
}

#submitWFButton {
  display: none;
}

#speetchTtext {
  display: inline-flex;
}

.voice-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.voice-select {
  flex: 1;
  min-width: 160px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.06);
  background: var(--input-bg);
  color: var(--text-color);
  font-size: 13px;
}
.speech-status {
  font-size: 13px;
  color: #444;
  white-space: nowrap;
}
.voice-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-color);
  color: #fff;
  border: none;
  box-shadow: 0 8px 18px rgba(31,118,255,0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.voice-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(31,118,255,0.30);
}
.voice-btn.active {
  background: var(--accent-strong);
}
.voice-btn.speaking {
  animation: pulseVoice 1.2s infinite ease-in-out;
}
@keyframes pulseVoice {
  0%, 100% { box-shadow: 0 0 0 0 rgba(31,118,255,0.4); }
  50% { box-shadow: 0 0 0 18px rgba(31,118,255,0.08); }
}

.buttonChat.listening {
  animation: pulseVoice 1.1s infinite ease-in-out;
  transform: translateY(-2px);
}

.assistant-state {
  display: inline-block;
  padding: 6px 10px;
  margin-bottom: 6px;
  border-radius: 16px;
  background: var(--state-bg);
  color: var(--text-color);
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.assistant-state.flash-mirror {
  transform: scaleX(-1) translateY(0);
}

.assistant-state::after {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,0.08), rgba(31,118,255,0.12));
  margin-top: 6px;
  border-radius: 2px;
  opacity: 0.9;
}

.imgLogoMini{
  vertical-align: middle;
  width: 20px;
  margin: 2px;
  border-radius: 100%;
}
.imgLogoMiniName{
  vertical-align: middle;
  margin: 2px;
  font-size: small;
}
.imgLogo{
  vertical-align: middle;
  width: 30px;
  margin: 5px;
}

.imgLogoLarge{
  vertical-align: middle;
  width: 70px;
  margin: 5px;
}

.imgLogoVLarge{
  vertical-align: middle;
  width: 100px;
  margin: 5px;
}

.big_p_photo{
  vertical-align: middle;
  width: 100px;
  height: 100px;
  margin: 5px;
  border-radius: 100%;
}



#imagePreviewContainer {
  display: flex;
  flex-wrap: wrap;
}

.previewImage {
  width: 100px;
  height: 100px;
  margin: 5px;
}

.words {
  width: 600px;
  max-width: 90%;
  margin: 10px auto;
  background: white;
  border-radius: 5px;
  box-shadow: 10px 10px 0 rgba(0,0,0,0.1);
  padding: 1rem 2rem 1rem 5rem;
  background: -webkit-gradient(linear, 0 0, 0 100%, from(#636363), color-stop(4%, #252525)) 0 4px;
  background-size: 100% 3rem;
  position: relative;
  line-height: 3rem;
}

p {
  margin: 0 0 3rem;
}

.words:before {
  content: '';
  position: absolute;
  width: 4px;
  top: 0;
  left: 30px;
  bottom: 0;
  border: 1px solid;
  border-color: transparent #efe4e4;
}

.wrapper {
  display: grid;
  gap: 20px;
  width: 600px;
  max-width: calc(100vw - 50px);
  padding: 30px;
  border-radius: 10px;
  background-color: #0003;
  margin: 0 auto;
  
}

#text {
  resize: none; /* Disable resizing */
  border: none; /* Remove border */
  outline: none; /* Remove outline */
  display: block;
  height: 130px;
  padding: 20px;
  border: none;
  font-size: inherit;
  font-family: inherit;
  resize: vertical;
  background: -webkit-gradient(linear, 0 0, 0 100%, from(#9c9c9c), color-stop(4%, #141414)) 0 4px;
  background-size: 100% 3rem;
  text-align: center;
  color: #efe4e4;
  border-radius: 15px;
}

#speak {
  padding: 10px;
  border: 1px solid #fff;
  color: #fff;
  background-color: #0009;
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
}
#state{
  font-size: 30px;
  color: #ffffff;
}
#stateIni{
  font-size: 18px;
  
}

#chat-Speetch{
  position: fixed;
  z-index: 1001;
  width: 700px;
  max-width: 90%;
  top: 10%;
  
  overflow-y: auto;
  border-bottom: 1px solid #ccc;
  background-color: black;
  color: #efe4e4;
  border-radius: 15px;
  display: none;
}


@keyframes fadeIn {
  
  0% { opacity: 0.5; color: rgb(75, 200, 75); }
    50% { opacity: 1; color: rgb(200, 75, 75) }
    80% { opacity: 0.5; color: rgb(200, 192, 75) }
    100% { opacity: 0.5; color: rgb(75, 200, 75); }
}

#welcomBox{
  text-align:center;
  opacity: 0;
  max-width:95%;
  color: var(--text-color);
  padding: 70px 20px 70px 20px;
  transition: opacity 1.5s ease-in-out;
  animation: fadeIn 4s ease-in-out infinite;

  
}

#welcomBox.visible {
  opacity: 1;
  
}


.myChat{
  width: fit-content;
  max-width:95%; 
  position:relative;
  margin-left:auto;
  margin-right:0;
  margin-top:10px;
  font-weight: 400;
  font-size: medium;
}

.botChat{
  width: fit-content;
  width:98%; 
  position:relative;
  padding:1px;
  left:10px;
  margin-top:10px;
  font-size: medium;
  /*font-weight: 400;*/
}
.messageElementTextBoxL{
  text-align: left;
  padding-left: 10px;

  width: fit-content;
  /*max-width:95%;*/
  
  position:relative;
  border-radius:20px 0px 20px 20px;
  /*background: var(--bubble-assistant-bg);*/
  color: var(--text-color);
  padding:10px;
  margin-left:auto;
  margin-right:0;
  margin-top:0px;
  /*font-weight: 300;*/
  overflow-x: auto;
  
}

.messageElementTextBoxR{
  text-align: left;
  padding-left: 15px;

  /*box-shadow:1px 1px 5px #fbfbfb;*/
  width: fit-content;
  max-width:95%; 
  position:relative;
  border-radius:0px 20px 20px 20px;
  /*background: var(--bubble-user-bg);*/
  color: var(--text-color);
  padding:10px;
  left:10px;
  margin-top:0px;
  font-weight: 300;
}

/* Media query pour les écrans plus petits */
@media only screen and (max-width: 900px) {
  .fileWrapper{
  width: 48%;
  vertical-align: auto;
  display: inline-block;
  align-items: center;
  justify-content: center;
  background-color: #f0efef;
  border-radius: 10px;
  padding: 5px;

}

}

/* Modern chat surface overrides */
body {
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(56, 189, 248, 0.12), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(16, 185, 129, 0.10), transparent 26%),
    var(--page-bg);
}

:root {
  --page-bg: #ffffff;
  --panel-bg: rgb(255, 255, 255);
  --text-color: #111827;
  --muted-color: #64748b;
  --accent-color: #2c2c2c;
  --accent-strong: #141414;
  --input-bg: #ffffff;
  --bubble-user-bg: #dff7ef;
  --bubble-assistant-bg: #faf9f4;
  --line-color: rgba(15, 23, 42, 0.11);
  --shadow: 0 18px 55px rgba(15, 23, 42, 0.16);
  --state-bg: linear-gradient(90deg, rgba(176, 248, 242, 0.16), rgba(243, 243, 242, 0.08));
}

.dark-theme {
  --page-bg: #101419;
  --panel-bg: rgba(19, 24, 31, 0.84);
  --text-color: #edf2f7;
  --muted-color: #94a3b8;
  --input-bg: rgba(255, 255, 255, 0.06);
  --bubble-user-bg: rgba(20, 184, 166, 0.18);
  --bubble-assistant-bg: rgba(250, 249, 244, 0.10);
  --line-color: rgba(255, 255, 255, 0.12);
}

button.buttonChat,
.buttonChat {
  width: 35px;
  height: 35px;
  margin: 0;
  border-radius: 50%;
  background-color: var(--input-bg);
  color: var(--text-color);
  border: 1px solid var(--line-color);
}

span.buttonChat {
  width: 35px;
  height: 35px;
  margin: 0;
  border-radius: 50%;
  background-color: var(--input-bg);
  color: var(--text-color);
  border: 1px solid var(--line-color);
}

.chat-container {
  max-width: 960px;
  padding: 0 18px;
  display: flex;
  flex-direction: column;
}

.headerBar {
  height: 64px;
  padding: 0 4px;
  backdrop-filter: blur(18px);
  background: linear-gradient(180deg, var(--page-bg), rgba(255, 255, 255, 0));
}

.chat-box {
  flex: 1 1 auto;
  height: auto;
  padding: 18px 8px 150px;
  margin: 0;
}

#message-container {
  position: sticky;
  bottom: 12px;
  width: min(100%, 920px);
  margin: 0 auto 12px;
  padding: 10px;
  border: 1px solid var(--line-color);
  border-radius: 22px;
  backdrop-filter: blur(22px) saturate(1.2);
}

#message-container .message-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

.composer-icon,
.control-icon,
.voice-btn,
#stopStreamBtn,
#streamControlBtn,
#speetchTtext_side {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-color);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-color);
  box-shadow: none;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.dark-theme .composer-icon,
.dark-theme .control-icon,
.dark-theme .voice-btn,
.dark-theme #stopStreamBtn,
.dark-theme #streamControlBtn,
.dark-theme #speetchTtext_side {
  background: rgba(255, 255, 255, 0.06);
}

.composer-icon:hover,
.control-icon:hover,
.voice-btn:hover,
#stopStreamBtn:hover,
#streamControlBtn:hover,
#speetchTtext_side:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.45);
  color: var(--accent-color);
}

.control-icon {
  background: var(--input-bg) !important;
  color: var(--text-color) !important;
  border-color: transparent !important;
  font-size: 20px !important;
  box-shadow: 0 8px 18px rgba(31,118,255,0.18) !important;
}

#submitButton[style*="inline"],
#submitButton[style*="inline-flex"],
#submitButton[style*="inline-block"],
#submitWFButton[style*="inline"],
#submitWFButton[style*="inline-flex"],
#submitWFButton[style*="inline-block"] {
  display: inline-flex !important;
}

.legacy-mic,
.controls-row > span.control-icon {
  display: none !important;
}

.input-wrapper {
  min-width: 0;
  flex: 1 1 auto;
}

.input-wrapper textarea,
#message-input {
  min-height: 48px;
  max-height: 60vh;
  border-radius: 18px;
  border: 1px solid var(--line-color);
  box-shadow: inset 0 1px 0 rgb(253, 253, 253);
  line-height: 1.45;
  outline: none;
}

.input-wrapper.expanded textarea {
  height: 60vh !important;
  min-height: 60vh;
  overflow-y: auto;
}

.expand-btn {
  top: 8px;
  right: 8px;
  transform: none;
}

.expand-btn.active {
  transform: none;
}

.composer-voice-select {
  display: none !important;
}

.voice-settings-panel {
  margin-top: 16px;
  padding-right: 14px;
}

.voice-setting-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}


.messageElementTextBoxL {
  border: 1px solid var(--line-color);
  box-shadow: 0 10px 28px rgba(228, 228, 228, 0.08);
  animation: messageFade 420ms ease both;
  border-radius: 18px 18px 6px 18px;
}



.messageElementTextBoxL {
  border-radius: 18px 18px 18px 6px;
  background: var(--bubble-assistant-bg);
}

@keyframes messageFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.assistant-state {
  position: relative;
  overflow: hidden;
  padding: 8px 14px;
  font-weight: 600;
  letter-spacing: 0;
  animation: stateBreathe 1.4s ease-in-out infinite;
}

.assistant-state.flash-mirror {
  transform: none;
}

.assistant-state::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 10%, rgba(255,255,255,0.55), transparent 70%);
  transform: translateX(-150%);
  animation: mirrorSweep 1.6s ease-in-out infinite;
}

@keyframes stateBreathe {
  0%, 100% { opacity: 0.72; }
  50% { opacity: 1; }
}

@keyframes mirrorSweep {
  to { transform: translateX(120%); }
}

.voice-live-panel {
  position: fixed;
  left: 50%;
  bottom: 102px;
  transform: translate(-50%, 18px);
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(520px, calc(100vw - 28px));
  padding: 12px 14px;
  border: 1px solid var(--line-color);
  border-radius: 20px;
  color: var(--text-color);
  background: var(--panel-bg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}

.voice-live-panel.active {
  opacity: 1;
  transform: translate(-50%, 0);
}

.voice-orb {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, #14b8a6, #0f766e);
}

.voice-orb span {
  grid-area: 1 / 1;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  animation: voiceWave 1.2s ease-in-out infinite;
}

.voice-orb span:nth-child(2) { animation-delay: 160ms; }
.voice-orb span:nth-child(3) { animation-delay: 320ms; }

@keyframes voiceWave {
  0%, 100% { transform: scale(0.6); opacity: 0.55; }
  50% { transform: scale(1.7); opacity: 0.14; }
}

.voice-live-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.voice-live-text span {
  color: var(--muted-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.assistant-sources {
  display: block;
  margin: 10px 0 4px;
  border: 1px solid var(--line-color);
  border-radius: 12px;
  background: rgba(15, 118, 110, 0.04);
  background: color-mix(in srgb, var(--input-bg) 72%, transparent);
  overflow: hidden;
  font-size: .82rem;
}
.assistant-sources summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 10px;
  cursor: pointer;
  list-style: none;
  color: var(--muted-color);
  user-select: none;
}
.assistant-sources summary::-webkit-details-marker { display: none; }
.assistant-sources summary::before { content: '›'; font-size: 1.15rem; line-height: 1; transition: transform .18s ease; }
.assistant-sources[open] summary::before { transform: rotate(90deg); }
.assistant-sources summary i { color: #218894; }
.assistant-sources-count {
  margin-left: auto;
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  text-align: center;
  background: rgba(33, 136, 148, .14);
  color: var(--text-color);
  font-size: .75rem;
}
.assistant-source-list { padding: 0 8px 8px; }
.source-item {
  margin-top: 8px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line-color);
  background: rgba(15, 118, 110, 0.06);
}
.source-item a { color: #087f8c; text-decoration: underline; overflow-wrap: anywhere; }
.dark-theme .source-item a { color: #67e8f9; }
.source-item small { display: block; color: var(--muted-color); margin-top: 4px; }
.source-media { display: block; max-width: 100%; margin: 8px 0; border-radius: 8px; overflow: hidden; }
.source-media img { display: block; width: min(100%, 420px); max-height: 220px; object-fit: cover; }
.source-media-video { width: min(100%, 520px); max-height: 260px; background: #000; }
.source-media-audio { width: min(100%, 420px); }

.source-preview {
  color: var(--muted-color);
  font-size: 13px;
  margin-top: 4px;
}

.markdown-stream-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; color: var(--text-color); }
.chat-process { margin: 3px 4px; padding: 6px 8px; border: 1px solid color-mix(in srgb, var(--line-color, #889) 68%, transparent); border-radius: 10px; font-size: .78rem; color: var(--muted-color); background: color-mix(in srgb, var(--bubble-assistant-bg, #fff) 62%, transparent); backdrop-filter: blur(15px) saturate(1.25); box-shadow: 0 5px 18px rgba(15, 23, 42, .08); }
.chat-process summary { cursor: pointer; color: var(--text-color); }
.chat-process[data-state="active"] summary { position: relative; overflow: hidden; border-radius: 6px; animation: statusFade 1.35s ease-in-out infinite alternate; }
.chat-process[data-state="active"] summary::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 10%, rgba(148, 163, 184, .4), transparent 70%);
  transform: translateX(-150%);
  animation: mirrorSweep 1.6s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .chat-process[data-state="active"] summary::after { animation: none; }
}
.chat-process ol { margin: 8px 0 0; padding-left: 1.5em; max-height: 13em; overflow: auto; }
.chat-process li { padding: 2px 0; }
.chat-process li[data-state="active"] { color: var(--text-color); font-weight: 600; }
.chat-process li[data-state="done"]::marker { color: #218894; }
.chat-process[data-state="error"] summary { color: #d97706; }

@keyframes statusFade { from { opacity: .54; } to { opacity: 1; } }

.message-retry { display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; margin-left:4px; padding:0; border:0; border-radius:50%; background:transparent; color:var(--muted-color); cursor:pointer; }
.message-retry:hover { color:var(--accent-color); background:rgba(42, 120, 255, .10); }

.continue-stream-btn {
  width: auto;
  height: 36px;
  margin: 8px 0 0 34px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 14px;
  border: 1px solid var(--line-color);
  background: var(--bubble-assistant-bg);
  color: var(--accent-color);
  font-weight: 600;
}

@media only screen and (max-width: 760px) {
  .chat-container {
    padding: 0 10px;
  }

  #message-container .message-row {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .input-wrapper {
    flex: 1 1 auto;
    min-width: 0;
  }

  .composer-icon,
  .control-icon {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px;
  }
}

@media only screen and (max-width: 900px) {
/* New messages indicator */
#newMessagesBtn {
  position: sticky;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  background: var(--input-bg);
  color: var(--text-color);
  border-radius: 20px;
  padding: 8px 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  border: none;
}

#newMessagesBtn.hidden { display:none }
  .previewBox {
    margin-top: 5px;
    border: 0px solid #ccc;
    padding: 10px;
    display: block; /* Hide initially */
    text-align: center;
    align-items: center;
    justify-items: center;
    display: inline-block;
    max-width: 48%;
    overflow: auto;
    border-radius: 10px;
    margin: 5px;
  }
  .filePreviewImgIn{
    border-radius: 10px;
    width: 95%;
    box-shadow: 2px 3px 3px rgba(0,0,0,0.3);
  }
  #chat-Speetch{
    position: fixed;
    z-index: 10001;
    width: 100%;
    max-width: 100%;
    top: 0%;
    left: 0%;
    height: 100vh;
    overflow-y: auto;
    border-bottom: 1px solid #ccc;
    background-color: black;
    color: #efe4e4;
    border-radius: 15px;
    display: none;

  }
  .sidebarXov{
    width: 100%;
    z-index: 1000000;
    display: none;
    animation: position all 0.5s;
    left: -100;
  }
  #menu{
    display: block;
  }
  #logoHeadMenu{
    display: block;
  }
}

/* Audio Recording Panel Styles */
.audio-recording-panel {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--msg-bg);
  border: 2px solid var(--accent-color);
  border-radius: 15px;
  padding: 15px;
  z-index: 2000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  min-width: 300px;
  animation: slideUp 0.3s ease-out;
}

/* Focused layout fixes */
.sidebarXov {
  width: 280px;
  max-width: calc(100vw - 24px);
  z-index: 1400;
  display: none;
  border-right: 1px solid rgba(255,255,255,0.12);
  box-shadow: 18px 0 45px rgba(0,0,0,0.28);
}

.sidebarXovContent {
  padding: 24px 18px;
}

.sidebarXovBottom {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 12px;
}

#message-container .message-row {
  align-items: flex-end;
}

.controls-row {
  align-self: flex-end;
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
  padding-bottom: 3px;
}

.controls-row > span.control-icon,
#speetchTtext_legacy {
  display: inline-flex;
}

#stopVoiceBtn {
  background: #dc2626 !important;
  color: #fff !important;
}

.assistant-state {
  display: block;
  width: fit-content;
  margin: 8px 0 0 42px;
}

.audio-recording-panel {
  bottom: 96px;
  width: min(420px, calc(100vw - 28px));
  background: var(--panel-bg);
  color: var(--text-color);
  border: 1px solid rgba(220,38,38,0.45);
  border-radius: 18px;
}

.recording-controls button {
  width: auto;
  height: 40px;
}

@media only screen and (min-width: 1100px) {
  .sidebarXov {
    left: calc(50% - 760px);
  }
}

@media only screen and (max-width: 760px) {
  #message-container {
    border-radius: 18px;
  }

  #message-container .message-row {
    gap: 6px;
  }

  .controls-row {
    gap: 5px;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.recording-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  color: var(--accent-color);
  font-weight: bold;
}

.recording-timer {
  font-size: 18px;
  font-family: 'Courier New', monospace;
  color: #ff4444;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.recording-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 15px 0;
  height: 40px;
}

.recording-wave {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: center;
}

.recording-wave span {
  width: 4px;
  height: 20px;
  background: var(--accent-color);
  border-radius: 2px;
  animation: wave 0.6s ease-in-out infinite;
}

.recording-wave span:nth-child(1) { animation-delay: 0s; }
.recording-wave span:nth-child(2) { animation-delay: 0.1s; }
.recording-wave span:nth-child(3) { animation-delay: 0.2s; }
.recording-wave span:nth-child(4) { animation-delay: 0.3s; }
.recording-wave span:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
  0%, 100% { height: 20px; opacity: 0.6; }
  50% { height: 35px; opacity: 1; }
}

.recording-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.recording-controls button {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

#cancelRecordingBtn {
  background: #ff6666;
  color: white;
}

#cancelRecordingBtn:hover {
  background: #ff4444;
}

#sendRecordingBtn {
  background: var(--accent-color);
  color: white;
}

#sendRecordingBtn:hover {
  opacity: 0.8;
}


/* Private reminder cards delivered by the local scheduler. */
.reminder-card {
  display: grid;
  gap: 7px;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(96, 165, 250, .28);
  border-radius: 12px;
  background: rgba(96, 165, 250, .09);
}
.reminder-card-time,
.reminder-card-state { font-size: .82rem; opacity: .78; }
.reminder-card-body { font-size: .9rem; opacity: .9; }
.reminder-card-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.reminder-card-actions button {
  border: 0;
  border-radius: 8px;
  padding: 5px 8px;
  color: inherit;
  background: rgba(255, 255, 255, .11);
  cursor: pointer;
}
.reminder-card-actions button:hover:not(:disabled) { background: rgba(96, 165, 250, .28); }
.reminder-card-actions button:disabled { opacity: .55; cursor: default; }
