/* Managira Chatbot Styles */

/* Chatbot Toggle Button */
.chatbot-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #01535b 0%, #013c44 100%);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(1, 83, 91, 0.4);
  transition: all 0.3s ease;
  z-index: 1000;
}

.chatbot-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(1, 83, 91, 0.6);
}

.chatbot-toggle svg {
  width: 30px;
  height: 30px;
  fill: white;
}

/* Mobile Toggle Button Adjustments */
@media (max-width: 768px) {
  .chatbot-toggle {
    width: 56px;
    height: 56px;
    bottom: 16px;
    right: 16px;
  }
  
  .chatbot-toggle svg {
    width: 26px;
    height: 26px;
  }
}

@media (max-width: 480px) {
  .chatbot-toggle {
    width: 52px;
    height: 52px;
    bottom: 12px;
    right: 12px;
  }
  
  .chatbot-toggle svg {
    width: 24px;
    height: 24px;
  }
}

/* Chatbot Container */
.chatbot-container {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 380px;
  height: 500px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  border: none;
  transition: all 0.3s ease;
}

.chatbot-container.active {
  display: flex;
}

.chatbot-container.minimized {
  height: 60px;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  width: 250px;
  right: 100px; /* Push it left to avoid chat button */
}

.chatbot-container.minimized .chatbot-content,
.chatbot-container.minimized .chatbot-input-area {
  display: none;
}

/* Desktop minimized header padding (default for large screens) */
.chatbot-container.minimized .chatbot-header {
  padding: 14px 10px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .chatbot-container {
    width: calc(100vw - 20px);
    height: calc(100vh - 120px);
    bottom: 10px;
    right: 10px;
    left: 10px;
    border-radius: 12px;
    max-height: 70vh;
    border: none; /* Remove white border */
  }
  
  /* When chat is open, cover the toggle button */
  .chatbot-container.active {
    right: 10px;
    left: 10px;
    width: calc(100vw - 20px);
  }
  
  .chatbot-container.minimized {
    width: 250px;
    height: 50px;
    right: 80px; /* Push left to avoid chat button on mobile */
    left: auto;
    border-radius: 25px;
  }
}

@media (max-width: 480px) {
  .chatbot-container {
    width: calc(100vw - 16px);
    height: calc(100vh - 100px);
    bottom: 8px;
    right: 8px;
    left: 8px;
    border-radius: 10px;
    max-height: 65vh;
    border: none; /* Remove white border */
  }
  
  /* When chat is open, cover the toggle button completely */
  .chatbot-container.active {
    right: 8px;
    left: 8px;
    width: calc(100vw - 16px);
  }
  
  .chatbot-container.minimized {
    width: 200px;
    height: 45px;
    right: 70px; /* Push left to avoid chat button on small mobile */
    left: auto;
    border-radius: 22px;
  }
}

/* Toggle button transitions */
.chatbot-toggle {
  transition: opacity 0.3s ease;
}



/* Keyboard Adjustment for Mobile */
@media (max-width: 768px) {
  .chatbot-container.keyboard-active {
    height: 50vh;
    max-height: 50vh;
  }
}

/* Chatbot Header */
.chatbot-header {
  background: linear-gradient(135deg, #1e7e7e, #0f5f5f);
  color: white;
  padding: 10px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* border-radius: 16px 16px 0 0; */
}

.chatbot-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

/* Mobile Header Adjustments */
@media (max-width: 768px) {
  .chatbot-header {
    padding: 14px 16px;
    border-radius: 12px 12px 0 0;
  }
  
  .chatbot-header h3 {
    font-size: 16px;
  }
  
  .chatbot-container.minimized .chatbot-header {
    padding: 10px 10px;
    border-radius: 25px;
  }
  
  .chatbot-container.minimized .chatbot-header h3 {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .chatbot-header {
    padding: 12px 14px;
    border-radius: 10px 10px 0 0;
  }
  
  .chatbot-header h3 {
    font-size: 15px;
  }
  
  .chatbot-container.minimized .chatbot-header {
    padding: 10px 10px;
    border-radius: 22px;
  }
  
  .chatbot-container.minimized .chatbot-header h3 {
    font-size: 13px;
  }
}

.chatbot-controls {
  display: flex;
  gap: 8px;
}

.chatbot-minimize,
.chatbot-close {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.chatbot-minimize:hover,
.chatbot-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Mobile Controls Adjustments */
@media (max-width: 768px) {
  .chatbot-controls {
    gap: 6px;
  }
  
  .chatbot-minimize,
  .chatbot-close {
    font-size: 16px;
    width: 26px;
    height: 26px;
    padding: 2px;
  }
}

@media (max-width: 480px) {
  .chatbot-controls {
    gap: 4px;
  }
  
  .chatbot-minimize,
  .chatbot-close {
    font-size: 14px;
    width: 24px;
    height: 24px;
    padding: 1px;
  }
}

.chatbot-minimize {
  font-size: 16px;
  font-weight: bold;
}

/* Chatbot Content */
.chatbot-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 400px;
}

/* Chat Messages Area */
.chatbot-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #f8f9fa;
}

.message {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}

.message-bot {
  align-items: flex-start;
}

.message-user {
  align-items: flex-end;
}

.message-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.message-bot .message-bubble {
  background: white;
  color: #333;
  border: 1px solid #e1e5e9;
  border-bottom-left-radius: 6px;
}

.message-user .message-bubble {
  background: #01535b;
  color: white;
  border-bottom-right-radius: 6px;
}

/* FAQ Results */
.faq-results {
  margin-top: 8px;
}

.faq-item {
  background: white;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.faq-item:hover {
  background: #f8f9fa;
  border-color: #01535b;
}

.faq-question {
  font-weight: 600;
  color: #01535b;
  font-size: 13px;
  margin-bottom: 4px;
}

.faq-category {
  font-size: 11px;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Mobile Content Adjustments */
@media (max-width: 768px) {
  .chatbot-messages {
    padding: 16px;
  }
  
  .message {
    margin-bottom: 12px;
  }
  
  .message-bubble {
    max-width: 90%;
    padding: 10px 14px;
    font-size: 14px;
    border-radius: 16px;
  }
  
  .faq-item {
    padding: 10px;
    margin-bottom: 6px;
    border-radius: 6px;
  }
  
  .faq-question {
    font-size: 12px;
  }
  
  .faq-category {
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .chatbot-messages {
    padding: 12px;
  }
  
  .message {
    margin-bottom: 10px;
  }
  
  .message-bubble {
    max-width: 95%;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 14px;
  }
  
  .faq-item {
    padding: 8px;
    margin-bottom: 4px;
    border-radius: 5px;
  }
  
  .faq-question {
    font-size: 11px;
  }
  
  .faq-category {
    font-size: 9px;
  }
}

/* Suggestions */
.suggestions {
  margin-top: 8px;
}

.suggestion-item {
  background: white;
  border: 1px solid #e1e5e9;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #01535b;
  transition: all 0.2s ease;
}

.suggestion-item:hover {
  background: #01535b;
  color: white;
}

/* Contact Info */
.contact-info {
  margin-top: 8px;
  padding: 8px 12px;
  background: #e7f3ff;
  border-radius: 6px;
  font-size: 12px;
  color: #0969da;
}

/* Input Area */
.chatbot-input-area {
  padding: 16px 20px;
  background: white;
  border-top: 1px solid #e1e5e9;
  display: flex;
  gap: 8px;
  align-items: center;
}

.chatbot-input {
  flex: 1;
  border: 1px solid #e1e5e9;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.chatbot-input:focus {
  border-color: #01535b;
}

.chatbot-send {
  background: #01535b;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.chatbot-send:hover {
  background: #013c44;
}

.chatbot-send:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.chatbot-send svg {
  width: 16px;
  height: 16px;
  fill: white;
}

/* Mobile Input Adjustments */
@media (max-width: 768px) {
  .chatbot-input-area {
    padding: 12px 16px;
    gap: 8px;
  }
  
  .chatbot-input {
    padding: 8px 14px;
    font-size: 16px; /* Prevents zoom on iOS */
    border-radius: 18px;
  }
  
  .chatbot-send {
    width: 36px;
    height: 36px;
  }
  
  .chatbot-send svg {
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 480px) {
  .chatbot-input-area {
    padding: 10px 14px;
    gap: 6px;
  }
  
  .chatbot-input {
    padding: 6px 12px;
    font-size: 16px;
    border-radius: 16px;
  }
  
  .chatbot-send {
    width: 34px;
    height: 34px;
  }
  
  .chatbot-send svg {
    width: 13px;
    height: 13px;
  }
}

/* Welcome Message */
.welcome-message {
  text-align: center;
  padding: 20px 16px;
  background: linear-gradient(135deg, #f8fffe 0%, #eef9f8 100%);
  border-radius: 12px;
  margin: 16px;
  border: 1px solid #e1f2f0;
}

.welcome-message h4 {
  color: #01535b;
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.welcome-message p {
  color: #4a6765;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

/* Popular Questions */
.popular-questions {
  margin-top: 16px;
}

.popular-questions h5 {
  font-size: 14px;
  font-weight: 600;
  color: #01535b;
  margin-bottom: 8px;
}

.popular-question {
  background: white;
  border: 1px solid #e1e5e9;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #333;
  transition: all 0.2s ease;
}

.popular-question:hover {
  background: #f8f9fa;
  border-color: #01535b;
  color: #01535b;
}

/* Loading Animation */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #01535b;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Scrollbar Styling */
.chatbot-messages::-webkit-scrollbar {
  width: 4px;
}

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

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

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

/* Responsive Design */
@media (max-width: 480px) {
  .chatbot-container {
    width: calc(100vw - 40px);
    right: 20px;
    left: 20px;
    height: 450px;
  }
  
  .chatbot-toggle {
    bottom: 15px;
    right: 15px;
  }
}

@media (max-width: 360px) {
  .chatbot-container {
    bottom: 80px;
    height: 400px;
  }
}

/* Animation for container show/hide */
.chatbot-container {
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.chatbot-container.active {
  transform: translateY(0);
  opacity: 1;
}

/* Mobile Welcome Message Adjustments */
@media (max-width: 768px) {
  .welcome-message {
    padding: 16px 14px;
    margin: 12px;
  }
  
  .welcome-message h4 {
    font-size: 16px;
    margin-bottom: 10px;
  }
  
  .welcome-message p {
    font-size: 13px;
  }
  
  .popular-questions h5 {
    font-size: 13px;
    margin-bottom: 6px;
  }
  
  .popular-question {
    padding: 8px 10px;
    margin-bottom: 4px;
    font-size: 12px;
    border-radius: 5px;
  }
}

@media (max-width: 480px) {
  .welcome-message {
    padding: 12px 10px;
    margin: 8px;
  }
  
  .welcome-message h4 {
    font-size: 14px;
    margin-bottom: 8px;
    gap: 6px;
  }
  
  .welcome-message p {
    font-size: 12px;
    line-height: 1.4;
  }
  
  .popular-questions {
    margin-top: 12px;
  }
  
  .popular-questions h5 {
    font-size: 12px;
    margin-bottom: 4px;
  }
  
  .popular-question {
    padding: 6px 8px;
    margin-bottom: 3px;
    font-size: 11px;
    border-radius: 4px;
  }
}