/* ========== GLOBAL RESET ========== */
* {
  box-sizing: border-box;
}
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
}
body {
  font-family: Helvetica, sans-serif;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ========== HEADER ========== */
header {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 10;
}
.header-left,
.header-right {
  display: flex;
  align-items: center;
  flex-shrink: 1;
  min-width: 0;
}
.header-right {
  flex-direction: column;
  align-items: flex-end;
}
.logo {
  max-height: 40px;
  max-width: 100%;
  height: auto;
  width: auto;
}
.title-line {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  flex: 1;
  min-width: 0;
}
.title {
  font-size: 22px;
  font-weight: normal;
}
.model-cost-line {
  font-size: 12px;
  color: #4caf50;
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-end;
  padding-right: 0;
  margin-top: 4px;
  word-break: break-word;
}
.model-name {
  font-weight: normal;
  color: #707070;
  margin-right: 0px;
}
.model-highlight {
  background-color: #f5f5f5;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: bold;
}

/* ========== MAIN & CHAT ========== */
main {
  flex: 1;
  margin-top: 90px;
  overflow-y: auto;
  padding: 20px 20px 80px;
  scroll-behavior: smooth;
}
.chat-window {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bubble {
  max-width: 70%;
  padding: 10px;
  border-radius: 10px;
  position: relative;
}
.bubble.user {
  background: #eee;
  align-self: flex-end;
  text-align: right;
}
.bubble.bot {
  background: none;
  align-self: flex-start;
  text-align: left;
  margin: 0;
  padding: 0;
}
.bot-label-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.ordinal {
  font-size: 13px;
  font-weight: bold;
  color: #2a3f7d;
  background-color: #dfe9fb;
  border-radius: 14px;
  padding: 3px 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  position: relative;
  bottom: 2px;
}
.cost {
  font-size: 12px;
  color: green;
  margin-bottom: 5px;
  text-align: right;
}

/* ========== FOOTER & FORM ========== */
footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  padding: 0 7px 10px 5px;
  display: flex;
  justify-content: center;
  background: transparent;
}
form {
  display: flex;
  align-items: center;
  width: 100%;
}
.input-wrapper {
  display: flex;
  align-items: center;
  gap: 0px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  width: 100%;
  padding: 5px 10px;
}
textarea {
  flex: 1;
  padding: 14px 10px;
  font-size: 16px;
  line-height: 20px;
  resize: none;
  border: none;
  border-radius: 30px;
  outline: none;
  max-height: 150px;
}
textarea::placeholder {
  font-size: 16px;
  color: #aaa;
}
button,
.icon-button {
  background: transparent;
  border: none;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
button img,
button svg,
.icon-button img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  transition: 0.2s ease;
}

/* ========== LOADER ========== */
.loader-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.76);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}
.loader-overlay.active {
  display: flex;
}
.loader-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.loader-text {
  margin-top: 12px;
  color: #444;
  font-size: 18px;
  font-weight: bold;
  font-style: italic;
}
#loaderImage {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

/* ========== STATUS BANNERS & BLOCKS ========== */
.status-banner {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  margin: 4px 0 0;
  padding: 6px 16px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  font-style: italic;
}
.status-footer {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 12.25px;
  font-style: italic;
  font-weight: 500;
  padding: 4px 14px;
  letter-spacing: 0.1px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  margin-bottom: 20px;
}
.status-frame {
  margin: 0;
  padding: 0;
  border: none;
  background-color: transparent;
}

.status-frame.rslt,
.status-frame.esc,
.status-frame.cht {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
}

.status-wrapper {
  padding: 0;
  margin: 0;
  gap: 0;
  border: none;
}
.status-frame .bubble.bot {
  margin: 0;
  padding: 12px 18px;
  border-radius: 0;
  background: none;
}
/* === Color themes === */
.status-banner.rslt, .status-footer.rslt {
  background-color: #DFF2DD;
  color: #2e5d2e;
}
.status-banner.cht, .status-footer.cht {
  background-color: #FFD0D0;
  color: #a04040;
}
.status-banner.esc, .status-footer.esc {
  background-color: #FFF4CE;
  color: #8a6100;
}
.status-frame.rslt {
  background-color: #F2FCFC;
}
.status-frame.esc {
  background-color: #FCFCF2;
}
.status-frame.cht {
  background-color: #FCF2F2;
}
.status-footer.cht {
  background-color: #FFE8E8;
  color: #A32828;
}
.status-footer.esc {
  background-color: #FFF6DA;
  color: #7A5800;
}
.status-footer.rslt {
  background-color: #E6F5E6;
  color: #2F6E2F;
}

.tooltip {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: #444;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.icon-button:hover .tooltip {
  opacity: 1;
}
.tooltip-bubble {
  position: absolute;
  background-color: #333;
  color: #fff;
  padding: 10px 10px;
  border-radius: 8px;
  font-size: 13px;
  white-space: nowrap;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.tooltip-bubble::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 80%;
  transform: translateX(-50%);
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

.tooltip-bubble.show {
  opacity: 1;
}

.session-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 30px 0;
  width: 100%;
  position: relative;
  z-index: 0;
}

.divider-text {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #2a3f7d;
  background-color: #dfe9fb;
  border-radius: 20px;
  white-space: nowrap;
  position: relative;
  z-index: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.session-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #dfe9fb;
  z-index: 0;
}

/* Popup container */
.predefined-popup {
  position: absolute;
  z-index: 999;
  background: #fff;
  padding: 18px 24px;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  max-width: 420px;
  width: 90vw;
  font-size: 15px;
  max-height: 70vh;
  overflow-y: auto;
  line-height: 1.55;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.predefined-popup.visible {
  opacity: 1;
  transform: scale(1);
}

.predefined-popup:hover {
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.24);
}

/* Section titles */
.prompt-section {
  margin: 18px 0 10px;
  font-weight: bold;
  font-size: 15px;
  color: #222;
}

/* Prompt chips */
.prompt-line {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  margin: 4px 4px 4px 0;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* Base background styles for prompt types */
.prompt-line.rslt     { background-color: #F2FCFC; color: #2e5d2e; }
.prompt-line.esc      { background-color: #FCFCF2; color: #8a6100; }
.prompt-line.cht      { background-color: #FCF2F2; color: #a04040; }
.prompt-line.clarify  { background-color: #F2F2FC; color: #2a3f7d; }

/* On hover — match status-banner color */
.prompt-line.rslt:hover    { background-color: #DFF2DD; }
.prompt-line.esc:hover     { background-color: #FFF4CE; }
.prompt-line.cht:hover     { background-color: #FFD0D0; }
.prompt-line.clarify:hover { background-color: #c4d9fd; }

.prompt-line:hover {
  box-shadow: 0 0 0 1px rgba(0,0,0,0.04);
}


