/* ================================================================
   RFC CHATBOT.CSS — Floating chatbot widget styling
   ================================================================ */

/* ---------- CHATBOT WIDGET CONTAINER ---------- */
#chatbot-widget {
  --chat-primary: var(--p);
  --chat-accent: var(--g);
  --chat-text: rgba(255,255,255,.9);
  --chat-subtle: rgba(255,255,255,.6);
}

.chatbot-button {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--chat-primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(74, 21, 96, 0.3);
  z-index: 999;
  transition: all var(--ease);
}

.chatbot-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(74, 21, 96, 0.4);
}

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

.chatbot-button svg {
  width: 28px;
  height: 28px;
}

.chatbot-button.hidden {
  display: none;
}

/* ---------- CHATBOT WINDOW ---------- */
.chatbot-window {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  height: 600px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(74, 21, 96, 0.2);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* ---------- CHATBOT HEADER ---------- */
.chatbot-header {
  background: var(--chat-primary);
  color: white;
  padding: 16px 20px;
  border-radius: 16px 16px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chatbot-header h3 {
  margin: 0;
  font-family: var(--fd);
  font-size: 16px;
  font-weight: 600;
  color: var(--chat-accent);
}

.chatbot-close {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  transition: color var(--ease);
}

.chatbot-close:hover {
  color: var(--chat-accent);
}

/* ---------- MESSAGES AREA ---------- */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chatbot-message {
  display: flex;
  word-wrap: break-word;
  animation: slideIn 0.3s ease-out;
}

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

.chatbot-message--bot {
  justify-content: flex-start;
}

.chatbot-message--bot::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 28px;
  background: var(--chat-primary);
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
}

.chatbot-message--user {
  justify-content: flex-end;
}

.chatbot-message--bot,
.chatbot-message--user {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.chatbot-message--bot {
  background: #f0f0f0;
  color: #333;
  border-radius: 12px 12px 12px 2px;
  margin-right: auto;
}

.chatbot-message--user {
  background: var(--chat-primary);
  color: white;
  border-radius: 12px 12px 2px 12px;
  margin-left: auto;
}

/* ---------- TYPING INDICATOR ---------- */
.chatbot-typing {
  background: #f0f0f0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 14px !important;
}

.chatbot-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #999;
  animation: typing 1.4s infinite;
}

.chatbot-typing span:nth-child(1) {
  animation-delay: 0s;
}

.chatbot-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.chatbot-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    opacity: 0.5;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-8px);
  }
}

/* ---------- SUGGESTIONS ---------- */
.chatbot-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 4px;
  animation: slideIn 0.3s ease-out;
}

.chatbot-suggestion {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: #333;
  cursor: pointer;
  transition: all var(--ease);
  text-align: left;
  font-family: var(--fb);
}

.chatbot-suggestion:hover {
  background: var(--chat-primary);
  color: white;
  border-color: var(--chat-primary);
}

/* ---------- INPUT AREA ---------- */
.chatbot-input-area {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e0e0e0;
  background: white;
  border-radius: 0 0 16px 16px;
}

#chatbot-input {
  flex: 1;
  border: 1px solid #d0d0d0;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  font-family: var(--fb);
  transition: border-color var(--ease);
}

#chatbot-input:focus {
  outline: none;
  border-color: var(--chat-primary);
  box-shadow: 0 0 0 2px rgba(74, 21, 96, 0.1);
}

.chatbot-send {
  background: var(--chat-primary);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all var(--ease);
  flex-shrink: 0;
}

.chatbot-send:hover {
  background: var(--chat-accent);
  transform: scale(1.05);
}

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

.chatbot-send svg {
  width: 18px;
  height: 18px;
}

/* ---------- SCROLLBAR ---------- */
.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

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

.chatbot-messages::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 600px) {
  .chatbot-window {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }

  .chatbot-header {
    border-radius: 0;
  }

  .chatbot-input-area {
    border-radius: 0;
  }

  .chatbot-button {
    bottom: 20px;
    right: 20px;
  }
}

@media (max-width: 380px) {
  .chatbot-message--bot,
  .chatbot-message--user {
    max-width: 95%;
  }
}
