/* Chatbot Styles Scoped to #chatbot-wrapper */
#chatbot-wrapper {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Floating Chat Button */
#chatbot-wrapper #chat-toggle-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 64px;
  height: 64px;
  background-color: #c00b0a;
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#chatbot-wrapper #chat-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

#chatbot-wrapper #chat-toggle-btn i {
  transition: transform 0.3s ease;
}

#chatbot-wrapper #chat-toggle-btn.open i {
  transform: rotate(180deg);
}

/* Chat Widget Container */
#chatbot-wrapper #chat-container {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 380px;
  height: 540px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header */
#chatbot-wrapper #chat-header {
  background: linear-gradient(135deg, #c00b0a, #ff5722);
  color: white;
  padding: 18px;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  letter-spacing: 0.5px;
}

/* Messages Area */
#chatbot-wrapper #messages {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
  background: #f9f9f9;
  border-bottom: 1px solid #eee;
}

#chatbot-wrapper .msg {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 20px;
  font-size: 15px;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  white-space: pre-wrap;
  position: relative;
}

#chatbot-wrapper .user {
  background-color: #e3f2fd;
  align-self: flex-end;
  color: #1565c0;
  border-bottom-right-radius: 4px;
}

#chatbot-wrapper .bot {
  background-color: #f1f1f1;
  align-self: flex-start;
  color: #333;
  border-bottom-left-radius: 4px;
}

/* Input Area */
#chatbot-wrapper #input-area {
  display: flex;
  align-items: center;
  border-top: 1px solid #ddd;
  padding: 12px;
  background: #fff;
  gap: 10px;
}

#chatbot-wrapper #userInput {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid #ccc;
  border-radius: 24px;
  outline: none;
  font-size: 15px;
  transition: all 0.2s ease-in-out;
  background: #fafafa;
}

#chatbot-wrapper #userInput:focus {
  border-color: #c00b0a;
  background: #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#chatbot-wrapper button.send-btn {
  padding: 12px 20px;
  border: none;
  background: linear-gradient(135deg, #c00b0a, #ff5722);
  color: white;
  border-radius: 24px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#chatbot-wrapper button.send-btn:hover {
  background: linear-gradient(135deg, #ff5722, #c00b0a);
  transform: scale(1.05);
}

/* Loading Spinner (Optional) */
#chatbot-wrapper .loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}