/* =========================================================
   Asistenti ARRA — chatbot (landing + eService)
   Përdor ngjyrat e temës (dark/light) nga app.css
   ========================================================= */
.arrabot {
  --ab-g: linear-gradient(135deg, #ff1f8f 0%, #c026d3 50%, #7c3aed 100%);
  --ab-bg: var(--surface-solid, #14111f);
  --ab-line: var(--border, rgba(255, 255, 255, .08));
  --ab-line2: var(--border-strong, rgba(255, 255, 255, .14));
  --ab-tx: var(--text, #f5f3ff);
  --ab-tx2: var(--text-2, #c4bfdb);
  --ab-tx3: var(--text-3, #8a83a6);
  --ab-bot: color-mix(in srgb, var(--ab-tx) 6%, var(--ab-bg));
  --ab-wa: #25d366;
  --ab-bottom: 22px;
  position: fixed; right: 22px; bottom: var(--ab-bottom); z-index: 90;
  font-family: var(--font-body, Inter, system-ui, sans-serif);
  color: var(--ab-tx);
}
/* mbi bottom-nav të eService në telefon */
@media (max-width: 1024px) { body:has(.bottom-nav) .arrabot { --ab-bottom: 92px; } }

/* ---------- butoni ---------- */
.ab-launch {
  position: relative; width: 62px; height: 62px; border: 0; border-radius: 22px; cursor: pointer; color: #fff;
  background: var(--ab-g); display: grid; place-items: center;
  box-shadow: 0 18px 40px -12px rgba(192, 38, 211, .75), 0 0 0 1px rgba(255, 255, 255, .12) inset;
  transition: transform .35s cubic-bezier(.2, .9, .3, 1.3), border-radius .35s, box-shadow .3s;
}
.ab-launch:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 24px 50px -12px rgba(192, 38, 211, .9), 0 0 0 1px rgba(255, 255, 255, .18) inset; }
.ab-launch:focus-visible { outline: 3px solid color-mix(in srgb, #c026d3 50%, transparent); outline-offset: 3px; }
.ab-launch::before { content: ""; position: absolute; inset: -6px; border-radius: 26px; border: 2px solid rgba(255, 31, 143, .45); animation: abRing 2.6s ease-out infinite; pointer-events: none; }
.arrabot.open .ab-launch::before, .arrabot.seen .ab-launch::before { display: none; }
@keyframes abRing { 0% { opacity: .9; transform: scale(.9); } 80%, 100% { opacity: 0; transform: scale(1.25); } }
.ab-launch svg { width: 28px; height: 28px; }
.ab-l-open, .ab-l-close { position: absolute; display: grid; place-items: center; transition: transform .35s, opacity .25s; }
.ab-l-close { opacity: 0; transform: rotate(-90deg) scale(.6); }
.arrabot.open .ab-launch { border-radius: 50%; }
.arrabot.open .ab-l-open { opacity: 0; transform: rotate(90deg) scale(.6); }
.arrabot.open .ab-l-close { opacity: 1; transform: none; }
.ab-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #fff; color: #c026d3; font: 800 11px/20px var(--font-body, sans-serif); text-align: center; box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }

/* ---------- teaser ---------- */
.ab-teaser {
  position: absolute; right: 0; bottom: 78px; width: 270px; padding: 14px 38px 14px 16px; border-radius: 18px 18px 6px 18px;
  background: var(--ab-bg); border: 1px solid var(--ab-line2); box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .55);
  font-size: 13.5px; line-height: 1.45; color: var(--ab-tx2); cursor: pointer; animation: abPop .45s cubic-bezier(.2, .9, .3, 1.3);
}
.ab-teaser b { display: block; color: var(--ab-tx); font-size: 14.5px; margin-bottom: 2px; }
.ab-teaser-x { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border: 0; border-radius: 8px; background: transparent; color: var(--ab-tx3); cursor: pointer; display: grid; place-items: center; }
.ab-teaser-x:hover { background: var(--ab-bot); color: var(--ab-tx); }
.ab-teaser-x svg { width: 14px; height: 14px; }
@keyframes abPop { from { opacity: 0; transform: translateY(10px) scale(.95); } to { opacity: 1; transform: none; } }

/* ---------- paneli ---------- */
.ab-panel {
  position: absolute; right: 0; bottom: 78px; width: 392px; height: min(640px, calc(100vh - 130px)); display: flex; flex-direction: column;
  background: var(--ab-bg); border: 1px solid var(--ab-line2); border-radius: 24px; overflow: hidden;
  box-shadow: 0 40px 90px -24px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .03);
  transform-origin: bottom right; animation: abOpen .38s cubic-bezier(.2, .9, .3, 1.15);
}
.ab-panel[hidden] { display: none; }
@keyframes abOpen { from { opacity: 0; transform: translateY(14px) scale(.94); } to { opacity: 1; transform: none; } }

.ab-head { position: relative; display: flex; align-items: center; gap: 12px; padding: 16px 14px 16px 16px; color: #fff; background: var(--ab-g); }
.ab-head::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 140% at 0% 0%, rgba(255, 255, 255, .22), transparent 55%); pointer-events: none; }
.ab-avatar { flex: none; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .28); }
.ab-avatar svg { width: 24px; height: 24px; }
.ab-ttl { flex: 1; min-width: 0; }
.ab-ttl b { display: block; font: 800 16px/1.2 var(--font-display, var(--font-body, sans-serif)); letter-spacing: -.01em; }
.ab-ttl small { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: .9; margin-top: 2px; }
.ab-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .28); }
.ab-tools { position: relative; z-index: 1; display: flex; gap: 4px; }
.ab-ibtn { width: 34px; height: 34px; border-radius: 10px; border: 0; background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background .2s; }
.ab-ibtn:hover { background: rgba(255, 255, 255, .26); }
.ab-ibtn svg { width: 17px; height: 17px; }
.ab-wa-top svg { width: 18px; height: 18px; }

.ab-body { flex: 1; overflow-y: auto; padding: 18px 16px 8px; scroll-behavior: smooth; overscroll-behavior: contain; }
.ab-msgs { display: flex; flex-direction: column; gap: 10px; }
.ab-m { display: flex; gap: 8px; max-width: 92%; animation: abMsg .3s ease-out; }
@keyframes abMsg { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ab-m.bot { align-self: flex-start; }
.ab-m.me { align-self: flex-end; flex-direction: row-reverse; }
.ab-mi { flex: none; width: 28px; height: 28px; margin-top: 2px; border-radius: 9px; background: var(--ab-g); color: #fff; display: grid; place-items: center; }
.ab-mi svg { width: 16px; height: 16px; }
.ab-bubble { padding: 11px 14px; border-radius: 18px; font-size: 14px; line-height: 1.55; word-wrap: break-word; overflow-wrap: anywhere; }
.bot .ab-bubble { background: var(--ab-bot); border: 1px solid var(--ab-line); border-top-left-radius: 6px; color: var(--ab-tx); }
.me .ab-bubble { background: var(--ab-g); color: #fff; border-bottom-right-radius: 6px; box-shadow: 0 10px 24px -14px rgba(192, 38, 211, .8); }
.ab-bubble p { margin: 0 0 8px; } .ab-bubble p:last-child { margin-bottom: 0; }
.ab-bubble ul, .ab-bubble ol { margin: 4px 0 8px; padding-left: 20px; } .ab-bubble li { margin: 3px 0; }
.ab-bubble b, .ab-bubble strong { font-weight: 700; }
.ab-bubble code { font: 12.5px var(--font-mono, monospace); padding: 1px 5px; border-radius: 6px; background: color-mix(in srgb, var(--ab-tx) 10%, transparent); }
.ab-bubble pre { margin: 6px 0; padding: 10px; border-radius: 10px; background: #0b0a12; color: #e9e6f7; overflow-x: auto; font-size: 12px; }
.ab-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ab-act { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 10px; font-size: 12.5px; font-weight: 700; text-decoration: none; color: var(--ab-tx); background: var(--ab-bg); border: 1px solid var(--ab-line2); transition: border-color .2s, transform .2s; }
.ab-act:hover { border-color: #c026d3; transform: translateY(-1px); }
.ab-act svg { width: 15px; height: 15px; }
.ab-act.wa { color: #fff; background: var(--ab-wa); border-color: transparent; }
.ab-act.wa:hover { background: #1fb956; }
.ab-time { font-size: 10.5px; color: var(--ab-tx3); margin: 3px 4px 0; }
.me .ab-time { text-align: right; }

.ab-typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.ab-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ab-tx3); animation: abDot 1.2s infinite ease-in-out; }
.ab-typing i:nth-child(2) { animation-delay: .15s; } .ab-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes abDot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }

.ab-chips { display: flex; gap: 6px; padding: 4px 14px 10px; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.ab-chips::-webkit-scrollbar { display: none; }
.ab-chips:empty { display: none; }
.ab-chip { flex: none; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--ab-line2); background: transparent; color: var(--ab-tx2); font: 600 12.5px var(--font-body, sans-serif); cursor: pointer; white-space: nowrap; transition: .2s; }
.ab-chip:hover { color: var(--ab-tx); border-color: #c026d3; background: color-mix(in srgb, #c026d3 10%, transparent); }

.ab-form { display: flex; align-items: flex-end; gap: 8px; margin: 0 12px; padding: 6px 6px 6px 14px; border-radius: 18px; border: 1px solid var(--ab-line2); background: var(--ab-bot); transition: border-color .2s, box-shadow .2s; }
.ab-form:focus-within { border-color: #c026d3; box-shadow: 0 0 0 4px color-mix(in srgb, #c026d3 16%, transparent); }
.ab-input { flex: 1; min-height: 38px; max-height: 120px; padding: 9px 0; border: 0; outline: 0; resize: none; background: transparent; color: var(--ab-tx); font: 14.5px/1.4 var(--font-body, sans-serif); }
.ab-input::placeholder { color: var(--ab-tx3); }
.ab-send { flex: none; width: 40px; height: 40px; border: 0; border-radius: 13px; background: var(--ab-g); color: #fff; display: grid; place-items: center; cursor: pointer; transition: transform .2s, opacity .2s; }
.ab-send:disabled { opacity: .45; cursor: default; }
.ab-send:not(:disabled):hover { transform: scale(1.06); }
.ab-send svg { width: 18px; height: 18px; }
.ab-human { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 14px 12px; font-size: 12px; color: var(--ab-tx3); text-decoration: none; text-align: center; }
.ab-human b { color: var(--ab-tx2); font-weight: 700; }
.ab-human svg { width: 15px; height: 15px; color: var(--ab-wa); flex: none; }
.ab-human:hover b { color: var(--ab-wa); }

/* ---------- telefoni: paneli në gjithë ekranin ---------- */
@media (max-width: 560px) {
  .arrabot { right: 14px; }
  .ab-launch { width: 56px; height: 56px; border-radius: 20px; }
  .ab-panel { position: fixed; inset: 0; width: auto; height: auto; border-radius: 0; border: 0; animation-name: abSlide; }
  @keyframes abSlide { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
  .arrabot.open .ab-launch { display: none; }
  .ab-head { padding-top: max(16px, env(safe-area-inset-top)); }
  .ab-human { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .ab-teaser { width: min(270px, calc(100vw - 100px)); bottom: 70px; }
}
@media (prefers-reduced-motion: reduce) { .arrabot * { animation: none !important; transition: none !important; } }
@media print { .arrabot { display: none !important; } }
/* telefoni: butoni më i vogël, që të mos mbulojë fushat dhe tekstin */
@media (max-width: 760px) { .arrabot .ab-launch { width: 50px; height: 50px; border-radius: 17px; } .arrabot { right: 14px; } }
