/* Al Ilm Floating Chatbot Widget Styling */
:root {
  --ails-chat-primary: #2563EB;
  --ails-chat-bg: #0b1424;
  --ails-chat-card: #142B4F;
  --ails-chat-text: #FFFFFF;
  --ails-chat-muted: #94A3B8;
  --ails-chat-border: rgba(255, 255, 255, 0.08);
}

.ails-chatbot-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--ails-chat-primary) 0%, #3B82F6 100%);
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ails-chatbot-launcher:hover {
  transform: scale(1.1) rotate(5deg);
}

.ails-chatbot-launcher svg {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.ails-chatbot-launcher.active svg {
  transform: rotate(90deg);
}

/* Chatbox Panel */
.ails-chatbox {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 360px;
  max-width: calc(100vw - 48px);
  height: 480px;
  max-height: calc(100vh - 120px);
  background-color: var(--ails-chat-bg);
  border: 1px solid var(--ails-chat-border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.2);
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}

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

.ails-chat-header {
  background-color: var(--ails-chat-card);
  padding: 16px;
  border-bottom: 1px solid var(--ails-chat-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.ails-chat-avatar {
  width: 32px;
  height: 32px;
  background-color: rgba(37, 99, 235, 0.1);
  color: var(--ails-chat-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ails-chat-title h4 {
  margin: 0;
  font-size: 14px;
  color: #FFFFFF;
  font-family: 'Poppins', sans-serif;
}

.ails-chat-title span {
  font-size: 11px;
  color: var(--ails-chat-muted);
}

.ails-chat-close {
  background: transparent;
  border: none;
  color: var(--ails-chat-muted);
  font-size: 20px;
  cursor: pointer;
}

.ails-chat-close:hover {
  color: #FFFFFF;
}

/* Chat Stream */
.ails-chat-stream {
  flex-grow: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ails-chat-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.ails-chat-msg.bot {
  background-color: var(--ails-chat-card);
  color: #FFFFFF;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--ails-chat-border);
}

.ails-chat-msg.user {
  background: linear-gradient(135deg, var(--ails-chat-primary) 0%, #3B82F6 100%);
  color: #FFFFFF;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Loading dots indicator */
.ails-chat-loading {
  align-self: flex-start;
  background-color: var(--ails-chat-card);
  padding: 10px 16px;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  display: none;
}

.ails-chat-loading span {
  width: 6px;
  height: 6px;
  background-color: var(--ails-chat-muted);
  border-radius: 50%;
  display: inline-block;
  animation: ails-bounce 1.4s infinite ease-in-out both;
}

.ails-chat-loading span:nth-child(1) { animation-delay: -0.32s; }
.ails-chat-loading span:nth-child(2) { animation-delay: -0.16s; }

@keyframes ails-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1.0); }
}

/* Footer Form */
.ails-chat-footer {
  padding: 12px;
  background-color: var(--ails-chat-card);
  border-top: 1px solid var(--ails-chat-border);
}

.ails-chat-form {
  display: flex;
  gap: 8px;
}

.ails-chat-form input {
  flex-grow: 1;
  background-color: var(--ails-chat-bg);
  border: 1px solid var(--ails-chat-border);
  color: #FFFFFF;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 8px;
  outline: none;
}

.ails-chat-form input:focus {
  border-color: var(--ails-chat-primary);
}

.ails-chat-form button {
  background: linear-gradient(135deg, var(--ails-chat-primary) 0%, #3B82F6 100%);
  border: none;
  color: #FFFFFF;
  padding: 0 16px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
