/* ─── CHATBOT WIDGET STYLES ─── */

#chatbot-floating-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 999;
  transition: all 0.3s ease;
  font-size: 12px;
  font-weight: 600;
  flex-direction: column;
  gap: 2px;
  animation: chatbot-pulse 2s infinite;
}

@keyframes chatbot-pulse {
  0% {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 0 rgba(20, 40, 80, 0.7);
  }
  50% {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 10px rgba(20, 40, 80, 0);
  }
  100% {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 0 rgba(20, 40, 80, 0);
  }
}

#chatbot-floating-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2), 0 0 0 10px rgba(20, 40, 80, 0.1);
  background: var(--gold-light);
  color: var(--navy);
  animation: none;
}

.chatbot-label {
  font-size: 9px;
  display: none;
}

#chatbot-floating-btn:hover .chatbot-label {
  display: block;
}

/* ─── CHATBOT WINDOW ─── */
#chatbot-container {
  position: fixed;
  bottom: 80px;
  right: 2rem;
  width: 380px;
  height: 0;
  opacity: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
  z-index: 998;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  overflow: hidden;
  font-family: 'Lato', sans-serif;
}

#chatbot-container.active {
  height: 500px;
  opacity: 1;
}

/* ─── HEADER ─── */
.chatbot-header {
  background: linear-gradient(135deg, var(--navy) 0%, rgba(20, 40, 80, 0.9) 100%);
  color: white;
  padding: 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chatbot-header-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.chatbot-header-subtitle {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
}

.chatbot-close {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.chatbot-close:hover {
  opacity: 0.7;
}

/* ─── MESSAGES AREA ─── */
#chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #f9f9f9;
}

.chatbot-message {
  display: flex;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-message {
  justify-content: flex-end;
}

.bot-message {
  justify-content: flex-start;
}

.message-bubble {
  max-width: 75%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  word-wrap: break-word;
}

.user-message .message-bubble {
  background: var(--navy);
  color: white;
  border-bottom-right-radius: 4px;
}

.bot-message .message-bubble {
  background: white;
  color: var(--text-dark);
  border: 1px solid #e0e0e0;
  border-bottom-left-radius: 4px;
}

.message-bubble a {
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid var(--navy);
  transition: opacity 0.2s;
}

.message-bubble a:hover {
  opacity: 0.8;
}

.bot-message .message-bubble a {
  color: var(--navy);
}

.user-message .message-bubble a {
  color: white;
  border-bottom-color: white;
}

/* ─── INPUT AREA ─── */
.chatbot-input-area {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  background: white;
  border-top: 1px solid #e0e0e0;
  flex-shrink: 0;
}

.chatbot-input {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 24px;
  padding: 0.6rem 1rem;
  font-size: 13px;
  font-family: 'Lato', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

.chatbot-input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(20, 40, 80, 0.1);
}

.chatbot-send {
  background: var(--navy);
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chatbot-send:hover {
  background: var(--gold-light);
  color: var(--navy);
  transform: scale(1.05);
}

/* ─── SCROLLBAR ─── */
#chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

#chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

#chatbot-messages::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-radius: 3px;
}

#chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 640px) {
  #chatbot-floating-btn {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
  }

  #chatbot-container {
    bottom: 70px;
    right: 1.5rem;
    width: calc(100vw - 3rem);
    max-width: 380px;
  }

  #chatbot-container.active {
    height: 400px;
  }

  .message-bubble {
    max-width: 85%;
  }
}

@media (max-width: 380px) {
  #chatbot-container {
    width: calc(100vw - 2rem);
  }
}
