@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap");
* {
  padding: 0;
  margin: 0;
  text-decoration: none;
  list-style: none;
  box-sizing: border-box;
}
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
::-webkit-scrollbar-thumb { background: #888; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

body { font-family: Poppins; }

/* Main chat container */
.chat-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 800px;
  z-index: 10000;
}

/* Combined wrapper for button and chat */
.chat-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
  transition: all 0.4s cubic-bezier(0.33, 1, 0.68, 1);
  max-height: 80px;
  min-height: 80px;
  overflow: hidden;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: rgb(0 0 0 / 10%) 0px 1px 6px, rgb(0 0 0 / 20%) 0px 2px 24px;
}

.chat-wrapper.expanded {
  max-height: 80vh;
  min-height: 60vh;
  border-radius: 10px;
}

.chat-window2 {
  display: none;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 30px 0;
}
.chat-wrapper.expanded .chat-window2 { display: flex; }

/* Message container */
.message-box {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  width: 100%;
  padding: 0 42px;
  overflow-y: auto;
  scroll-behavior: smooth;
  /*display: flex;
  flex-direction: column;*/
  text-align: right;
}

.message-box li {
    font-size: 14px;
    list-style: disc;
    margin-bottom: 1.1em;
}
/* Welcome message */
.hi-there {
  color: #333645;
  padding: 20px 0;
  border-radius: 5px;
  margin-bottom: 15px;
  line-height: 2em;
  text-align: left;
}
.hi-there .p1 { font-size: 20px; }
.hi-there .p2 { font-size: 14px; }

/* User message styles */
.message-box .first-chat {
  display: inline-block;           /* Inline block so width = content */
  max-width: 70%;                  /* Limit width for long messages */
  background: #EAEBF0;
  border-radius: 20px;
  padding: 20px;
  margin: 8px 0;
  margin-left: auto;               /* Push to right edge */
  text-align: left;                /* Text alignment inside bubble */
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.message-box .first-chat p {
  font-size: 14px;
  margin: 0;
  overflow-wrap: break-word;
  font-weight: normal;
}

/* AI message styles */
.message-box .second-chat {
  width: auto;
  padding: 10px;
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  align-items: start;
  text-align: left;
}
.message-box .second-chat p {
  padding: 12px 15px;
  margin: 0;
  border-radius: 15px 15px 0 15px;
  color: #000;
  font-size: 14px;
  line-height: 1.6em;
}

/* Growing and fading in answer bubble */
.answer-grow {
  height: 0;
  opacity: 0;
  overflow: hidden;
  transition: height 2s cubic-bezier(0.4,0,0.2,1), opacity 1s;
  will-change: height, opacity;
}

/* Typing indicator */
.typing-indicator {
  min-height: 120px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  height: 120px;
  margin: 10px 0;
}
.lottie-animation {
  width: 120px;
  height: 120px;
}
.chat-spacer {
  width: 100%;
  transition: height 1s cubic-bezier(0.4,0,0.2,1);
  pointer-events: none;
}
/* Markdown styling */
.markdown-content {
  font-family: Poppins, sans-serif;
  line-height: 1.5;
  width: 100%;
}
.markdown-content h1, .markdown-content h2 { font-weight: bold; margin: 10px 0; }
.markdown-content ul { list-style-type: disc; margin: 10px 0 10px 20px; font-size: 14px; }
.markdown-content ul li { list-style: disc; }
.markdown-content ol { list-style-type: decimal; margin: 10px 0 10px 20px; }
.markdown-content p { margin: 10px 0; }
.markdown-content code {
  display: inline-block;
  background-color: #f4f4f4;
  color: #c7254e;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: monospace;
}
.markdown-content pre {
  background-color: #f4f4f4;
  padding: 10px;
  border-radius: 5px;
  overflow-x: auto;
}
.markdown-content a { color: #007bff; text-decoration: none; }
.markdown-content a:hover { text-decoration: underline; }

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.overlay.show { opacity: 1; pointer-events: auto; }

/* Trigger button */
.chat-trigger {
  padding: 2% 6%;
  color: #001158;
  cursor: pointer;
  display: flex;
  align-items: center;
  height: 80px;
  column-gap: 20px;
  transition: opacity 0.2s ease;
}
.chat-wrapper.expanded .chat-trigger { display: none; }
.chat-trigger p {
  flex: 1;
  font-size: 15px;
  line-height: 1.3;
  flex-basis: 40%;
  text-align: center;
}
#chat-open-button {
  padding: 12px 25px;
  background: #00158a;
  color: #ffd767;
  border: none;
  display: flex;
  align-items: center;
  font-size: 14px;
  text-transform: uppercase;
  cursor: pointer;
  flex-basis: 40%;
  justify-content: center;
}
#chat-open-button .material-icons-outlined { font-size: 17px; margin-left: 8px; }

/* Close button */
.chat-bar-close {
  position: absolute;
  top: 10px;
  right: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}
.chat-wrapper.expanded .chat-bar-close { opacity: 1; }
.chat-bar-close button {
  background-color: #fff;
  cursor: pointer;
  padding: 1px;
  border-style: none;
  vertical-align: middle;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 20px;
}
.grad-bg {
    padding: 15px;
    background: linear-gradient(0deg, #fff, transparent);
    margin-top: -30px;
    position: relative;
    z-index: 10;
}
/* Input area */
.input-box {
  font-size: 12px;
  padding: 0px 15px;
  padding-bottom: 0;
  display: flex;
  column-gap: 15px;
  flex-shrink: 0;
  background: #EAEBF0;
  align-items: center;
  border-radius: 20px;
  border: 1px solid #D3D6DE;
  margin: 0 45px;
}
.input-box .write-reply { width: 100%; }
.input-box .write-reply textarea {
  outline: none;
  font-size: 14px;
  width: 100%;
  height: 70px;
  max-height: 20vh;
  border: 0;
  padding: 25px 20px;
  resize: none;
  overflow-y: hidden;
  font-family: 'Poppins', sans-serif;
  background: transparent;
}
.input-box .send-button {
  border: none;
  outline: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.input-box .send-button button {
  border: none;
  background-color: #001158;
  cursor: pointer;
  outline: none;
  padding: 7px 8px;
  border-radius: 50px;
  transform: rotate(-45deg);
  line-height: .9em;
}
.input-box .send-button button i {
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  line-height: 1em;
}

.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
  background: #fff;
}

.markdown-content th,
.markdown-content td {
  border: 1px solid #e3e3e3;
  padding: 10px 14px;
  text-align: left;
}

.markdown-content th {
  background: #f5f6fa;
  color: #001158;
  font-weight: 600;
}

.markdown-content tr:nth-child(even) td {
  background: #fafbfc;
}

.markdown-content tr:hover td {
  background: #f0f5ff;
}

/* Optional: rounded corners for the table */
.markdown-content table {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
/* Animations */
.fade-in { animation: fadeIn 0.5s ease-in-out forwards; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Responsive styles */
@media screen and (max-width: 768px) {
  .chat-container { width: 95%; bottom: 10px; }
  .chat-wrapper.expanded { max-height: 85vh; min-height: 65vh; }
  .message-box .first-chat, .message-box .second-chat { max-width: 85%; }
  .input-box { padding: 0 10px 10px; }
  .input-box .write-reply textarea { padding: 15px; font-size: 16px; }
}
@media screen and (max-width: 480px) {
  .chat-trigger { font-size: 16px; height: 60px; padding: 10px 15px; column-gap: 10px; }
  .chat-wrapper { max-height: 60px; min-height: 60px; }
  #chat-open-button { padding: 10px 15px; font-size: 12px; }
  .hi-there .p1 { font-size: 18px; }
  .message-box { padding: 10px; }
}