/* --- ROOT / RESET ÎN WIDGET --- */
#bp-ai-widget{
  position:fixed;
  bottom:20px;
  right:20px;
  z-index:999999;
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
}
#bp-ai-widget *, #bp-ai-widget *::before, #bp-ai-widget *::after {
  box-sizing: border-box;
  font-family: inherit;
}

/* --- FAB BUTON PLUTITOR (PULSE) --- */
#bp-ai-fab{
  width:78px;
  height:78px;
  border:0;
  background:radial-gradient(circle at 30% 30%, #ffe6c4 0, #ff7a00 40%, #c44b00 100%);
  padding:3px;
  border-radius:999px;
  cursor:pointer;
  box-shadow:0 20px 60px rgba(0,0,0,.85);
  display:flex;
  align-items:center;
  justify-content:center;
  animation:bp-ai-pulse 2.4s infinite;
  transition: transform 0.2s;
}
#bp-ai-fab:hover { transform: scale(1.05); }
#bp-ai-fab img{
  width:70px;
  height:70px;
  border-radius:999px;
  display:block;
  object-fit:cover;
}

/* --- PANEL CHAT --- */
#bp-ai-panel{
  width:390px;
  max-width:92vw;
  background:#050608;
  color:#f5f7fb;
  border-radius:20px;
  box-shadow:0 28px 80px rgba(0,0,0,.95);
  overflow:hidden;
  border:1px solid rgba(255,122,0,.7);
  display: flex;
  flex-direction: column;
}

/* HEADER */
#bp-ai-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px 14px;
  background:linear-gradient(135deg,#ffb000 0,#ff7a00 40%,#ff3b00 100%);
  color:#111;
}
.bp-ai-head-left{ display:flex; align-items:center; gap:10px; }
#bp-ai-avatar{
  width:40px; height:40px; border-radius:999px;
  border:2px solid rgba(0,0,0,.35); background:#0b0c0e; object-fit:cover;
}
.bp-ai-head-meta{ display:flex; flex-direction:column; line-height:1.1; }
#bp-ai-agent-name{ font-weight:900; text-transform:uppercase; font-size:14px; }
.bp-ai-head-sub{ font-size:11px; opacity:.9; }
.bp-ai-head-actions{ display:flex; align-items:center; gap:8px; }

/* Butonul din Header (fostul Offer, acum Programare/Info) */
.bp-ai-offer-btn{
  border:0; background:#111; color:#ffb000; padding:7px 12px;
  border-radius:999px; font-weight:800; font-size:12px; cursor:pointer;
  text-transform:uppercase; letter-spacing:.05em;
}
.bp-ai-offer-btn:hover{ background:#fff; color:#111; }

#bp-ai-close{
  border:0; background:transparent; font-size:22px; line-height:1;
  cursor:pointer; color:#111;
}

/* BODY + MESAJE */
#bp-ai-body{ padding:10px 10px 12px; }
#bp-ai-messages{
  height:350px; /* Putin mai inalt pentru medical */
  overflow-y:auto;
  padding:6px 2px;
  scroll-behavior: smooth;
}
.bp-ai-msg{ display:flex; margin:7px 0; }
.bp-ai-msg.user{ justify-content:flex-end; }
.bp-ai-bub{
  max-width:86%; padding:10px 13px; border-radius:16px;
  line-height:1.4; background:#121417; border:1px solid #1e2228; font-size:14px;
}
/* User Bubble Style */
.bp-ai-msg.user .bp-ai-bub{
  background:linear-gradient(135deg,#ffb000,#ff7a00);
  border-color:#ffb000; color:#111; font-weight:600;
}

/* --- MEDICAL ALERTS (NOU PENTRU TRIAJ) --- */
.bp-ai-alert-red {
    border: 2px solid #dc2626 !important;
    background: #450a0a !important; /* Dark Red background */
    color: #fecaca !important;
    font-weight: bold;
}
.bp-ai-alert-yellow {
    border: 1px solid #ca8a04 !important;
    background: #422006 !important; /* Dark Yellow/Brown */
    color: #fef08a !important;
}
.bp-ai-action-btn {
    display: block; width: 100%; margin-top: 8px;
    background: #2563eb; color: #fff; text-align: center;
    padding: 8px; border-radius: 8px; text-decoration: none; font-weight: bold;
    border: none; cursor: pointer;
}
.bp-ai-action-btn:hover { background: #1d4ed8; }

/* INPUT ROW */
#bp-ai-row{ display:flex; gap:8px; margin-top:8px; }
#bp-ai-input{
  flex:1; padding:12px; border-radius:12px;
  border:1px solid #2a2f36; background:#0b0c0e; color:#f5f7fb;
  font-size:14px; outline:none;
}
#bp-ai-input:focus{ border-color:#ff7a00; box-shadow:0 0 0 1px rgba(255,122,0,.6); }
#bp-ai-send{
  padding:0 20px; border-radius:12px; border:0;
  background:linear-gradient(135deg,#ffb000,#ff7a00);
  color:#111; font-weight:900; cursor:pointer;
  display: flex; align-items: center; justify-content: center;
}
#bp-ai-send:hover{ filter:brightness(1.1); }
#bp-ai-send:disabled { filter: grayscale(1); cursor: not-allowed; opacity: 0.7; }

/* MODAL (Păstrat pentru colectare date pacient) */
#bp-ai-offer-modal{
  position:fixed; inset:0; background:rgba(0,0,0,.65);
  display:flex; align-items:center; justify-content:center; z-index:1000000;
}
.bp-ai-offer-card{
  width:min(520px,92vw); background:#121417;
  border:1px solid #ff7a00; border-radius:18px;
  padding:20px; color:#f5f7fb; box-shadow:0 24px 80px rgba(0,0,0,.9);
}
.bp-ai-offer-title{
  font-weight:900; margin-bottom:15px; text-transform:uppercase; letter-spacing:.04em; font-size: 16px;
}
#bp-ai-offer-modal input, #bp-ai-offer-modal textarea{
  width:100%; margin:8px 0; padding:12px;
  border-radius:12px; border:1px solid #2a2f36;
  background:#0b0c0e; color:#f5f7fb; font-size:14px;
}
#bp-ai-offer-modal input:focus, #bp-ai-offer-modal textarea:focus{
  border-color:#ff7a00; outline:none;
}
.bp-ai-offer-actions{ display:flex; gap:10px; margin-top:15px; }
#bp-ai-offer-send{
  flex:1; padding:12px; border-radius:12px; border:0;
  background:linear-gradient(135deg,#ffb000,#ff7a00);
  color:#111; font-weight:900; cursor:pointer; text-transform:uppercase;
}
#bp-ai-offer-close{
  padding:12px 20px; border-radius:12px; border:1px solid #2a2f36;
  background:transparent; color:#f5f7fb; font-weight:800; cursor:pointer;
}

/* ANIMATIONS */
@keyframes bp-ai-pulse{
  0%{ box-shadow:0 0 0 0 rgba(255,122,0,.7);}
  70%{ box-shadow:0 0 0 20px rgba(255,122,0,0);}
  100%{ box-shadow:0 0 0 0 rgba(255,122,0,0);}
}

/* Typing Indicator (Dots) */
.bp-ai-typing span {
    display: inline-block; width: 6px; height: 6px;
    background-color: #ffb000; border-radius: 50%;
    animation: bp-typing 1.4s infinite ease-in-out both; margin: 0 2px;
}
.bp-ai-typing span:nth-child(1) { animation-delay: -0.32s; }
.bp-ai-typing span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bp-typing { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

@media (max-width:480px){
  #bp-ai-panel{width:92vw; bottom: 10px; right: 4vw;}
  #bp-ai-messages{height:60vh;}
  #bp-ai-fab{ width:60px; height:60px; }
  #bp-ai-fab img{ width:50px; height:50px; }
}