@import "/static/css/global.css";

#exampleModalCenter .modal-dialog {
  max-width: 100vw;
  width: 100vw;
  height: 100vh;
  margin: 0;
}

#exampleModalCenter .modal-content {
  height: 100vh;
  border: 0;
  border-radius: 0;
}

/* dashboard start here */
#exampleModalCenter .chat-main-wrap .main-content {
  padding-top: 89px;
  background: linear-gradient(0deg, #E5F5EE 0%, #E0F1F2 49.52%, #FFF 100%);
  height: 100vh;
  min-height: 100vh;
  display: flex;
  align-items: start;
  justify-content: center;
  gap: 100px;
}

/* dynamic states for chatbot summary behavior */
#exampleModalCenter .chat-main-wrap .main-content.no-summary {
  justify-content: center;
}

#exampleModalCenter .chat-main-wrap .main-content.no-summary .chat-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    width: 50%;
    padding-bottom: 24px;
}

#exampleModalCenter .chat-main-wrap .main-content.no-summary .summary-panel {
  display: none !important;
}

#exampleModalCenter .chat-main-wrap .main-content.has-summary .chat-container {
  width: 50%;
}

#exampleModalCenter .AI-icon {
  filter: drop-shadow(0 12px 24px rgba(16, 16, 16, 0.10));
}

#exampleModalCenter .chat-main-wrap header {
  border-bottom: 1px solid var(--border-color);
  position: fixed;
  width: 100%;
  background-color: var(--white);
}

#exampleModalCenter .chat-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  width: 50%;
  padding-bottom: 24px;
}

/* Scroll area */
#exampleModalCenter .chat-messages {
  flex-grow: 1;
  padding: 24px;
  overflow-y: auto;
}

/* Global scrollbar style inside chatbot modal */
#exampleModalCenter *,
#exampleModalCenter *::before,
#exampleModalCenter *::after {
  scrollbar-width: thin;
  scrollbar-color: #9bcfc2 transparent;
}

#exampleModalCenter *::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

#exampleModalCenter *::-webkit-scrollbar-track {
  background: transparent;
}

#exampleModalCenter *::-webkit-scrollbar-thumb {
  background-color: #9bcfc2;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

#exampleModalCenter *::-webkit-scrollbar-thumb:hover {
  background-color: #7fbbae;
}

/* Message row */
#exampleModalCenter .chat-row {
  display: flex;
  margin-bottom: 12px;
}

/* Alignments */
#exampleModalCenter .chat-row.bot {
  justify-content: flex-start;
}

#exampleModalCenter .chat-row.user {
  justify-content: flex-end;
}

/* Force bot content to stay left-aligned */
#exampleModalCenter .chat-row.bot .chat-bubble {
  text-align: left;
}

#exampleModalCenter .chat-row.bot .chat-bubble > .d-flex.flex-column {
  align-items: flex-start !important;
  text-align: left !important;
}

#exampleModalCenter .bot-message-text,
#exampleModalCenter .bot-message-text span,
#exampleModalCenter .bot-message-text strong {
  text-align: left !important;
}

/* Bubble style */
#exampleModalCenter .chat-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 14px;
}

/* User bubble */
#exampleModalCenter .chat-row.user .chat-bubble {
  background: #BFE5D4;
  box-shadow: 0 8px 16px 0 rgba(2, 97, 68, 0.08);
}

#exampleModalCenter .chat-bubble img {
  width: 40px;
  height: 40px;
}


#exampleModalCenter .bot-message-text strong {
  font-weight: 700;
}

#exampleModalCenter .chat-input-box {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 24px 8px 8px 24px;
  height: 140px;
  border: 1px solid transparent;
}

#exampleModalCenter .chat-input-box textarea {
  resize: none;
  border: none;
  outline: none;
  box-shadow: none;
  overflow-y: auto;
  padding-bottom: 10px;
}

#exampleModalCenter .chat-input-box:focus-within {
  border: 1px solid var(--Primary-Green);
  box-shadow: 0 16px 32px 0 rgba(0, 118, 82, 0.10), 8px 0 32px 0 rgba(2, 97, 68, 0.12), 0 0 0 3px rgba(0, 102, 97, 0.15);
}

#exampleModalCenter .chat-btn-wrap {
  width: 100%;
}

#exampleModalCenter .voice-btn,
#exampleModalCenter .send-btn {
  width: 40px;
  height: 40px;
}

#exampleModalCenter .summary-panel {
  padding: 24px;
  width: 25%;
  overflow-y: auto;
  height: calc(100% - 24px);
  display: none;
}

#exampleModalCenter .summary-panel.show {
  display: block !important;
}

#exampleModalCenter .gradient-bg {
  border-radius: 10px;
  background: linear-gradient(180deg, #00867E 0%, #00201E 100%);
  padding: 10px;
}

#exampleModalCenter .dark-theme .gradient-bg {
  background: linear-gradient(180deg, #004440 0%, #00201E 100%);
}

#exampleModalCenter .summary-item {
  background-color: var(--white);
  border-radius: 12px;
}

@media (max-width: 991px) {
  #exampleModalCenter .chat-main-wrap .main-content {
    padding-top: 73px !important;
    min-height: 100vh;
    gap: 30px;
  }

  #exampleModalCenter .chat-container {
    width: 100%;
    padding: 16px;
  }

  /* Scroll area */
  #exampleModalCenter .chat-messages {
    overflow-y: auto;
    padding: 0px;
  }

  /* Alignments */
  #exampleModalCenter .chat-row.bot {
    justify-content: start;
  }

  #exampleModalCenter .chat-row.user {
    justify-content: end;
  }

  #exampleModalCenter .chat-bubble {
    max-width: 90%;
  }

  #exampleModalCenter .chat-bubble img {
    width: 32px;
    height: 32px;
  }

  #exampleModalCenter .chat-input-box {
    padding: 16px 8px 8px 16px;
    height: 100px;
  }

  #exampleModalCenter .voice-btn,
  #exampleModalCenter .send-btn {
    width: 32px;
    height: 32px;
  }

  #exampleModalCenter .summary-panel {
    display: none !important;
  }

  #exampleModalCenter .summary-card {
    background-color: var(--white);
    border-radius: 16px;
  }

  #exampleModalCenter .mobile-truncate {
    display: inline-block;
    max-width: 90px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
  } 
}

/* Waiting for Vera's reply */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-typing .typing-dots {
  display: inline-flex;
  align-items: flex-end;
  gap: 5px;
  height: 14px;
}

.chat-typing .typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--Primary-Green, #006661);
  animation: chat-typing-bounce 1.2s infinite ease-in-out both;
}

.chat-typing .typing-dots span:nth-child(2) { animation-delay: .15s; }
.chat-typing .typing-dots span:nth-child(3) { animation-delay: .3s; }

.chat-typing .typing-label {
  font-size: 14px;
  color: #6b7280;
}

.chat-typing .typing-label::after {
  content: "";
  animation: chat-typing-ellipsis 1.2s steps(4, end) infinite;
}

@keyframes chat-typing-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .35; }
  40% { transform: translateY(-6px); opacity: 1; }
}

@keyframes chat-typing-ellipsis {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-typing .typing-dots span,
  .chat-typing .typing-label::after { animation: none; opacity: 1; }
}

#messageInput:disabled,
#sendBtn:disabled,
#voiceBtn:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* Quick reply buttons under a question */
.chat-quick-replies .quick-reply-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 80%;
  margin-left: auto;
}

.quick-reply-chip {
  border: 1px solid var(--Primary-Green, #006661);
  background: #fff;
  color: var(--Primary-Green, #006661);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 15px;
  line-height: 1.4;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}

.quick-reply-chip:hover,
.quick-reply-chip:focus-visible {
  background: var(--Primary-Green, #006661);
  color: #fff;
  outline: none;
}

.quick-reply-chip.quick-reply-more {
  border-style: dashed;
}

@media (max-width: 576px) {
  .chat-quick-replies .quick-reply-list { max-width: 100%; }
}

/* "Email Termsheet" popup, over the chat window */
.term-sheet-email-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.45);
  border-radius: inherit;
}
.term-sheet-email-overlay[hidden] { display: none; }
.term-sheet-email-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 28px 24px 24px;
  background: var(--white, #fff);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}
.term-sheet-email-card form { text-align: left; }
.term-sheet-email-card .form-label {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
  margin-bottom: 6px;
}
/* The chat sits inside the home page banner, whose `.bannerbg p` is pale and centered. */
.term-sheet-email-overlay .term-sheet-email-card p {
  font-size: 15px;
  color: #374151;
}
.term-sheet-email-overlay .term-sheet-email-card .term-sheet-email-hint {
  font-size: 14px;
  font-weight: 400;
  color: #6b7280;
  text-align: left;
}
.term-sheet-email-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6b7280;
}
.term-sheet-email-close:hover { background: rgba(15, 23, 42, 0.06); color: #111827; }
