/* ══════════════════════════════════════════════════════
   Primărie AI Chatbot — UI premium, stil conversație LLM
   ══════════════════════════════════════════════════════ */
:root {
  --pcb-acc:     #0C447C;
  --pcb-acc2:    #185FA5;
  --pcb-acc-l:   #E6F1FB;
  --pcb-bg:      #ffffff;
  --pcb-bg2:     #f7f9fc;
  --pcb-border:  #e2e8f0;
  --pcb-text:    #1a202c;
  --pcb-text2:   #4a5568;
  --pcb-radius:  16px;
  --pcb-shadow:  0 8px 40px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.08);
}

/* ── LAUNCHER BUTTON ─────────────────────────────── */
#pcb-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--pcb-acc);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99998;
  box-shadow: 0 4px 20px rgba(12,68,124,.35);
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s;
  user-select: none;
}
#pcb-btn:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(12,68,124,.45); }
#pcb-btn.pcb-left { right: auto; left: 24px; }

/* ── CHAT BOX ────────────────────────────────────── */
#pcb-box {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 400px;
  height: 580px;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  background: var(--pcb-bg);
  border-radius: var(--pcb-radius);
  box-shadow: var(--pcb-shadow);
  border: 1px solid var(--pcb-border);
  z-index: 99997;
  overflow: hidden;
  transform: translateY(16px) scale(.96);
  opacity: 0;
  pointer-events: none;
  transition: transform .28s cubic-bezier(.34,1.4,.64,1), opacity .2s;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
#pcb-box.pcb-open { transform: none; opacity: 1; pointer-events: all; }
#pcb-box.pcb-left { right: auto; left: 24px; }

/* ── HEADER ──────────────────────────────────────── */
#pcb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--pcb-acc);
  flex-shrink: 0;
}
#pcb-head-left { display: flex; align-items: center; gap: 11px; }
#pcb-avatar {
  width: 38px; height: 38px;
  background: rgba(255,255,255,.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
#pcb-head-name { font-size: 15px; font-weight: 600; color: #fff; }
#pcb-head-sub  { font-size: 11px; color: rgba(255,255,255,.75); margin-top: 2px; display: flex; align-items: center; gap: 5px; }
#pcb-dot {
  width: 7px; height: 7px;
  background: #68D391;
  border-radius: 50%;
  animation: pcbPulse 2s infinite;
}
@keyframes pcbPulse { 0%,100%{opacity:1}50%{opacity:.5} }
#pcb-head-close {
  background: none; border: none; color: rgba(255,255,255,.7);
  cursor: pointer; padding: 4px; border-radius: 6px; line-height: 1;
  transition: color .15s, background .15s;
}
#pcb-head-close:hover { color: #fff; background: rgba(255,255,255,.15); }

/* ── MESSAGES ────────────────────────────────────── */
#pcb-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--pcb-bg2);
  scroll-behavior: smooth;
}
#pcb-msgs::-webkit-scrollbar { width: 4px; }
#pcb-msgs::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 2px; }

/* ── MESSAGE BUBBLES ─────────────────────────────── */
.pcb-row { display: flex; align-items: flex-end; gap: 8px; animation: pcbIn .22s ease; max-width: 100%; }
.pcb-row-bot { justify-content: flex-start; }
.pcb-row-user { justify-content: flex-end; }
@keyframes pcbIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }

.pcb-bot-icon {
  width: 30px; height: 30px;
  background: var(--pcb-acc);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  margin-bottom: 2px;
}

.pcb-bubble {
  max-width: 84%;
  padding: 11px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}
.pcb-bubble-bot {
  background: var(--pcb-bg);
  color: var(--pcb-text);
  border-bottom-left-radius: 5px;
  border: 1px solid var(--pcb-border);
}
.pcb-bubble-user {
  background: var(--pcb-acc);
  color: #fff;
  border-bottom-right-radius: 5px;
}

/* ── MARKDOWN DENTRO BUBBLE ──────────────────────── */
.pcb-bubble-bot strong, .pcb-bubble-bot b { font-weight: 600; color: var(--pcb-acc); }
.pcb-bubble-user strong, .pcb-bubble-user b { font-weight: 600; color: #fff; }
.pcb-bubble p  { margin: 0 0 8px; }
.pcb-bubble p:last-child { margin-bottom: 0; }
.pcb-bubble ul, .pcb-bubble ol { margin: 6px 0 8px 0; padding-left: 18px; }
.pcb-bubble li { margin-bottom: 4px; }
.pcb-bubble h3 { font-size: 14px; font-weight: 600; color: var(--pcb-acc); margin: 12px 0 6px; }
.pcb-bubble hr { border: none; border-top: 1px solid var(--pcb-border); margin: 10px 0; }
.pcb-bubble a  { color: var(--pcb-acc2); text-decoration: underline; word-break: break-all; }
.pcb-bubble-user a { color: #BEE3F8; }
.pcb-bubble code { font-family: monospace; font-size: 12px; background: var(--pcb-acc-l); color: var(--pcb-acc); padding: 1px 5px; border-radius: 4px; }
.pcb-bubble em { font-style: italic; color: var(--pcb-text2); }

.pcb-meta { font-size: 10px; color: #a0aec0; margin-top: 3px; padding: 0 2px; }
.pcb-row-user .pcb-meta { text-align: right; }

/* ── TYPING INDICATOR ────────────────────────────── */
.pcb-typing-row { display: flex; align-items: center; gap: 8px; animation: pcbIn .2s ease; }
.pcb-typing { display: flex; gap: 5px; padding: 13px 16px; background: var(--pcb-bg); border: 1px solid var(--pcb-border); border-radius: 18px; border-bottom-left-radius: 5px; }
.pcb-typing span { width: 7px; height: 7px; background: #a0aec0; border-radius: 50%; animation: pcbBounce 1.1s infinite; }
.pcb-typing span:nth-child(2) { animation-delay: .18s; }
.pcb-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes pcbBounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-7px)} }

/* ── QUICK CHIPS ─────────────────────────────────── */
#pcb-chips {
  padding: 8px 12px 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--pcb-bg2);
  border-top: 1px solid var(--pcb-border);
  flex-shrink: 0;
}
.pcb-chip {
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid #c5d4e8;
  color: var(--pcb-acc);
  border-radius: 20px;
  cursor: pointer;
  background: var(--pcb-bg);
  transition: all .15s;
  white-space: nowrap;
  font-family: inherit;
}
.pcb-chip:hover { background: var(--pcb-acc); color: #fff; border-color: var(--pcb-acc); }

/* ── INPUT ───────────────────────────────────────── */
#pcb-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--pcb-bg);
  border-top: 1px solid var(--pcb-border);
  flex-shrink: 0;
}
#pcb-input {
  flex: 1;
  border: 1.5px solid var(--pcb-border);
  border-radius: 22px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--pcb-text);
  background: var(--pcb-bg2);
  outline: none;
  transition: border-color .15s;
  font-family: inherit;
}
#pcb-input:focus { border-color: var(--pcb-acc); background: var(--pcb-bg); }
#pcb-input::placeholder { color: #a0aec0; }
#pcb-send {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--pcb-acc);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
  transition: opacity .15s, transform .15s;
}
#pcb-send:hover { opacity: .88; transform: scale(1.05); }
#pcb-send:disabled { opacity: .4; cursor: default; transform: none; }

/* ── MOBILE ──────────────────────────────────────── */
@media (max-width: 460px) {
  #pcb-box { width: calc(100vw - 16px); right: 8px; left: 8px; bottom: 80px; border-radius: 14px; }
  #pcb-btn { bottom: 16px; right: 16px; }
  #pcb-box.pcb-left { left: 8px; right: 8px; }
}
