/* ═══════════════════════════════════════════════════════════════
   Political Sampark AI Ultra Pro — Stylesheet v3.0.0
═══════════════════════════════════════════════════════════════ */

/* ── Base ─────────────────────────────────────────────────────── */
.psai-launcher,.psai-panel,.psai-panel *{
  box-sizing:border-box;
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

/* ── Launcher Button ──────────────────────────────────────────── */
.psai-launcher{
  position:fixed;right:24px;bottom:24px;z-index:999998;
  display:flex;align-items:center;gap:12px;
  padding:10px 18px 10px 10px;border-radius:999px;
  background:linear-gradient(135deg,var(--psai-primary,#00563f),#02291f);
  color:#fff;
  box-shadow:0 18px 45px rgba(0,0,0,.30),0 4px 12px rgba(0,86,63,.35);
  cursor:pointer;user-select:none;
  border:1.5px solid rgba(255,255,255,.22);
  transition:transform .25s ease,box-shadow .25s ease;
}
.psai-launcher:hover{transform:translateY(-3px);box-shadow:0 24px 55px rgba(0,0,0,.34)}
.psai-launcher img{width:56px;height:56px;border-radius:50%;object-fit:cover;background:#fff;border:3px solid #fff}
.psai-launcher b{font-size:15px;font-weight:700;white-space:nowrap}

/* ── Pulse dot ────────────────────────────────────────────────── */
.psai-pulse{
  position:absolute;right:9px;top:10px;
  width:13px;height:13px;background:#22c55e;
  border:2px solid #fff;border-radius:50%;
  box-shadow:0 0 0 0 rgba(34,197,94,.55);
  animation:psaiPulse 1.7s infinite;
}
@keyframes psaiPulse{70%{box-shadow:0 0 0 12px rgba(34,197,94,0)}}

/* ── Panel ────────────────────────────────────────────────────── */
.psai-panel{
  position:fixed;right:24px;bottom:108px;
  width:440px;height:min(720px,calc(100vh - 140px));
  z-index:999999;
  background:#fff;border-radius:26px;overflow:hidden;
  box-shadow:0 32px 80px rgba(0,0,0,.32),0 8px 24px rgba(0,0,0,.12);
  border:1px solid rgba(12,35,29,.12);
  display:none;flex-direction:column;
  transform:translateY(16px) scale(.96);opacity:0;
  transition:transform .28s cubic-bezier(.22,.68,0,1.2),opacity .2s ease;
}
.psai-panel.active{
  display:flex;
  transform:translateY(0) scale(1);opacity:1;
}

/* ── Header ───────────────────────────────────────────────────── */
.psai-head{
  flex:0 0 auto;padding:18px 16px 16px;
  background:
    radial-gradient(circle at 0% 0%,rgba(255,153,51,.22) 0%,transparent 38%),
    radial-gradient(circle at 100% 100%,rgba(0,86,63,.55) 0%,transparent 50%),
    linear-gradient(135deg,#02291f 0%,var(--psai-primary,#00563f) 100%);
  color:#fff;
  display:flex;align-items:center;justify-content:space-between;gap:12px;
}
.psai-brand{display:flex;align-items:center;gap:14px;min-width:0;flex:1}
.psai-brand img{
  width:58px;height:58px;border-radius:18px;object-fit:cover;background:#fff;
  border:3px solid rgba(255,255,255,.95);box-shadow:0 8px 25px rgba(0,0,0,.2);
  flex:0 0 auto;
}
.psai-brand h3{
  margin:0;font-size:20px;line-height:1.15;font-weight:800;
  letter-spacing:-.4px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.psai-verified{
  display:inline-flex;align-items:center;justify-content:center;
  width:20px;height:20px;border-radius:50%;background:#20c997;
  font-size:13px;margin-left:4px;
}
.psai-brand p{margin:4px 0 0;font-size:13px;color:rgba(255,255,255,.82)}

/* ── Header action buttons ────────────────────────────────────── */
.psai-head-actions{display:flex;gap:8px;align-items:center;flex:0 0 auto}
.psai-icon-btn{
  width:40px;height:40px;border:1px solid rgba(255,255,255,.22);border-radius:12px;
  background:rgba(255,255,255,.08);color:#fff;font-size:18px;line-height:1;
  cursor:pointer;display:flex;align-items:center;justify-content:center;
  transition:background .2s ease;
}
.psai-icon-btn:hover{background:rgba(255,255,255,.18)}

/* ── Body / scroll ────────────────────────────────────────────── */
.psai-body{
  flex:1;overflow-y:auto;padding:20px;
  background:linear-gradient(180deg,#f8fafc 0%,#fff 120px);
  scroll-behavior:smooth;
}
.psai-body::-webkit-scrollbar{width:5px}
.psai-body::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:20px}

/* ── Message rows ─────────────────────────────────────────────── */
.psai-msg-row{display:flex;gap:10px;margin-bottom:14px;animation:psaiSlideIn .22s ease both}
@keyframes psaiSlideIn{from{opacity:0;transform:translateY(8px)}}
.psai-avatar{width:38px;height:38px;border-radius:50%;object-fit:cover;background:#fff;border:1px solid #e5e7eb;flex:0 0 auto;margin-top:2px}

/* ── Bubbles ──────────────────────────────────────────────────── */
.psai-bubble{
  max-width:calc(100% - 50px);padding:13px 16px;border-radius:20px;
  background:#fff;color:#1f2937;font-size:14.5px;line-height:1.65;
  box-shadow:0 4px 18px rgba(15,23,42,.07);border:1px solid #eef2f7;
  word-break:break-word;
}
.psai-msg-row.user{justify-content:flex-end}
.psai-msg-row.user .psai-bubble{
  background:linear-gradient(135deg,var(--psai-primary,#00563f),#013629);
  color:#fff;border:none;border-bottom-right-radius:6px;max-width:80%;
}
.psai-msg-row.bot .psai-bubble{border-bottom-left-radius:6px}
.psai-msg-row small{display:block;margin-top:6px;color:#64748b;font-size:12px}

/* ── Feedback buttons ─────────────────────────────────────────── */
.psai-feedback{display:flex;gap:6px;margin-top:7px}
.psai-fb-btn{
  background:none;border:1px solid #e5e7eb;border-radius:8px;
  padding:3px 8px;font-size:13px;cursor:pointer;color:#64748b;
  transition:all .18s ease;
}
.psai-fb-btn:hover{border-color:var(--psai-primary,#00563f);background:#f0fdf4}
.psai-fb-btn.active{background:var(--psai-primary,#00563f);color:#fff;border-color:var(--psai-primary,#00563f)}

/* ── Quick chips ──────────────────────────────────────────────── */
.psai-chips{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:12px 0 14px}
.psai-chips button{
  border:1px solid #e5e7eb;background:#fff;border-radius:16px;
  padding:12px 12px;text-align:left;color:#073b2d;font-weight:700;font-size:13.5px;
  box-shadow:0 4px 14px rgba(15,23,42,.05);cursor:pointer;transition:.2s ease;
  line-height:1.35;
}
.psai-chips button:hover{
  border-color:var(--psai-primary,#00563f);
  background:#f0fdf4;transform:translateY(-2px);
  box-shadow:0 8px 20px rgba(0,86,63,.12);
}

/* ── Typing indicator ─────────────────────────────────────────── */
.psai-typing{
  display:inline-flex;gap:4px;padding:14px 16px;
  background:#fff;border-radius:18px;border:1px solid #eef2f7;
}
.psai-typing i{width:7px;height:7px;border-radius:50%;background:#94a3b8;animation:psaiDot 1s infinite}
.psai-typing i:nth-child(2){animation-delay:.15s}
.psai-typing i:nth-child(3){animation-delay:.3s}
@keyframes psaiDot{50%{transform:translateY(-5px);background:var(--psai-primary,#00563f)}}

/* ── Footer ───────────────────────────────────────────────────── */
.psai-foot{
  flex:0 0 auto;
  background:rgba(255,255,255,.94);backdrop-filter:blur(16px);
  border-top:1px solid #eef2f7;padding:12px 14px 14px;
}
.psai-form-wrap{display:flex;gap:9px;align-items:center}
.psai-input{
  flex:1;height:50px;border:1.5px solid #dfe7ef;border-radius:16px;
  padding:0 16px;font-size:14.5px;outline:none;background:#fff;
  box-shadow:0 4px 18px rgba(15,23,42,.06);transition:border-color .2s,box-shadow .2s;
}
.psai-input:focus{border-color:var(--psai-primary,#00563f);box-shadow:0 0 0 4px rgba(0,86,63,.10)}
.psai-input:disabled{opacity:.7}
.psai-send{
  width:50px;height:50px;border:0;border-radius:16px;flex:0 0 auto;
  background:linear-gradient(135deg,var(--psai-primary,#00563f),#03281d);
  color:#fff;font-size:22px;cursor:pointer;
  box-shadow:0 8px 22px rgba(0,86,63,.28);transition:transform .2s,box-shadow .2s;
}
.psai-send:hover{transform:translateY(-1px);box-shadow:0 12px 28px rgba(0,86,63,.35)}
.psai-send:disabled{opacity:.55;cursor:not-allowed;transform:none}
.psai-note{
  margin-top:9px;display:flex;align-items:center;justify-content:space-between;
  gap:10px;color:#64748b;font-size:12px;
}
.psai-note a{color:var(--psai-primary,#00563f);font-weight:700;text-decoration:none}

/* ── Typing animation cursor ──────────────────────────────────── */
.psai-cursor{
  display:inline-block;margin-left:2px;color:var(--psai-primary,#00563f);
  font-weight:800;animation:psaiBlink .65s infinite;
}
@keyframes psaiBlink{50%{opacity:0}}

/* ── Divider ──────────────────────────────────────────────────── */
.psai-divider{
  text-align:center;font-size:11.5px;color:#9ca3af;
  margin:10px 0;position:relative;
}
.psai-divider::before,.psai-divider::after{
  content:'';position:absolute;top:50%;width:38%;height:1px;background:#e5e7eb;
}
.psai-divider::before{left:0}.psai-divider::after{right:0}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════════════ */
@media (min-width:900px){
  .psai-panel{width:440px;right:28px}
  .psai-launcher{right:28px}
}

@media (max-width:640px){
  .psai-launcher{
    right:16px;bottom:16px;padding:10px;border-radius:50%;
    width:70px;height:70px;justify-content:center;
  }
  .psai-launcher b{display:none}
  .psai-launcher img{width:54px;height:54px}
  .psai-panel{
    left:10px;right:10px;bottom:94px;width:auto;
    height:min(78vh,680px);border-radius:22px;
  }
  .psai-chips{grid-template-columns:1fr}
  .psai-chips button:nth-child(n+4){display:none}
  .psai-bubble{font-size:14px;line-height:1.55}
  .psai-head{padding:14px}
  .psai-brand img{width:50px;height:50px}
  .psai-brand h3{font-size:17px}
  .psai-brand p{font-size:12px}
}

@media (max-width:420px){
  .psai-panel{
    left:0;right:0;bottom:0;
    height:100dvh;max-height:100dvh;
    border-radius:22px 22px 0 0;
  }
  .psai-foot{padding-bottom:calc(12px + env(safe-area-inset-bottom))}
  .psai-brand p{display:none}
}

/* ── Scroll-lock when panel open on mobile ───────────────────── */
@media (max-width:640px){
  body.psai-open{overflow:hidden}
}
