/* ==================== CHATBOT STYLES ==================== */

/* Chat Button */
.chatbot-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  /* Changed from left to right */
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2274FF 0%, #1d63ed 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 16px rgba(34, 116, 255, 0.4),
    0 8px 32px rgba(34, 116, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  z-index: 9998;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: chatPulse 2s ease-in-out infinite;
}

.chatbot-btn:hover {
  transform: scale(1.08);
  box-shadow:
    0 6px 24px rgba(34, 116, 255, 0.5),
    0 12px 48px rgba(34, 116, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

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

.chatbot-btn.active {
  animation: none;
  background: linear-gradient(135deg, #1557cc 0%, #1d63ed 100%);
}

.chatbot-btn svg {
  width: 28px;
  height: 28px;
  color: white;
  transition: transform 0.3s ease;
}

.chatbot-btn.active .chat-icon {
  display: none;
}

.chatbot-btn .close-icon {
  display: none;
}

.chatbot-btn.active .close-icon {
  display: block;
}

@keyframes chatPulse {

  0%,
  100% {
    box-shadow:
      0 4px 16px rgba(34, 116, 255, 0.4),
      0 8px 32px rgba(34, 116, 255, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }

  50% {
    box-shadow:
      0 4px 20px rgba(34, 116, 255, 0.5),
      0 12px 40px rgba(34, 116, 255, 0.3),
      0 0 0 8px rgba(34, 116, 255, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
}

/* Chat badge notification */
.chatbot-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
  animation: badgeBounce 0.5s ease-out;
}

@keyframes badgeBounce {
  0% {
    transform: scale(0);
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

/* Chat Window */
.chatbot-window {
  position: fixed;
  bottom: 100px;
  right: 24px;
  /* Changed from left to right */
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 560px;
  max-height: calc(100vh - 160px);
  background: #ffffff;
  border-radius: 20px;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.25),
    0 12px 40px -15px rgba(34, 116, 255, 0.15),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-window.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Chat Header */
.chatbot-header {
  background: linear-gradient(135deg, #2274FF 0%, #1d63ed 100%);
  padding: 20px 20px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.chatbot-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.chatbot-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.chatbot-avatar svg {
  width: 26px;
  height: 26px;
  color: white;
}

.chatbot-header-info {
  flex: 1;
}

.chatbot-header-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: white;
  margin: 0 0 2px 0;
  letter-spacing: -0.01em;
}

.chatbot-header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.9);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.7;
    transform: scale(0.9);
  }
}

/* Chat Body */
.chatbot-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.chatbot-body::-webkit-scrollbar {
  width: 4px;
}

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

.chatbot-body::-webkit-scrollbar-thumb {
  background: rgba(34, 116, 255, 0.3);
  border-radius: 4px;
}

/* Messages */
.chat-message {
  display: flex;
  gap: 10px;
  animation: messageSlide 0.4s ease-out;
  max-width: 95%;
}

.chat-message.bot {
  align-self: flex-start;
}

.chat-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

@keyframes messageSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

.chat-message.bot .message-avatar {
  background: linear-gradient(135deg, #2274FF 0%, #1d63ed 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(34, 116, 255, 0.3);
}

.chat-message.user .message-avatar {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  color: white;
}

.message-content {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: 260px;
  word-wrap: break-word;
}

.chat-message.bot .message-content {
  background: white;
  color: #1e293b;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-bottom-left-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.chat-message.user .message-content {
  background: linear-gradient(135deg, #2274FF 0%, #1d63ed 100%);
  color: white;
  border-bottom-right-radius: 6px;
  box-shadow: 0 2px 8px rgba(34, 116, 255, 0.25);
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: #94a3b8;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}

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

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

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

@keyframes typingBounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
  }

  30% {
    transform: translateY(-6px);
  }
}

/* Quick Reply Buttons */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quick-reply-btn {
  padding: 10px 16px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.quick-reply-btn:hover {
  background: linear-gradient(135deg, #2274FF 0%, #1d63ed 100%);
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34, 116, 255, 0.3);
}

.quick-reply-btn svg {
  width: 16px;
  height: 16px;
}

/* Chat Input */
.chatbot-input-area {
  padding: 16px 20px 20px;
  background: white;
  border-top: 1px solid #e2e8f0;
}

.chatbot-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 6px 6px 6px 16px;
  transition: all 0.3s ease;
}

.chatbot-input-wrapper:focus-within {
  border-color: #2274FF;
  box-shadow: 0 0 0 3px rgba(34, 116, 255, 0.1);
  background: white;
}

.chatbot-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  color: #1e293b;
  outline: none;
  font-family: inherit;
  padding: 8px 0;
}

.chatbot-input::placeholder {
  color: #94a3b8;
}

.chatbot-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2274FF 0%, #1d63ed 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.chatbot-send-btn:hover {
  background: linear-gradient(135deg, #1557cc 0%, #1557cc 100%);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(34, 116, 255, 0.3);
}

.chatbot-send-btn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

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

/* Progress Steps */
.chat-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.95) 0%, rgba(248, 250, 252, 0.8) 100%);
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

.progress-step {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e2e8f0;
  transition: all 0.3s ease;
}

.progress-step.active {
  background: linear-gradient(135deg, #2274FF 0%, #1d63ed 100%);
  box-shadow: 0 0 0 3px rgba(34, 116, 255, 0.2);
}

.progress-step.completed {
  background: #4ade80;
}

/* Success Animation */
.success-checkmark {
  width: 80px;
  height: 80px;
  margin: 20px auto;
}

.success-checkmark svg {
  width: 100%;
  height: 100%;
  animation: successPop 0.5s ease-out;
}

@keyframes successPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Form Field Animation */
.form-field-wrapper {
  animation: fieldSlide 0.4s ease-out;
}

@keyframes fieldSlide {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .chatbot-btn {
    bottom: 16px;
    right: 16px;
    /* Changed from left to right */
    width: 56px;
    height: 56px;
  }

  .chatbot-window {
    bottom: 88px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    height: calc(100vh - 130px);
    max-height: none;
    border-radius: 16px;
  }

  .chatbot-header {
    padding: 16px;
  }

  .chatbot-avatar {
    width: 40px;
    height: 40px;
  }

  .chatbot-header-title {
    font-size: 0.95rem;
  }

  .message-content {
    max-width: 220px;
  }
}

/* Dark overlay when chat is open on mobile */
@media (max-width: 480px) {
  .chatbot-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9997;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .chatbot-overlay.active {
    opacity: 1;
    visibility: visible;
  }
}

/* Service Selection Cards in Chat */
.chat-service-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.chat-service-card {
  padding: 12px 16px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
}

.chat-service-card:hover {
  background: linear-gradient(135deg, rgba(34, 116, 255, 0.05) 0%, rgba(34, 116, 255, 0.1) 100%);
  border-color: #2274FF;
  transform: translateX(4px);
}

.chat-service-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-service-card-title svg {
  width: 18px;
  height: 18px;
  color: #2274FF;
}

.chat-service-card-desc {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
}

/* Restart Chat Button */
.restart-chat-btn {
  margin-top: 16px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.restart-chat-btn:hover {
  background: white;
  border-color: #2274FF;
  color: #2274FF;
}

/* Multi-select Container (for days selection) */
.multiselect-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  animation: fadeInUp 0.4s ease-out;
}

.multiselect-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.multiselect-btn {
  padding: 8px 14px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: all 0.3s ease;
}

.multiselect-btn:hover {
  border-color: #2274FF;
  background: linear-gradient(135deg, rgba(34, 116, 255, 0.05) 0%, rgba(34, 116, 255, 0.1) 100%);
}

.multiselect-btn.selected {
  background: linear-gradient(135deg, #2274FF 0%, #1d63ed 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(34, 116, 255, 0.3);
}

.confirm-btn {
  align-self: flex-start;
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%) !important;
  color: white !important;
  border: none !important;
  font-weight: 600;
}

.confirm-btn:hover {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

/* Ensure chatbot is above nav */
.chatbot-btn,
.chatbot-window,
.chatbot-overlay {
  z-index: 99999;
}