/* ============================================================
   TARA MINERALS — FAQ CHATBOT WIDGET
   chatbot.css — Styles for floating chat widget
   ============================================================ */

/* ---------- Toggle Button ---------- */
.chatbot-toggle {
  position: fixed;
  bottom: 6.5rem;
  right: 2rem;
  z-index: 9998;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #1B3A5C;
  border: 2px solid rgba(255,255,255,0.15);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(27, 58, 92, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.chatbot-toggle:hover {
  transform: scale(1.12);
  box-shadow: 0 6px 28px rgba(27, 58, 92, 0.5);
  background: #234b6e;
}

.chatbot-toggle:active {
  transform: scale(0.95);
}

.chatbot-toggle svg {
  width: 28px;
  height: 28px;
  fill: #FFFFFF;
  transition: opacity 0.2s ease, transform 0.3s ease;
}

.chatbot-toggle .chatbot-icon-close {
  position: absolute;
  opacity: 0;
  transform: rotate(-90deg);
}

.chatbot-toggle.active .chatbot-icon-chat {
  opacity: 0;
  transform: rotate(90deg);
}

.chatbot-toggle.active .chatbot-icon-close {
  opacity: 1;
  transform: rotate(0deg);
}

/* Notification badge */
.chatbot-toggle .chatbot-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #E6A817;
  color: #1B3A5C;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Open Sans', sans-serif;
  border: 2px solid rgba(255,255,255,0.3);
  animation: chatbot-pulse 2s infinite;
}

@keyframes chatbot-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ---------- Chat Window ---------- */
.chatbot-window {
  position: fixed;
  bottom: 6.5rem;
  right: 2rem;
  z-index: 9999;
  width: 400px;
  max-height: 500px;
  height: 500px;
  border-radius: 16px;
  background: #FFFFFF;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 51, 102, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.chatbot-window.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Header ---------- */
.chatbot-header {
  background: linear-gradient(135deg, #1B3A5C 0%, #003366 100%);
  color: #FFFFFF;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.chatbot-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.chatbot-header-info {
  flex: 1;
}

.chatbot-header-title {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
}

.chatbot-header-subtitle {
  font-size: 12px;
  opacity: 0.75;
  margin-top: 1px;
}

.chatbot-header-close {
  background: none;
  border: none;
  color: #FFFFFF;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.chatbot-header-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.chatbot-header-close svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ---------- Messages Area ---------- */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
  background: #f8f9fb;
}

.chatbot-messages::-webkit-scrollbar {
  width: 5px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 51, 102, 0.15);
  border-radius: 10px;
}

/* ---------- Message Bubbles ---------- */
.chatbot-msg {
  max-width: 88%;
  display: flex;
  flex-direction: column;
  animation: chatbot-fadeIn 0.3s ease;
}

@keyframes chatbot-fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.chatbot-msg.bot {
  align-self: flex-start;
}

.chatbot-msg.user {
  align-self: flex-end;
}

.chatbot-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #2c3e50;
  word-wrap: break-word;
}

.chatbot-msg.bot .chatbot-msg-bubble {
  background: #FFFFFF;
  border: 1px solid rgba(0, 51, 102, 0.08);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.chatbot-msg.user .chatbot-msg-bubble {
  background: linear-gradient(135deg, #1B3A5C, #003366);
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

.chatbot-msg-time {
  font-size: 10px;
  color: #9aabb8;
  margin-top: 4px;
  padding: 0 4px;
}

.chatbot-msg.user .chatbot-msg-time {
  text-align: right;
}

/* ---------- Typing Indicator ---------- */
.chatbot-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  align-self: flex-start;
  background: #FFFFFF;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(0, 51, 102, 0.08);
  animation: chatbot-fadeIn 0.3s ease;
}

.chatbot-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aabb8;
  animation: chatbot-bounce 1.4s infinite ease-in-out;
}

.chatbot-typing-dot:nth-child(1) { animation-delay: 0s; }
.chatbot-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.chatbot-typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes chatbot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ---------- Quick Reply Buttons ---------- */
.chatbot-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0 0;
  animation: chatbot-fadeIn 0.35s ease;
}

.chatbot-quick-btn {
  background: #FFFFFF;
  border: 1.5px solid #E6A817;
  color: #1B3A5C;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
}

.chatbot-quick-btn:hover {
  background: #E6A817;
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(230, 168, 23, 0.25);
}

.chatbot-quick-btn:active {
  transform: translateY(0);
}

/* Link-style quick buttons */
.chatbot-quick-btn.link-btn {
  background: linear-gradient(135deg, #1B3A5C, #003366);
  border-color: #1B3A5C;
  color: #FFFFFF;
}

.chatbot-quick-btn.link-btn:hover {
  background: linear-gradient(135deg, #E6A817, #c8901a);
  border-color: #E6A817;
}

/* ---------- Input Area ---------- */
.chatbot-input-area {
  padding: 12px 16px;
  border-top: 1px solid rgba(0, 51, 102, 0.08);
  display: flex;
  gap: 8px;
  align-items: center;
  background: #FFFFFF;
  flex-shrink: 0;
}

.chatbot-input {
  flex: 1;
  border: 1.5px solid rgba(0, 51, 102, 0.12);
  border-radius: 24px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  color: #2c3e50;
  transition: border-color 0.2s ease;
}

.chatbot-input:focus {
  border-color: #E6A817;
}

.chatbot-input::placeholder {
  color: #b0bcc7;
}

.chatbot-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #E6A817, #c8901a);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.chatbot-send-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 3px 12px rgba(230, 168, 23, 0.35);
}

.chatbot-send-btn svg {
  width: 18px;
  height: 18px;
  fill: #FFFFFF;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .chatbot-window {
    width: calc(100vw - 16px);
    height: calc(100vh - 120px);
    max-height: none;
    bottom: 8px;
    right: 8px;
    border-radius: 12px;
  }

  .chatbot-toggle {
    bottom: 5.25rem;
    right: 1rem;
    width: 48px;
    height: 48px;
  }

  .chatbot-toggle svg {
    width: 24px;
    height: 24px;
  }
}
