/* --- ROOT / RESET ÎN WIDGET --- */
#bp-ai-widget{
  position:fixed;
  bottom:60px;
  right:20px;
	left:auto;
  z-index:999999;
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;

  /* BLUE THEME (din icon) */
  --bp-accent-1:#09d7fc; /* light cyan */
  --bp-accent-2:#00cefe; /* cyan */
  --bp-accent-3:#4b68bd; /* blue */
  --bp-accent-4:#022381; /* deep navy */
  --bp-accent-rgb:0,206,254; /* for rgba() */
}
#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%, #cfd6e3 0, var(--bp-accent-2) 40%, var(--bp-accent-4) 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(var(--bp-accent-rgb),.75);
  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, var(--bp-accent-2) 0, var(--bp-accent-3) 40%, var(--bp-accent-4) 100%);
  color:#fff;
}
.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:var(--bp-accent-2); 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:#fff;
}

/* 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, var(--bp-accent-2), var(--bp-accent-3));
  border-color:var(--bp-accent-2);
  color:#071018;
  font-weight:700;
}

/* --- 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:var(--bp-accent-2);
  box-shadow:0 0 0 1px rgba(var(--bp-accent-rgb),.6);
}
#bp-ai-send{
  padding:0 20px; border-radius:12px; border:0;
  background:linear-gradient(135deg, var(--bp-accent-2), var(--bp-accent-3));
  color:#071018; 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 var(--bp-accent-2); 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:var(--bp-accent-2); 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, var(--bp-accent-2), var(--bp-accent-3));
  color:#071018; 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(var(--bp-accent-rgb),.65);}
  70%{ box-shadow:0 0 0 20px rgba(var(--bp-accent-rgb),0);}
  100%{ box-shadow:0 0 0 0 rgba(var(--bp-accent-rgb),0);}
}

/* Typing Indicator (Dots) */
.bp-ai-typing span {
    display: inline-block; width: 6px; height: 6px;
    background-color: var(--bp-accent-2);
    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){

  /* mută widgetul puțin mai sus dacă vrei (opțional) */
  #bp-ai-widget{
    bottom: 80px; /* ridică peste bottom menu */
    right: 12px;
    left: auto;
  }

  /* panel mai mic pe înălțime */
  #bp-ai-panel{
    width: 92vw;
    max-height: 82vh;          /* 👈 CHEIA: limitează înălțimea panelului */
    border-radius: 18px;
  }

  /* body devine flex ca să “taie” corect */
  #bp-ai-body{
    display:flex;
    flex-direction:column;
    min-height: 0;             /* 👈 important pt overflow în flex */
  }

  /* mesaje: ocupă ce rămâne, dar cu scroll */
  #bp-ai-messages{
    flex: 1 1 auto;
    height: auto;              /* nu mai forța 60vh */
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* input row rămâne jos */
  #bp-ai-row{
    flex: 0 0 auto;
  }

  /* fab mai mic */
  #bp-ai-fab{
    width: 56px;
    height: 56px;
  }
  #bp-ai-fab img{
    width: 48px;
    height: 48px;
  }
}

