/* ==================================================
   T&A Consulting Chatbot – FINAL FIX (Updated)
   Scrollable messages + fixed input section
   ================================================== */

.ta-chatbot-container {
  position: fixed;
  bottom: 95px;
  right: 24px;
  width: 360px;
  height: 520px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  font-family: "Segoe UI", Arial, sans-serif;
  overflow: hidden;
  z-index: 9999;
}

/* --- Header --- */
.ta-chatbot-header {
  flex-shrink: 0;
  background: #c91616;
  color: #fff;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ta-chatbot-header select {
  border: none;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 13px;
}
.ta-chatbot-header button {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

/* --- Scrollable messages area --- */
.ta-chatbot-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f6f6f6;
  scroll-behavior: smooth;
}
.ta-chatbot-messages::-webkit-scrollbar {
  width: 8px;
}
.ta-chatbot-messages::-webkit-scrollbar-thumb {
  background: #bbb;
  border-radius: 6px;
}

/* --- Messages --- */
.ta-chatbot-message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
}

/* --- User message --- */
.ta-chatbot-message.user {
  align-self: flex-end;
  background: #d8fdd8;
  text-align: right;
  border: 1px solid #b9e3b9;
}

/* --- Bot message --- */
.ta-chatbot-message.bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e2e2e2;
  text-align: left !important;
  color: #333;
}

/* --- Bottom section --- */
.ta-chatbot-bottom {
  flex-shrink: 0;
  background: #fff;
  border-top: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 8px;
  position: relative;
  z-index: 2;
}

/* --- Quick buttons --- */
.ta-chatbot-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ta-chatbot-quick button {
  background: #f1f1f1;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.ta-chatbot-quick button:hover {
  background: #e2e2e2;
}

/* --- Input field + send button --- */
.ta-chatbot-input-area {
  display: flex;
  gap: 6px;
}
.ta-chatbot-input-area input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}
.ta-chatbot-input-area button {
  background: #c91616;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease;
}
.ta-chatbot-input-area button:hover {
  background: #a81212;
}

/* --- Floating open button --- */
.ta-chatbot-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #c91616;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  transition: background .2s ease, transform .2s ease;
  z-index: 9999;
}
.ta-chatbot-toggle:hover {
  background: #a51212;
  transform: scale(1.05);
}

/* --- Responsive adjustments --- */
@media (max-width: 480px) {
  .ta-chatbot-container {
    width: 95vw;
    height: 70vh;
    right: 10px;
    bottom: 90px;
  }
}
