/* AB2S Chatbot Styles */

.ab2s-chat-button {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #1e40af 0%, #1e40af 49%, #ea580c 51%, #ea580c 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(30, 64, 175, 0.4);
  transition: none;
  z-index: 9998;
}

.ab2s-chat-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(30, 64, 175, 0.5);
}

.ab2s-chat-button svg {
  width: 28px;
  height: 28px;
  stroke-width: 2.5;
}

.ab2s-chat-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ea580c;
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.4);
}

.ab2s-chat-window {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  height: 600px;
  max-height: calc(100vh - 100px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  overflow: hidden;
  animation: slideUp 0.3s ease-out;
}

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

.ab2s-chat-header {
  background: linear-gradient(135deg, #1e40af 0%, #1e40af 49%, #ea580c 51%, #ea580c 100%);
  color: white;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ab2s-chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ab2s-chat-avatar {
  width: 55px;
  height: 55px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 1);
  position: relative;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

.ab2s-chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ab2s-chat-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.ab2s-chat-status {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ab2s-chat-status::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s infinite;
}

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

.ab2s-chat-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: none;
}

.ab2s-chat-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.ab2s-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ab2s-chat-messages::-webkit-scrollbar {
  width: 6px;
}

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

.ab2s-message {
  display: flex;
  animation: fadeIn 0.3s ease-out;
}

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

.ab2s-message-user {
  justify-content: flex-end;
}

.ab2s-message-bot {
  justify-content: flex-start;
}

.ab2s-message-content {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 12px;
  line-height: 1.5;
  font-size: 0.95rem;
}

.ab2s-message-user .ab2s-message-content {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.ab2s-message-bot .ab2s-message-content {
  background: white;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}

.ab2s-message-content p {
  margin: 0;
}

.ab2s-message-content p + p {
  margin-top: 8px;
}

.ab2s-typing-dots {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.ab2s-typing-dots span {
  width: 8px;
  height: 8px;
  background: #64748b;
  border-radius: 50%;
  animation: bounce 1.4s infinite;
}

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

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

@keyframes bounce {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-8px);
  }
}

.ab2s-chat-input {
  padding: 16px;
  background: white;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 12px;
}

.ab2s-chat-input input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 24px;
  font-size: 0.95rem;
  outline: none;
  transition: none;
}

.ab2s-chat-input input:focus {
  border-color: #1e40af;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.ab2s-chat-send {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #1e40af 0%, #1e40af 49%, #ea580c 51%, #ea580c 100%);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: none;
}

.ab2s-chat-send:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.ab2s-chat-send:active {
  transform: scale(0.95);
}

/* Responsive */
@media (max-width: 480px) {
  .ab2s-chat-window {
    width: calc(100vw - 32px);
    height: calc(100vh - 100px);
    right: 16px;
    bottom: 16px;
  }
  
  .ab2s-chat-button {
    right: 16px;
    bottom: 16px;
  }
}
