/* Chatbot Widget Styles */
#chatbot-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--chatbot-color, #0073aa) 0%,
    #005a87 100%
  );
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 115, 170, 0.3), 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

#chatbot-toggle svg {
  width: 32px;
  height: 32px;
}

#chatbot-toggle:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 115, 170, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2);
}

#chatbot-toggle:active {
  transform: translateY(0) scale(0.98);
}

#chatbot-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 420px;
  height: 520px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.1);
  display: none;
  flex-direction: column;
  z-index: 9998;
  overflow: hidden;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#chatbot-window.open {
  display: flex;
}

#chatbot-header {
  background: linear-gradient(
    135deg,
    var(--chatbot-color, #0073aa) 0%,
    #005a87 100%
  );
  color: white;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  min-height: 60px;
}

.chatbot-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-avatar {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.chatbot-avatar svg {
  width: 20px;
  height: 20px;
}

.chatbot-header-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.chatbot-header-text h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.chatbot-status {
  font-size: 12px;
  opacity: 0.95;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
}

.chatbot-status::before {
  content: "";
  width: 6px;
  height: 6px;
  background: #4ade80;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

#chatbot-close {
  background: rgba(255, 255, 255, 0.25);
  border: none;
  color: white;
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

#chatbot-close svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.5;
}

#chatbot-close:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: rotate(90deg);
}

#chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f8fafc;
  scroll-behavior: smooth;
}

#chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

#chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

#chatbot-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

#chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.chatbot-message {
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chatbot-message-user {
  justify-content: flex-end;
}

.message-avatar {
  width: 32px;
  height: 32px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  color: var(--chatbot-color, #0073aa);
  margin-top: 2px;
}

.message-avatar svg {
  width: 16px;
  height: 16px;
}

.chatbot-message-user .message-content {
  background: linear-gradient(
    135deg,
    var(--chatbot-color, #0073aa) 0%,
    #005a87 100%
  );
  color: white;
  padding: 11px 16px;
  border-radius: 16px 16px 4px 16px;
  max-width: 75%;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(0, 115, 170, 0.2);
}

.chatbot-message-bot {
  align-items: flex-start;
}

.chatbot-message-bot .message-content {
  background: white;
  color: #1e293b;
  padding: 11px 16px;
  border-radius: 16px 16px 16px 4px;
  max-width: 75%;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chatbot-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  max-width: fit-content;
  margin-left: 40px;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: #94a3b8;
  border-radius: 50%;
  animation: typingDot 1.4s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingDot {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

.typing-text {
  color: #64748b;
  font-size: 13px;
  margin-left: 4px;
}

#chatbot-input-container {
  padding: 16px 18px 18px 18px;
  background: white;
  border-top: 1px solid #e2e8f0;
}

#chatbot-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

#chatbot-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  outline: none;
  font-size: 14px;
  transition: all 0.2s ease;
  background: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#chatbot-input:focus {
  border-color: var(--chatbot-color, #0073aa);
  background: white;
  box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

#chatbot-form button {
  background: linear-gradient(
    135deg,
    var(--chatbot-color, #0073aa) 0%,
    #005a87 100%
  );
  color: white;
  border: none;
  padding: 12px;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 115, 170, 0.2);
  flex-shrink: 0;
}

#chatbot-form button svg {
  width: 20px;
  height: 20px;
}

#chatbot-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

#chatbot-form button:active {
  transform: translateY(0);
}

#chatbot-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  #chatbot-toggle {
    bottom: 16px;
    right: 16px;
  }

  #chatbot-window {
    width: calc(100% - 32px);
    height: calc(100vh - 100px);
    right: 16px;
    left: 16px;
    bottom: 84px;
  }
}

@media (max-width: 480px) {
  #chatbot-window {
    width: 100%;
    height: 100vh;
    right: 0;
    left: 0;
    bottom: 0;
    border-radius: 0;
  }

  #chatbot-toggle {
    bottom: 20px;
    right: 20px;
  }
}
