/* ================================================================
   ARABELLA — Dev Surge Infotech AI Assistant Widget Styles
   ================================================================ */

#arabella-widget {
  --ar-navy:   #0A192F;
  --ar-teal:   #00A896;
  --ar-gold:   #F59E0B;
  --ar-white:  #FFFFFF;
  --ar-light:  #F8FAFC;
  --ar-border: #E2E8F0;
  --ar-muted:  #64748B;
  --ar-radius: 16px;
  --ar-shadow: 0 8px 40px rgba(10, 25, 47, 0.20), 0 2px 10px rgba(0,0,0,0.08);
  font-family: 'Outfit', 'Inter', sans-serif;
}

/* FAB */
#arabella-fab {
  position: fixed; bottom: 28px; right: 28px;
  width: 62px; height: 62px; border-radius: 50%;
  background: linear-gradient(135deg, #0A192F 0%, #00A896 100%);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(0,168,150,0.45);
  z-index: 99990; transition: transform 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}
#arabella-fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(0,168,150,0.60); }
#arabella-fab svg { width: 28px; height: 28px; stroke: #fff; fill: none; stroke-width: 1.8; }
#arabella-fab .ar-fab-icon-open  { display: flex; }
#arabella-fab .ar-fab-icon-close { display: none; }
#arabella-fab.is-open .ar-fab-icon-open  { display: none; }
#arabella-fab.is-open .ar-fab-icon-close { display: flex; }
#arabella-fab::before {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid rgba(0,168,150,0.50);
  animation: ar-pulse 2.2s ease-in-out infinite;
}
@keyframes ar-pulse {
  0%   { opacity: 1; transform: scale(1); }
  70%  { opacity: 0; transform: scale(1.4); }
  100% { opacity: 0; transform: scale(1.4); }
}
#arabella-fab .ar-online-dot {
  position: absolute; top: 4px; right: 4px;
  width: 11px; height: 11px; border-radius: 50%;
  background: #22C55E; border: 2px solid #fff;
}

/* Panel */
#arabella-panel {
  position: fixed; bottom: 104px; right: 28px;
  width: 380px; height: 560px; max-height: calc(100vh - 130px);
  background: #FFFFFF; border-radius: 16px;
  box-shadow: 0 8px 40px rgba(10,25,47,0.20), 0 2px 10px rgba(0,0,0,0.08);
  z-index: 99989; display: flex; flex-direction: column;
  overflow: hidden; border: 1px solid #E2E8F0;
  transform: translateY(20px) scale(0.97); opacity: 0; pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), opacity 0.2s ease;
}
#arabella-panel.is-visible { transform: translateY(0) scale(1); opacity: 1; pointer-events: all; }

/* Header */
#arabella-header {
  background: linear-gradient(135deg, #0A192F 0%, #0E2A45 60%, #006B5E 100%);
  padding: 14px 18px; display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.ar-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #00A896, #00C9B5);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.1rem; color: #fff;
  flex-shrink: 0; border: 2px solid rgba(255,255,255,0.25); position: relative;
}
.ar-avatar::after {
  content: ''; position: absolute; bottom: 1px; right: 1px;
  width: 9px; height: 9px; background: #22C55E;
  border-radius: 50%; border: 2px solid #0A192F;
}
.ar-header-info { flex: 1; }
.ar-header-name { font-size: 0.95rem; font-weight: 800; color: #fff; margin: 0 0 1px; line-height: 1.2; }
.ar-header-sub  { font-size: 0.72rem; color: rgba(255,255,255,0.65); margin: 0; }
#arabella-close {
  background: none; border: none; cursor: pointer; color: rgba(255,255,255,0.7);
  display: flex; align-items: center; padding: 4px; border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
#arabella-close:hover { color: #fff; background: rgba(255,255,255,0.1); }
#arabella-close svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.5; }

/* Screens */
.ar-screen { display: none; flex-direction: column; flex: 1; overflow: hidden; }
.ar-screen.active { display: flex; }

/* Gate */
#ar-gate { padding: 28px 24px; overflow-y: auto; justify-content: center; }
.ar-gate-intro { text-align: center; margin-bottom: 24px; }
.ar-gate-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, #00A896, #00C9B5);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 900; color: #fff;
  margin: 0 auto 14px; border: 3px solid rgba(0,168,150,0.20);
}
.ar-gate-intro h4 { font-size: 1.05rem; font-weight: 800; color: #0A192F; margin: 0 0 6px; }
.ar-gate-intro p  { font-size: 0.84rem; color: #64748B; line-height: 1.55; margin: 0; }
.ar-gate-form { display: flex; flex-direction: column; gap: 14px; }
.ar-field label { display: block; font-size: 0.78rem; font-weight: 700; color: #0A192F; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.5px; }
.ar-field input {
  width: 100%; padding: 11px 14px; border: 1.5px solid #E2E8F0; border-radius: 10px;
  font-family: 'Outfit', sans-serif; font-size: 0.9rem; color: #0A192F;
  background: #F8FAFC; box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ar-field input:focus { outline: none; border-color: #00A896; box-shadow: 0 0 0 3px rgba(0,168,150,0.12); background: #fff; }
.ar-gate-error { font-size: 0.8rem; color: #EF4444; text-align: center; min-height: 18px; }
.ar-btn-start {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, #0A192F 0%, #00A896 100%);
  color: #fff; border: none; border-radius: 10px;
  font-family: 'Outfit', sans-serif; font-size: 0.92rem; font-weight: 800;
  cursor: pointer; transition: opacity 0.2s, transform 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.ar-btn-start:hover { opacity: 0.92; transform: translateY(-1px); }
.ar-btn-start:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.ar-privacy { font-size: 0.72rem; color: #64748B; text-align: center; margin: 4px 0 0; line-height: 1.4; }

/* Chat */
#ar-chat { flex: 1; overflow: hidden; }
#ar-messages {
  flex: 1; overflow-y: auto; padding: 16px 14px;
  display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth;
}
#ar-messages::-webkit-scrollbar { width: 4px; }
#ar-messages::-webkit-scrollbar-thumb { background: #E2E8F0; border-radius: 4px; }

.ar-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; }
.ar-msg.user { flex-direction: row-reverse; }
.ar-msg-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #00A896, #00C9B5);
}
.ar-msg.user .ar-msg-avatar { background: #0A192F; }
.ar-bubble {
  max-width: 78%; padding: 10px 14px; border-radius: 16px;
  font-size: 0.875rem; line-height: 1.55; word-wrap: break-word;
}
.ar-msg.arabella .ar-bubble { background: #F8FAFC; border: 1px solid #E2E8F0; color: #0A192F; border-bottom-left-radius: 4px; }
.ar-msg.user .ar-bubble { background: linear-gradient(135deg, #0A192F, #0E2A45); color: #fff; border-bottom-right-radius: 4px; }
.ar-bubble a { color: #00A896; text-decoration: underline; }
.ar-msg.user .ar-bubble a { color: rgba(255,255,255,0.85); }

.ar-typing-dots { display: flex; gap: 5px; align-items: center; padding: 4px 2px; }
.ar-typing-dots span { width: 7px; height: 7px; background: #00A896; border-radius: 50%; animation: ar-bounce 1.2s infinite ease-in-out; }
.ar-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.ar-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ar-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%            { transform: translateY(-6px); }
}

/* Input */
#ar-input-bar {
  display: flex; gap: 8px; padding: 12px 14px;
  border-top: 1px solid #E2E8F0; background: #fff;
  flex-shrink: 0; align-items: flex-end;
}
#ar-input {
  flex: 1; resize: none; border: 1.5px solid #E2E8F0; border-radius: 12px;
  padding: 10px 14px; font-family: 'Outfit', sans-serif; font-size: 0.88rem;
  color: #0A192F; background: #F8FAFC;
  max-height: 90px; overflow-y: auto; line-height: 1.4;
  transition: border-color 0.15s; outline: none;
}
#ar-input:focus { border-color: #00A896; background: #fff; }
#ar-input::placeholder { color: #94A3B8; }
#ar-send {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px;
  background: linear-gradient(135deg, #0A192F 0%, #00A896 100%);
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: opacity 0.2s;
}
#ar-send:hover { opacity: 0.88; }
#ar-send:disabled { opacity: 0.45; cursor: not-allowed; }
#ar-send svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 2; }

/* Mobile */
@media (max-width: 480px) {
  #arabella-panel { right: 0; bottom: 0; width: 100%; height: 100%; max-height: 100%; border-radius: 0; border: none; }
  #arabella-fab   { bottom: 20px; right: 20px; }
}
