/* ============================================
   CHATBOT STYLING
   ============================================ */

#chatbot-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  z-index: 1000;
}

/* Chatbot Widget (Chat Window) */
#chatbot-widget {
  display: none;
  width: 350px;
  height: 500px;
  /* background: var(--white); */
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(26, 58, 82, 0.3);
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease-out;
}

#chatbot-container.chatbot-open #chatbot-widget {
  display: flex;
}

/* Header */
#chatbot-header {
  /* background: linear-gradient(
    135deg,
    var(--primary-dark-blue) 0%,
    var(--primary-blue) 100%
  ); */
  color: var(--white);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

#chatbot-title {
  font-weight: 600;
  font-size: 1rem;
}

#chatbot-close {
  background: none;
  border: none;
  /* color: var(--white); */
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  line-height: 1;
  min-width: 30px;
}

#chatbot-close:hover {
  transform: scale(1.1);
}

#chatbot-close:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Messages Container */
#chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background-color: #f9f9f9;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Messages */
.chatbot-message {
  display: flex;
  margin-bottom: 0.5rem;
  animation: fadeIn 0.3s ease-out;
}

.chatbot-message p {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.4;
  max-width: 85%;
  word-wrap: break-word;
}

.bot-message {
  justify-content: flex-start;
}

.bot-message p {
  /* background-color: var(--primary-blue);
  color: var(--white); */
  border-bottom-left-radius: 2px;
}

.user-message {
  justify-content: flex-end;
}

.user-message p {
  /* background-color: var(--secondary-blue);
  color: var(--white); */
  border-bottom-right-radius: 2px;
}

/* Input Area */
#chatbot-input-area {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  /* background-color: var(--white);
  border-top: 1px solid var(--border-light); */
  flex-shrink: 0;
}

#chatbot-input {
  flex: 1;
  /* border: 1px solid var(--border-light); */
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

#chatbot-input:focus {
  outline: none;
  /* border-color: var(--secondary-blue); */
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

#chatbot-send {
  /* background-color: var(--secondary-blue); */
  color: var(--white);
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

#chatbot-send:hover {
  /* background-color: var(--primary-blue); */
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

#chatbot-send:active {
  transform: translateY(0);
}

#chatbot-send:focus {
  /* outline: 2px solid var(--secondary-blue); */
  outline-offset: 2px;
}

/* Toggle Button */
#chatbot-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  /* background: linear-gradient(
    135deg,
    var(--primary-dark-blue) 0%,
    var(--primary-blue) 100%
  ); */
  color: var(--white);
  border: none;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(26, 58, 82, 0.3);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2s infinite;
  padding: 0;
  line-height: 1;
  min-width: 60px;
}

#chatbot-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(26, 58, 82, 0.4);
}

#chatbot-toggle:active {
  transform: scale(0.95);
}

#chatbot-toggle:focus {
  outline: 2px solid var(--secondary-blue);
  outline-offset: 2px;
}

#chatbot-container.chatbot-open #chatbot-toggle {
  display: none;
}

/* Animations */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 2px 12px rgba(26, 58, 82, 0.3);
  }
  50% {
    box-shadow: 0 2px 20px rgba(26, 58, 82, 0.5);
  }
}

/* Scrollbar styling for messages container */
#chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

#chatbot-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

#chatbot-messages::-webkit-scrollbar-thumb {
  /* background: var(--secondary-blue); */
  border-radius: 10px;
}

#chatbot-messages::-webkit-scrollbar-thumb:hover {
  /* background: var(--primary-blue); */
}

/* Mobile responsiveness */
@media (max-width: 480px) {
  #chatbot-widget {
    width: 90vw;
    max-width: 350px;
    height: 70vh;
    max-height: 500px;
  }

  #chatbot-container {
    bottom: 10px;
    right: 10px;
  }

  #chatbot-toggle {
    width: 55px;
    height: 55px;
    font-size: 1.3rem;
  }

  .chatbot-message p {
    max-width: 90%;
  }
}
