/* ============================================================
   AKI CHATBOT v3 – Komplett isoliertes CSS
   ============================================================ */
.akibot-widget *, .akibot-widget *::before, .akibot-widget *::after {
  box-sizing: border-box; margin: 0; padding: 0;
}

.akibot-widget {
  --ab-teal: #335860;
  --ab-teal-l: #3d6b74;
  --ab-teal-d: #284650;
  --ab-red: #E24539;
  --ab-accent: #a8f0f0;
  --ab-accent-s: #d4f8f8;
  --ab-bg: #f7fafa;
  --ab-card: #ffffff;
  --ab-txt: #1a2e30;
  --ab-txt-l: #5a7a7e;
  --ab-brd: #d0e0e2;
  --ab-brd-l: #e8f0f1;
  --ab-sh: 0 14px 52px rgba(51,88,96,0.22), 0 2px 8px rgba(0,0,0,0.06);
  --ab-r: 16px;
  --ab-rs: 11px;
  --ab-rb: 24px;
  --ab-f: 'Nunito Sans','Segoe UI',sans-serif;
  --ab-fb: 'Lato','Segoe UI',sans-serif;
  --ab-t: 0.25s cubic-bezier(0.4,0,0.2,1);
  position: fixed; bottom: 16px; right: 16px; z-index: 999999;
  font-family: var(--ab-f); font-size: 15px; line-height: 1.5;
  color: var(--ab-txt); -webkit-font-smoothing: antialiased;
}

/* === TRIGGER === */
.akibot-trigger {
  width: 68px; height: 68px; border-radius: 50%;
  background: linear-gradient(135deg, var(--ab-teal) 0%, var(--ab-teal-d) 100%);
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 28px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.15), inset 0 1px 0 rgba(168,240,240,0.2);
  transition: all var(--ab-t); position: relative; overflow: hidden;
}
/* Hide bubble when chat is open */
.akibot-trigger.akibot-hidden {
  opacity: 0; transform: scale(0); pointer-events: none;
}
.akibot-trigger::before {
  content:''; position:absolute; inset:-2px; border-radius:50%;
  background: conic-gradient(from 0deg, transparent, var(--ab-accent), transparent);
  opacity:0; transition: opacity 0.4s; z-index:-1;
  animation: akibot-spin 4s linear infinite;
}
.akibot-trigger:hover { transform: scale(1.08); box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 3px 10px rgba(0,0,0,0.18), 0 0 0 4px rgba(168,240,240,0.25); }
.akibot-trigger:hover::before { opacity:1; }
@keyframes akibot-spin { to { transform: rotate(360deg); } }
.akibot-trigger-icon { width:30px; height:30px; }
.akibot-trigger.akibot-pulse { animation: akibot-pa 2.5s ease-in-out 3; }
@keyframes akibot-pa {
  0%,100% { box-shadow: 0 6px 28px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.15), 0 0 0 0 rgba(168,240,240,0.4); }
  50% { box-shadow: 0 6px 28px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.15), 0 0 0 14px rgba(168,240,240,0); }
}

/* === TEASER === */
.akibot-teaser {
  position:absolute; bottom:78px; right:0; background:var(--ab-card);
  border:1px solid var(--ab-brd); border-radius:var(--ab-rs);
  padding:12px 34px 12px 16px; font-size:13.5px; font-family:var(--ab-fb);
  color:var(--ab-txt); box-shadow:0 4px 16px rgba(0,0,0,0.1);
  white-space:normal; max-width:340px; min-width:220px;
  opacity:0; transform:translateY(8px) scale(0.95);
  transition: all 0.35s ease; pointer-events:none;
  cursor:pointer;
}
.akibot-teaser.akibot-show { opacity:1; transform:translateY(0) scale(1); pointer-events:auto; }
.akibot-teaser::after {
  content:''; position:absolute; bottom:-6px; right:26px;
  width:12px; height:12px; background:var(--ab-card);
  border-right:1px solid var(--ab-brd); border-bottom:1px solid var(--ab-brd);
  transform:rotate(45deg);
}
.akibot-teaser-close { position:absolute; top:5px; right:8px; background:none; border:none; font-size:13px; cursor:pointer; color:var(--ab-txt-l); padding:2px; line-height:1; }

/* === WINDOW – stretches to bottom edge === */
.akibot-window {
  position: fixed;
  bottom: 0; right: 16px;
  width: 490px;
  max-height: calc(100vh - 20px);
  max-height: calc(100dvh - 20px);
  background:var(--ab-bg); border-radius:var(--ab-r) var(--ab-r) 0 0;
  box-shadow:var(--ab-sh); border:1px solid var(--ab-brd); border-bottom:none;
  display:flex; flex-direction:column; overflow:hidden;
  opacity:0; transform:translateY(20px);
  pointer-events:none; transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
.akibot-window.akibot-visible { opacity:1; transform:translateY(0); pointer-events:auto; }

/* === HEADER === */
.akibot-header {
  background: linear-gradient(135deg, var(--ab-teal) 0%, var(--ab-teal-d) 100%);
  padding:15px 16px; display:flex; align-items:center; gap:11px; position:relative; overflow:hidden;
}
.akibot-header::after {
  content:''; position:absolute; top:-60%; right:-15%; width:140px; height:140px;
  background:radial-gradient(circle, rgba(168,240,240,0.1) 0%, transparent 70%);
  border-radius:50%; pointer-events:none;
}
.akibot-header-photo {
  width:42px; height:42px; border-radius:50%; object-fit:cover;
  border:2px solid rgba(168,240,240,0.4); flex-shrink:0;
}
.akibot-header-info { flex:1; min-width:0; }
.akibot-header-title { font-size:15px; font-weight:700; color:#fff; }
.akibot-header-sub { font-size:11.5px; color:var(--ab-accent); font-family:var(--ab-fb); opacity:0.9; }
.akibot-header-btn {
  background:rgba(255,255,255,0.1); border:none; width:30px; height:30px;
  border-radius:8px; cursor:pointer; display:flex; align-items:center; justify-content:center;
  transition:background 0.2s; color:#fff; z-index:1;
}
.akibot-header-btn:hover { background:rgba(255,255,255,0.2); }
.akibot-header-btn svg { width:15px; height:15px; }

/* === BODY === */
.akibot-body {
  flex:1; overflow-y:auto; padding:16px;
  display:flex; flex-direction:column; gap:10px;
  min-height:0; scroll-behavior:smooth;
}
.akibot-body::-webkit-scrollbar { width:5px; }
.akibot-body::-webkit-scrollbar-track { background:transparent; }
.akibot-body::-webkit-scrollbar-thumb { background:var(--ab-brd); border-radius:10px; }

/* === MESSAGES === */
.akibot-msg { display:flex; gap:9px; max-width:92%; animation:akibot-mi 0.35s ease-out; }
@keyframes akibot-mi { from{opacity:0;transform:translateY(10px);} to{opacity:1;transform:translateY(0);} }
.akibot-msg-bot { align-self:flex-start; }
.akibot-msg-user { align-self:flex-end; flex-direction:row-reverse; }
.akibot-msg-av {
  width:28px; height:28px; border-radius:50%; display:flex;
  align-items:center; justify-content:center; flex-shrink:0; margin-top:2px; overflow:hidden;
}
.akibot-msg-bot .akibot-msg-av { background:var(--ab-teal); }
.akibot-msg-user .akibot-msg-av { background:var(--ab-red); }
.akibot-msg-av img { width:100%; height:100%; object-fit:cover; }
.akibot-msg-av svg { width:15px; height:15px; }
.akibot-msg-bbl {
  padding:11px 15px; border-radius:var(--ab-rs);
  font-family:var(--ab-fb); font-size:13.5px; line-height:1.55;
}
.akibot-msg-bot .akibot-msg-bbl {
  background:var(--ab-card); border:1px solid var(--ab-brd);
  border-bottom-left-radius:4px; color:var(--ab-txt);
}
.akibot-msg-user .akibot-msg-bbl { background:var(--ab-teal); color:#fff; border-bottom-right-radius:4px; }
.akibot-msg-bbl strong { font-weight:700; color:var(--ab-teal-d); }
.akibot-msg-user .akibot-msg-bbl strong { color:var(--ab-accent); }

/* Typing */
.akibot-typing { display:flex; gap:4px; padding:13px 17px; align-items:center; }
.akibot-td { width:7px; height:7px; border-radius:50%; background:var(--ab-teal); opacity:0.4; animation:akibot-tb 1.2s ease-in-out infinite; }
.akibot-td:nth-child(2){animation-delay:.15s;} .akibot-td:nth-child(3){animation-delay:.3s;}
@keyframes akibot-tb { 0%,60%,100%{transform:translateY(0);opacity:.4;} 30%{transform:translateY(-6px);opacity:1;} }

/* === OPTION BUTTONS === */
.akibot-opts { display:flex; flex-direction:column; gap:6px; padding:3px 0 3px 37px; animation:akibot-mi 0.35s ease-out; }
.akibot-ob {
  background:var(--ab-card); border:1.5px solid var(--ab-brd); border-radius:var(--ab-rb);
  padding:9px 14px; font-family:var(--ab-f); font-size:13px; font-weight:600;
  color:var(--ab-teal); cursor:pointer; transition:all var(--ab-t);
  text-align:left; display:flex; align-items:center; gap:8px; line-height:1.3;
  white-space:normal; word-break:break-word;
}
.akibot-ob:hover { background:var(--ab-teal); color:#fff; border-color:var(--ab-teal); transform:translateX(3px); }
.akibot-ob .akibot-oi { font-size:15px; flex-shrink:0; width:22px; text-align:center; line-height:1; }
.akibot-ob.akibot-op { background:var(--ab-accent-s); border-color:rgba(168,240,240,0.55); }
.akibot-ob.akibot-op:hover { background:var(--ab-teal); color:#fff; border-color:var(--ab-teal); }

/* Subtle "secondary" style */
.akibot-ob.akibot-os { border-style:dashed; font-size:12px; padding:8px 14px; opacity:0.85; }
.akibot-ob.akibot-os:hover { opacity:1; }

/* === COURSE CARDS === */
.akibot-courses { display:flex; flex-direction:column; gap:8px; padding:3px 0 3px 37px; animation:akibot-mi 0.35s ease-out; }
.akibot-cc {
  background:var(--ab-card); border:1px solid var(--ab-brd); border-radius:var(--ab-rs);
  padding:13px 14px; transition:all var(--ab-t);
}
.akibot-cc:hover { border-color:var(--ab-teal); box-shadow:0 2px 10px rgba(51,88,96,0.08); }
.akibot-cn { font-family:var(--ab-f); font-size:13px; font-weight:700; color:var(--ab-teal-d); margin-bottom:3px; line-height:1.3; }
.akibot-ct { font-family:var(--ab-fb); font-size:12px; color:var(--ab-txt-l); margin-bottom:7px; line-height:1.4; }
.akibot-cm { display:flex; align-items:center; gap:7px; margin-bottom:8px; flex-wrap:wrap; }
.akibot-ctg {
  display:inline-flex; align-items:center; gap:2px;
  background:var(--ab-accent-s); padding:2px 7px; border-radius:9px;
  font-size:10.5px; font-family:var(--ab-f); color:var(--ab-teal); font-weight:600;
}
.akibot-cl {
  display:inline-flex; align-items:center; gap:4px;
  background:var(--ab-teal); color:#fff !important; text-decoration:none !important;
  border-radius:14px; padding:5px 12px; font-size:12px; font-weight:600;
  font-family:var(--ab-f); transition:background 0.2s;
}
.akibot-cl:hover { background:var(--ab-teal-d); color:#fff !important; }

/* === INFO BOX === */
.akibot-ib {
  background:var(--ab-accent-s); border-left:3px solid var(--ab-teal);
  border-radius:0 var(--ab-rs) var(--ab-rs) 0;
  padding:12px 14px; margin:3px 0 3px 37px;
  font-family:var(--ab-fb); font-size:12.5px; color:var(--ab-teal-d); line-height:1.55;
  animation:akibot-mi 0.35s ease-out;
}
.akibot-ib a { color:var(--ab-red) !important; text-decoration:none !important; font-weight:700; }
.akibot-ib a:hover { text-decoration:underline !important; }

/* Warm variant */
.akibot-ib.akibot-warm { background:#fff8f0; border-left-color:var(--ab-red); }

/* === DEPT GRID === */
.akibot-dg { display:grid; grid-template-columns:1fr 1fr; gap:5px; padding:3px 0 3px 37px; animation:akibot-mi 0.35s ease-out; }
.akibot-db {
  background:var(--ab-card); border:1.5px solid var(--ab-brd); border-radius:var(--ab-rs);
  padding:9px 10px; font-family:var(--ab-f); font-size:12px; font-weight:600;
  color:var(--ab-teal); cursor:pointer; transition:all var(--ab-t);
  text-align:center; line-height:1.3;
}
.akibot-db:hover { background:var(--ab-teal); color:#fff; border-color:var(--ab-teal); }

/* === STEP DOTS === */
.akibot-sd { display:flex; align-items:center; gap:4px; padding:0 0 4px 37px; animation:akibot-mi 0.3s ease-out; }
.akibot-dot { width:8px; height:8px; border-radius:50%; background:var(--ab-brd); transition:all 0.3s; }
.akibot-dot.akibot-da { background:var(--ab-teal); width:22px; border-radius:4px; }
.akibot-dot.akibot-dd { background:var(--ab-accent); }

/* === FOOTER === */
.akibot-footer { padding:0; border-top:1px solid var(--ab-brd); background:var(--ab-card); flex-shrink:0; }
.akibot-fa { display:flex; align-items:center; gap:4px; padding:7px 10px; flex-wrap:wrap; }
.akibot-qb {
  background:none; border:1px solid var(--ab-brd); border-radius:14px;
  padding:3px 8px; font-family:var(--ab-f); font-size:10.5px; font-weight:600;
  color:var(--ab-txt-l); cursor:pointer; transition:all 0.2s;
  display:inline-flex; align-items:center; gap:2px; text-decoration:none !important;
  white-space:nowrap;
}
.akibot-qb:hover { border-color:var(--ab-teal); color:var(--ab-teal); background:var(--ab-accent-s); }
.akibot-qb svg { width:12px; height:12px; }
.akibot-fn {
  display:flex; align-items:center; gap:6px; padding:6px 10px;
  background:linear-gradient(90deg,#f0fafa 0%,var(--ab-accent-s) 100%);
  border-top:1px solid var(--ab-brd-l); font-family:var(--ab-fb); font-size:11px; color:var(--ab-txt-l);
}
.akibot-fn a { color:var(--ab-teal) !important; text-decoration:none !important; font-weight:700; font-family:var(--ab-f); display:inline-flex; align-items:center; gap:3px; }
.akibot-fn a:hover { color:var(--ab-red) !important; }

/* === EXIT INTENT GLOW === */
.akibot-trigger.akibot-glow {
  animation: akibot-glow-anim 1.5s ease-in-out 3;
}
@keyframes akibot-glow-anim {
  0%,100% { box-shadow: 0 6px 28px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.15); }
  50% { box-shadow: 0 6px 28px rgba(226,69,57,0.5), 0 0 0 12px rgba(226,69,57,0.2), 0 0 20px rgba(226,69,57,0.15); }
}

/* Exit-intent teaser: bigger, bolder */
.akibot-teaser.akibot-exit {
  background: var(--ab-teal-d);
  color: #fff;
  border-color: var(--ab-teal);
  padding: 18px 40px 18px 22px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--ab-f);
  white-space: normal;
  min-width: 280px;
  max-width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25), 0 0 0 2px rgba(168,240,240,0.2);
  animation: akibot-exit-pop 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.akibot-teaser.akibot-exit::after {
  background: var(--ab-teal-d);
  border-color: var(--ab-teal);
}
.akibot-teaser.akibot-exit .akibot-teaser-close {
  color: rgba(255,255,255,0.6);
}
@keyframes akibot-exit-pop {
  from { opacity:0; transform: translateY(12px) scale(0.9); }
  to { opacity:1; transform: translateY(0) scale(1); }
}

/* === RESPONSIVE === */
@media (max-width:520px) {
  .akibot-widget { bottom:0; right:0; }
  .akibot-window {
    width:100vw; right:0; bottom:0;
    max-height:100vh; max-height:100dvh;
    border-radius:0;
  }
  .akibot-teaser { right:16px; bottom:78px; }
  .akibot-trigger { position:fixed; bottom:16px; right:16px; }
}
@media print { .akibot-widget { display:none !important; } }
