/* =======================================================================
6) CHAT-PANEL UI (APP) — ABSOLUTE 3-PANE LAYOUT
======================================================================= */

/* Disable image dragging */
#outer-container img{
  -webkit-user-drag: none;
  user-drag: none;
}

/* OUTER */
#outer-container{
  position: relative;
  height: 90vh;
  width: 100vw;
  user-select: none;
  background: white;
  overflow: hidden;
}

/* LEFT */
#left-container{
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 200px;
  height: auto;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Support both legacy (#left-box) and class (.left-box) */
#left-box,
.left-box{
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 70px;
  min-height: 70px;
  cursor: pointer;
  background: #F5F5F5;
}

#left-box:nth-child(even),
.left-box:nth-child(even){
  background: #ffffff;
}

#left-box:hover,
.left-box:hover{
  background-color: #b8cbd3;
}

.selected{
  background-color: #b8d3cb;
}

/* clickable overlay films */
.top-film,
.bottom-film{
  position: absolute;
  inset: 0;
  outline: none;
  transition: background-color 0.2s;
  background-color: transparent;
}

.top-film{
  pointer-events: auto;
  z-index: 3;
}

.bottom-film{
  z-index: 0;
  pointer-events: none;
}

.svg{
  display: block;
  width: 40px;
  height: 40px;
}

/* nameplate overlay */
.left-nameplate,
.left-text,
.up-text{
  padding-left: 60px;
  flex-grow: 1;
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.left-container-name{
  line-height: 1;
}

.left-name{
  white-space: nowrap;
  font-size: 1.1em;
  font-weight: bold;
  padding-bottom: 1px;
  line-height: 1;
}

.left-title{
  padding-top: 1px;
  font-size: 0.9em;
  white-space: nowrap;
  margin: 0;
  line-height: 1;
}

/* badge + letter: centered vertically */
.left-badge{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 10px;
  z-index: 2;
}

.left-letter{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 1.2em;
  font-weight: bold;
  z-index: 3;
  pointer-events: none;
}

.left-intro,
.left-aid{
  display: none;
}

.left-desc{
  align-items: center;
  height: 100%;
}

/* clamp preview text */
.left-hello{
  position: absolute;
  justify-content: center;
  padding-left: 280px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* SEPARATOR */
#separator{
  position: absolute;
  left: 200px;
  top: 0;
  bottom: 0;
  width: 10px;
  background: #E5E5E5;
  height: auto;
}

.separator{
  z-index: 7;
  position: absolute;
  left: 200px;
  top: 0;
  bottom: 0;
  width: 10px;
  display: flex;
  flex-direction: column;
  cursor: ew-resize;
  color: #B5B5B5;
  font-size: 1.5em;
  justify-content: center;
}

/* RIGHT */
#right-container{
  z-index: 6;
  position: absolute;
  left: 210px;
  right: 0;
  top: 0;
  bottom: 0;
  width: auto;
  height: auto;
  background: #b8cbd3;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* TOPBAR */
#topbar-container{
  background-color: #b8cbd3;
  flex: 0 0 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0px 10px 0 10px;
  white-space: nowrap;
}

#topbar-left,
#topbar-right{
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

#topbar-left{
  justify-content: flex-start;
  margin-left: 10px;
}

#topbar-right{
  justify-content: space-between;
  margin-right: 10px;
}

#topbar-badge{
  margin-left: auto;
}

.icon-glyph,
.topbar-letter{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.2em;
  font-weight: bold;
  color: #E0E0E0;
  z-index: 10;
  pointer-events: none;
}

.topbar-letter:hover{ color: white; }

.topbar-nameplate{
  padding-left: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.topbar-name{
  font-size: 1.1em;
  font-weight: bold;
  color: black;
  line-height: 1;
  padding-bottom: 1px;
}

.topbar-title{
  padding-top: 1px;
  font-size: 0.95em;
  color: black;
  line-height: 1;
}

.topbar-aid,
.topbar-idx{
  display: none;
}

#topbar-resize{ display: none; }

.leftbar-badge,
#topbar-prevbtn,
#topbar-nextbtn,
#topbar-closebtn,
#topbar-badge,
#topbar-resize,
#topbar-close{
  fill: #07519B;
  color: #E0E0E0;
  stroke: #E0E0E0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

#topbar-closebtn{ fill: red; }

#topbar-badge:hover,
#topbar-prevbtn:hover,
#topbar-nextbtn:hover,
#topbar-closebtn:hover{
  stroke: white;
  color: white;
}

/* SCROLLBAR REGION */
#scrollbar-container{
  flex: 1 1 auto;
  background: #f5f5f5;
  max-height: none;
  overflow: hidden;
  display: flex;
}

.scrollbar-container{
  flex: 1 1 auto;
  overflow-y: auto;
  background: #F5F5F5;
  width: 100%;
}

.scrollbar-output{
  width: 100%;
  padding-left: 10px;
  overflow-y: auto;
  background-color: #F5F5F5;
  user-select: text;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

.speaker{
  font-weight: bold;
  color: black;
}

.user-bubble,
.asst-bubble{
  background-color: #F5F5F5;
  color: black;
  margin: 10px 20px 0px 5px;
  line-height: 1.2;
}

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

.asst-bubble{
  animation: slideIn 0.45s ease;
}

/* WAITINGBAR */
#waiting-container{
  flex: 0 0 30px;
  height: 30px;
  background: #F5F5F5;
}

.chat-waiting{
  justify-content: center;
  align-items: center;
  opacity: 0;
  height: 30px;
  display: flex;
}

.dot{
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #808080;
  margin: 0 4px;
}

.dot:nth-child(1){ animation: blink 1s infinite; }
.dot:nth-child(2){ animation: blink 1s infinite 0.33s; }
.dot:nth-child(3){ animation: blink 1s infinite 0.66s; }

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

/* INPUTBAR */
.inputbar-container{
  flex: 0 0 auto;
  border: 1px solid #D0D0D0;
  background-color: #b8cbd3;
  padding: 6px;
  display: flex;
  align-items: center;
}

.input-group{
  flex-grow: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.chat-input,
.chat-textarea{
  font-family: Helvetica, Arial, sans-serif;
  font-size: 1em;
  flex: 1;
  border: 1px solid #D0D0D0;
  outline: none;
  background-color: #FFFFFF;
  color: black;
  padding: 5px;
  min-width: 0;
  resize: none;
}

.chat-input{ height: 30px; }
.chat-textarea{ height: 70px; }

.input-controls{
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-send{
  font-size: 0.9em;
  font-weight: bold;
  height: 30px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  color: #E0E0E0;
  background-color: #07519B;
}

#chat-send:not(:disabled){ background: #07519b; }
#chat-send:not(:disabled):hover{ background: #0A66C2; }

.upArrow,
.downArrow{
  width: 30px;
  height: 30px;
  cursor: pointer;
  margin-right: 20px;
  stroke: #E0E0E0;
  background-color: #07519B;
  border-radius: 5px;
}

.upArrow:hover,
.downArrow:hover{
  stroke: white;
}
