/* assets/css/chat.css - Frontend Chat Assistant Styles */
.chatbot-trigger-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #6552D9;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(101, 82, 217, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  z-index: 998;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.chatbot-trigger-btn:hover {
  background: #7561EA;
  transform: scale(1.06);
  box-shadow: 0 12px 28px rgba(101, 82, 217, 0.6);
}

.chatbot-trigger-btn:focus-visible {
  outline: 2px solid #8F80FF;
  outline-offset: 3px;
}

.chat-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: min(560px, calc(100vh - 120px));
  background: #080915;
  border: 1px solid #22233F;
  border-radius: 22px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  z-index: 1500;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: chatSlideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.chat-panel[hidden] {
  display: none !important;
}

@keyframes chatSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-panel {
    animation: none;
  }
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #04050B;
  border-bottom: 1px solid #15162A;
  flex-shrink: 0;
}

.chat-title {
  font-size: 15px;
  font-weight: 600;
  color: #ECECF6;
  margin: 0;
}

.chat-subtitle {
  font-size: 11px;
  color: #AEB0CC;
  display: block;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-btn-clear {
  background: transparent;
  border: none;
  color: #AEB0CC;
  font-size: 12px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.chat-btn-clear:hover {
  color: #ECECF6;
  background: rgba(255, 255, 255, 0.06);
}

.chat-btn-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: #AEB0CC;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.chat-btn-close:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.08);
}

.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
}

.chat-msg--assistant {
  align-self: flex-start;
  background: #0E0F1D;
  border: 1px solid #22233F;
  color: #ECECF6;
  padding: 12px 16px;
  border-radius: 18px 18px 18px 4px;
}

.chat-msg--user {
  align-self: flex-end;
  background: #6552D9;
  color: #FFFFFF;
  padding: 12px 16px;
  border-radius: 18px 18px 4px 18px;
}

.chat-msg-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  background: #6552D9;
  color: #FFFFFF;
  text-decoration: none;
  align-self: flex-start;
  transition: background-color 0.15s ease;
}

.chat-msg-link:hover {
  background: #7561EA;
}

.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px;
  background: #080915;
  border-top: 1px solid #15162A;
  flex-shrink: 0;
}

.chat-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 9999px;
  background: transparent;
  border: 1px solid #3A3B60;
  color: #ECECF6;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chat-chip:hover {
  border-color: #B3A8FF;
  color: #FFFFFF;
  background: rgba(179, 168, 255, 0.08);
}

.chat-form {
  padding: 12px 16px 8px 16px;
  background: #080915;
  border-top: 1px solid #15162A;
  flex-shrink: 0;
}

.chat-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #04050B;
  border: 1px solid #3A3B60;
  border-radius: 12px;
  padding: 4px 6px 4px 12px;
  transition: border-color 0.2s ease;
}

.chat-input-wrapper:focus-within {
  border-color: #8F80FF;
  outline: 2px solid #8F80FF;
  outline-offset: 1px;
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #ECECF6;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  min-height: 40px;
}

.chat-input::placeholder {
  color: #7A7B9B;
}

.chat-btn-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 9px;
  background: #6552D9;
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.chat-btn-send:hover {
  background: #7561EA;
}

.chat-disclaimer {
  font-size: 10.5px;
  color: #7A7B9B;
  text-align: center;
  margin: 0;
  padding: 4px 16px 10px 16px;
  background: #080915;
  flex-shrink: 0;
}

.chat-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #0E0F1D;
  border: 1px solid #22233F;
  border-radius: 18px 18px 18px 4px;
  align-self: flex-start;
}

.chat-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #AEB0CC;
  animation: typingBounce 1s infinite alternate ease-in-out;
}

.chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  from { transform: translateY(0); opacity: 0.4; }
  to { transform: translateY(-4px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-typing-dot {
    animation: none;
    opacity: 0.7;
  }
}

/* Mobile full-screen sheet */
@media (max-width: 900px) {
  .chat-panel {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
  }
}



/* Restyled floating chatbot button to match #B6BCC9 header */
.chat-launcher,
#chat-launcher,
.chatbot-launcher,
#chatbot-launcher,
.chat-fab,
#chat-fab {
  background: #B6BCC9 !important;
  color: #14142A !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35) !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
}

.chat-launcher:hover,
#chat-launcher:hover,
.chatbot-launcher:hover,
#chatbot-launcher:hover,
.chat-fab:hover,
#chat-fab:hover {
  background: #D6D9E2 !important;
  color: #14142A !important;
}

.chat-launcher svg,
#chat-launcher svg,
.chatbot-launcher svg,
#chatbot-launcher svg {
  stroke: #14142A !important;
}

@media (max-width: 600px) {
  .chatbot-trigger-btn,
  .chat-launcher,
  #chat-launcher,
  .chatbot-launcher,
  #chatbot-launcher,
  .chat-fab,
  #chat-fab {
    bottom: 16px !important;
    right: 16px !important;
    width: 48px !important;
    height: 48px !important;
  }
}

