/* Particulari.ro — Chatbox beta */
#pcb-root {
  --pcb-primary: #4ad373;
  --pcb-primary-dark: #2eb85c;
  --pcb-teal: #1ea59a;
  --pcb-bot-bg: #ffffff;
  --pcb-bot-text: #1a202c;
  --pcb-user-bg: linear-gradient(135deg, #4ad373 0%, #1ea59a 100%);
  --pcb-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-family: var(--pcb-font);
  font-size: 14px;
  line-height: 1.5;
  z-index: 2147483000;
  position: fixed;
  bottom: 20px;
  right: 20px;
}

#pcb-bubble {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  filter: drop-shadow(0 8px 24px rgba(30, 165, 154, 0.35));
}

#pcb-bubble-text {
  background: #fff;
  color: #1a202c;
  padding: 10px 16px;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
  font-weight: 600;
  font-size: 13px;
  max-width: 160px;
  border: 1px solid rgba(74, 211, 115, 0.35);
  animation: pcb-float 3s ease-in-out infinite;
}

@keyframes pcb-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

#pcb-bubble-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: #fff;
  box-shadow: 0 8px 28px rgba(74, 211, 115, .5), inset 0 0 0 1px rgba(74, 211, 115, .12);
  cursor: pointer;
  padding: 5px;
  overflow: hidden;
  flex-shrink: 0;
  transition: transform .2s ease;
}

#pcb-bubble-btn:hover { transform: scale(1.06); }

#pcb-bubble-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  border-radius: 50%;
}

#pcb-panel {
  display: none;
  flex-direction: column;
  width: 400px;
  max-width: calc(100vw - 24px);
  height: 560px;
  max-height: calc(100vh - 90px);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2), 0 0 0 1px rgba(74,211,115,.15);
  overflow: hidden;
  animation: pcb-panel-in .25s ease;
}

@keyframes pcb-panel-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: none; }
}

#pcb-root.pcb-open #pcb-panel { display: flex; }
#pcb-root.pcb-open #pcb-bubble { display: none; }

#pcb-header {
  background: linear-gradient(135deg, #4ad373 0%, #1ea59a 100%);
  color: #fff;
  padding: 16px 16px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

#pcb-header::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,.12);
  border-radius: 50%;
}

#pcb-header-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  padding: 5px;
  box-sizing: border-box;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

#pcb-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  border-radius: 50%;
  display: block;
}

#pcb-header-text {
  position: relative;
  z-index: 1;
  min-width: 0;
}

#pcb-header-text h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.02em;
}

#pcb-header-text p {
  margin: 3px 0 0;
  font-size: 12px;
  opacity: .95;
}

#pcb-close {
  margin-left: auto;
  background: rgba(255,255,255,.2);
  border: none;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

#pcb-close:hover { background: rgba(255,255,255,.35); }

#pcb-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: linear-gradient(180deg, #f8fafb 0%, #f1f5f4 100%);
  overflow-anchor: none;
}

.pcb-msg {
  max-width: 85%;
  margin-bottom: 12px;
  padding: 11px 14px;
  border-radius: 16px;
  word-wrap: break-word;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.pcb-msg-bot {
  background: var(--pcb-bot-bg);
  color: var(--pcb-bot-text);
  border-bottom-left-radius: 4px;
  margin-right: auto;
  border: 1px solid #e8ecf0;
}

.pcb-msg-user {
  background: var(--pcb-user-bg);
  color: #fff;
  border-bottom-right-radius: 4px;
  margin-left: auto;
  border: none;
}

.pcb-msg-opening {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0 0 8px;
  max-width: 100%;
  color: #475569;
  font-size: 14px;
  font-weight: 500;
}

#pcb-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.pcb-suggestion-headline {
  flex: 0 0 100%;
  width: 100%;
  margin: 4px 0 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #64748b;
}

.pcb-suggestion-headline:first-child {
  margin-top: 0;
}

.pcb-msg-opening-extra {
  font-size: 13px;
  color: #4a5568;
  line-height: 1.45;
}

.pcb-msg-flow-arrival {
  border-left: 3px solid var(--pcb-primary);
  padding-left: 10px;
}

.pcb-suggestion-btn {
  background: #fff;
  border: 1px solid #c8e6c9;
  color: #1a5c4a;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
  line-height: 1.3;
  text-align: left;
}

.pcb-suggestion-btn:hover {
  background: #e8f8ef;
  border-color: var(--pcb-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(74,211,115,.25);
}

#pcb-suggestions.pcb-suggestions-followup {
  gap: 6px;
  margin-top: 4px;
}

.pcb-suggestion-followup {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 14px;
  border-color: #e0e0e0;
  color: #444;
}

.pcb-suggestion-followup:hover {
  background: #f5f5f5;
  border-color: #bdbdbd;
  box-shadow: none;
  transform: none;
}

.pcb-msg-typing {
  display: inline-flex;
  gap: 4px;
  padding: 12px 16px;
}

.pcb-msg-typing span {
  width: 7px;
  height: 7px;
  background: #94a3b8;
  border-radius: 50%;
  animation: pcb-dot 1.2s infinite;
}

.pcb-msg-typing span:nth-child(2) { animation-delay: .15s; }
.pcb-msg-typing span:nth-child(3) { animation-delay: .3s; }

@keyframes pcb-dot {
  0%, 80%, 100% { opacity: .3; transform: scale(.85); }
  40% { opacity: 1; transform: scale(1); }
}

.pcb-init-status {
  color: #64748b;
  font-size: 14px;
  font-style: italic;
}

#pcb-root.pcb-init-loading #pcb-send,
#pcb-root.pcb-init-loading #pcb-mic,
#pcb-root.pcb-init-loading #pcb-input {
  opacity: 0.55;
  pointer-events: none;
}

#pcb-footer {
  border-top: 1px solid #e8ecf0;
  padding: 12px 14px 10px;
  background: #fff;
  flex-shrink: 0;
}

#pcb-form {
  display: flex;
  gap: 6px;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 28px;
  padding: 4px 4px 4px 6px;
}

#pcb-form:focus-within {
  border-color: var(--pcb-primary);
  box-shadow: 0 0 0 3px rgba(74,211,115,.15);
}

#pcb-mic {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}

#pcb-mic:hover { color: var(--pcb-teal); background: #eef2f6; }
#pcb-mic.pcb-mic-active {
  background: #fef2f2;
  color: #dc2626;
  animation: pcb-mic-pulse 1s ease-in-out infinite;
}

@keyframes pcb-mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}

#pcb-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 8px 4px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

#pcb-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #4ad373, #1ea59a);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(74,211,115,.4);
}

#pcb-send:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
#pcb-send:hover:not(:disabled) { filter: brightness(1.05); }

.pcb-highlight-ring {
  outline: 3px solid #4ad373 !important;
  outline-offset: 3px !important;
  animation: pcb-ring 1.5s ease-in-out 3;
}

@keyframes pcb-ring {
  0%, 100% { outline-color: #4ad373; }
  50% { outline-color: #1ea59a; }
}

@media (max-width: 600px) {
  #pcb-root {
    bottom: 12px;
    right: 12px;
  }

  #pcb-bubble-btn { width: 56px; height: 56px; }

  /* Doar când chatul e deschis ocupă tot ecranul, edge-to-edge */
  #pcb-root.pcb-open {
    inset: 0;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    z-index: 2147483647;
  }

  #pcb-root.pcb-open #pcb-panel {
    display: flex;
    width: 100vw;
    width: 100%;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
}
