/* ====== CHATBOT STYLES ====== */
/* Chat Button */
.chat-button {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3);
  transition: all 0.3s ease;
  z-index: 1000;
}

.chat-button:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.4);
}

.chat-button.close {
  background: #ef4444;
}

.chat-button.close:hover {
  box-shadow: 0 12px 40px rgba(239, 68, 68, 0.4);
}

/* Notification badge */
.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  background: #ef4444;
  border: 2px solid white;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Chat Widget */
.chat-widget {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  height: 500px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  transform: scale(0) translateY(20px);
  transform-origin: bottom right;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0;
  visibility: hidden;
  z-index: 999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.chat-widget.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  visibility: visible;
}

/* Chat Header */
.chat-header {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.chat-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle at 30% 20%,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 50%
  );
  pointer-events: none;
}

.bot-avatar {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 1;
}

.bot-avatar img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.bot-info {
  flex: 1;
  position: relative;
  z-index: 1;
}

.bot-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.bot-status {
  font-size: 12px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-indicator {
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.minimize-btn {
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.2s ease;
  position: relative;
  z-index: 1;
}

.minimize-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #fafbfc;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  display: flex;
  gap: 8px;
  animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.bot-message .message-avatar {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
}

.user-message .message-avatar {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.message-content {
  max-width: 65%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  position: relative;
}

.bot-message .message-content {
  background: white;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  color: #374151;
}

.user-message .message-content {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
}

.message-time {
  font-size: 10px;
  color: #9ca3af;
  margin-top: 4px;
}

.user-message .message-time {
  color: rgba(255, 255, 255, 0.7);
}

/* Welcome Screen */
.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  gap: 16px;
  height: 100%;
}

.welcome-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: white;
  margin-bottom: 8px;
}

.welcome-title {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
}

.welcome-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 16px;
}

.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.quick-action {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #374151;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-action:hover {
  border-color: #6366f1;
  color: #6366f1;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

/* Chat Input */
.chat-input-container {
  padding: 16px;
  background: white;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 14px;
  resize: none;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
  max-height: 80px;
  min-height: 36px;
}

.chat-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.send-button {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.send-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 8px;
  align-items: center;
}

.typing-dots {
  display: flex;
  gap: 3px;
  padding: 8px 12px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: #6b7280;
  border-radius: 50%;
  animation: typingDot 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 typingDot {
  0%,
  80%,
  100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

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

.chat-messages::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 2px;
}

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

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Mobile Overlay */
.chat-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 998;
}

.chat-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Chatbot Responsive Design */
@media (max-width: 768px) {
  .chat-button {
    width: 56px;
    height: 56px;
    bottom: 20px;
    right: 20px;
    font-size: 22px;
  }

  .chat-widget {
    width: calc(100vw - 20px);
    height: calc(100vh - 120px);
    max-height: 600px;
    right: 10px;
    bottom: 85px;
    border-radius: 12px;
  }

  .chat-header {
    padding: 16px;
  }

  .bot-name {
    font-size: 15px;
  }

  .bot-status {
    font-size: 11px;
  }

  .chat-messages {
    padding: 12px;
  }

  .message-content {
    max-width: 80%;
    font-size: 13px;
  }

  .welcome-title {
    font-size: 16px;
  }

  .welcome-subtitle {
    font-size: 12px;
  }

  .chat-input-container {
    padding: 12px;
  }

  .chat-input {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .chat-button {
    width: 52px;
    height: 52px;
    bottom: 16px;
    right: 16px;
    font-size: 20px;
  }

  .chat-widget {
    width: calc(100vw - 16px);
    height: calc(100vh - 100px);
    right: 8px;
    bottom: 75px;
    border-radius: 10px;
  }

  .chat-header {
    padding: 12px;
  }

  .bot-avatar {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .bot-name {
    font-size: 14px;
  }

  .chat-messages {
    padding: 10px;
    gap: 10px;
  }

  .message-avatar {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .message-content {
    padding: 8px 12px;
    font-size: 12px;
    max-width: 85%;
  }

  .welcome-icon {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }

  .welcome-title {
    font-size: 15px;
  }

  .welcome-subtitle {
    font-size: 11px;
  }

  .quick-action {
    padding: 6px 10px;
    font-size: 11px;
  }

  .chat-input-container {
    padding: 10px;
  }

  .chat-input {
    font-size: 12px;
    padding: 6px 10px;
  }

  .send-button {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .chat-widget {
    height: calc(100vh - 80px);
    bottom: 65px;
  }
}

/* Tablet styles */
@media (min-width: 769px) and (max-width: 1024px) {
  .chat-widget {
    width: 360px;
    height: 480px;
  }
}

/* Large screens */
@media (min-width: 1440px) {
  .chat-widget {
    width: 400px;
    height: 520px;
  }
}
