/* ===================================================================
   KiwiCoats Chatbot - Restored attractive style
   This restores the older look while supporting the new pcb- classes.
   =================================================================== */

/* -------------------------------
   Shared variables
---------------------------------- */
:root {
  --chat-blue-1: #238af5;
  --chat-blue-2: #1b79d9;
  --bg-soft: #f4f7fb;
  --card-white: #ffffff;
  --muted: #6b7280;
  --shadow-strong: 0 16px 40px rgba(0,0,0,0.20);
}

/* ------------------------------------------------------------------
   Support both old painting-ai-* and new pcb-* class names
   (keeps visual look consistent regardless which is present)
   ------------------------------------------------------------------ */

/* LAUNCHER (floating round button) */
#painting-ai-launcher,
.pcb-launcher,
.painting-ai-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(180deg,var(--chat-blue-1),var(--chat-blue-2));
  box-shadow: 0 8px 20px rgba(0,0,0,0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99999;
  color: #fff;
  font-size: 24px;
  transition: transform .12s ease;
}
#painting-ai-launcher:hover,
.pcb-launcher:hover,
.painting-ai-launcher:hover {
  transform: scale(1.06);
}

/* WIDGET BASE */
#painting-ai-widget,
.pcb-widget,
.painting-ai-widget {
  position: fixed;
  right: 24px;
  bottom: 96px;
  width: 340px;
  max-width: 92vw;
  height: 460px;
  max-height: 80vh;
  background: var(--card-white);
  border-radius: 18px;
  box-shadow: var(--shadow-strong);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99998;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(.2,.8,.2,1);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
#painting-ai-widget.open,
.pcb-widget.open,
.painting-ai-widget.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* HEADER */
.painting-ai-header,
.pcb-header,
#painting-ai-widget .pcb-header {
  background: linear-gradient(180deg,var(--chat-blue-1),var(--chat-blue-2));
  color: #fff;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.painting-ai-avatar,
.pcb-avatar,
#painting-ai-widget .pcb-avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  font-size:16px;
}
.painting-ai-header-text,
.pcb-header-text,
#painting-ai-widget .pcb-header-text {
  flex: 1;
}
.painting-ai-header-title,
.pcb-title,
#painting-ai-widget .pcb-title {
  font-size: 16px;
  font-weight:700;
}
.painting-ai-header-subtitle,
.pcb-subtitle,
#painting-ai-widget .pcb-subtitle {
  font-size: 13px;
  opacity: .95;
}

/* header close */
.painting-ai-close,
.pcb-close,
#painting-ai-widget .pcb-close {
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 6px 18px rgba(11,22,55,0.08);
}

/* BODY */
.painting-ai-body,
.pcb-body,
#painting-ai-widget .pcb-body {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  background: var(--bg-soft);
  -webkit-overflow-scrolling: touch;
}
.painting-ai-message,
.pcb-message,
#painting-ai-widget .pcb-message {
  max-width: 90%;
  margin-bottom: 10px;
  display:flex;
}
.painting-ai-message-bot,
.pcb-bot,
#painting-ai-widget .pcb-bot { justify-content: flex-start; }
.painting-ai-message-user,
.pcb-user,
#painting-ai-widget .pcb-user { justify-content: flex-end; }

.painting-ai-message-text,
.pcb-text,
#painting-ai-widget .pcb-text {
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
  background: #fff;
  color: #222;
  box-shadow: 0 6px 18px rgba(11,22,55,0.06);
  word-break: break-word;
  max-width: 100%;
}
.pcb-user .pcb-text,
.painting-ai-message-user .painting-ai-message-text {
  background: linear-gradient(180deg,var(--chat-blue-1),var(--chat-blue-2));
  color: #fff;
}

/* INLINE BUTTONS (old attractive look) */
.pcb-btn-wrap,
.painting-ai-btn-wrap {
  margin-top: 10px;
  display:flex;
  flex-direction: column;
  gap: 10px;
}
.pcb-btn,
.painting-ai-btn,
#painting-ai-widget .painting-ai-btn {
  padding: 10px 14px;
  font-size: 14px;
  border-radius: 10px;
  background: linear-gradient(180deg,#2b9af3,#1f7fd8);
  color: #fff;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: 0.16s ease;
  display:block;
  width:100%;
  box-shadow: 0 4px 12px rgba(28,80,140,0.15);
}
.pcb-btn:hover,
.painting-ai-btn:hover {
  filter: brightness(1.07);
}

/* CTA color variants */
.call-btn { background: linear-gradient(180deg,#28c76f,#1fa85a); }
.mail-btn { background: linear-gradient(180deg,#ff9f43,#ff8c2f); }

/* ensure button text is visible even if theme injects icons */
.pcb-btn, .painting-ai-btn, .pcb-btn * {
  text-indent: 0;
  overflow: visible;
  white-space: normal;
}

/* FOOTER (input) */
.painting-ai-footer,
.pcb-footer,
#painting-ai-widget .pcb-footer {
  padding: 8px;
  border-top: 1px solid #e6ebf5;
  display:flex;
  gap:6px;
  align-items:center;
  background:#fff;
}
.painting-ai-input,
.pcb-input,
#pcb-input {
  flex: 1;
  border-radius: 999px;
  border:1px solid #d6dbe6;
  padding:8px 12px;
  font-size:14px;
}
.painting-ai-send,
.pcb-send,
#pcb-send {
  border-radius: 999px;
  border:none;
  padding:0 14px;
  background: linear-gradient(180deg,#2b9af3,#1f7fd8);
  color:#fff;
  font-size:18px;
  width:44px;
  height:44px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow: 0 6px 16px rgba(20,70,130,0.18);
}

/* Typing indicator */
.painting-ai-typing,
.pcb-typing,
#pcb-typing {
  font-size:12px;
  color:var(--muted);
  margin-bottom:8px;
  margin-left:4px;
}

/* Modal (WPForms) - modest, non-intrusive */
.pcb-form-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 999999;
  align-items: center;
  justify-content: center;
}
.pcb-form-modal.open { display:flex; }
.pcb-form-overlay {
  position:absolute;
  inset:0;
  background: rgba(11,22,55,0.55);
}
.pcb-form-panel {
  position:relative;
  width:92%;
  max-width:720px;
  max-height:86vh;
  background:#fff;
  border-radius:12px;
  padding:18px;
  overflow-y:auto;
  box-shadow: 0 18px 60px rgba(10,30,60,0.45);
}
.pcb-form-close {
  position:absolute;
  right:10px;
  top:10px;
  width:40px;
  height:40px;
  border-radius:8px;
  background: rgba(0,0,0,0.06);
  border:none;
  font-size:20px;
  cursor:pointer;
}
.pcb-form-inner .wpforms-field-container {
  display:flex;
  flex-direction:column;
  gap:16px;
}

/* WPForms fields inside modal (attractive styling) */
.pcb-form-inner .wpforms-field {
  width:100%;
}
.pcb-form-inner .wpforms-field-label {
  font-size:14px;
  font-weight:600;
  margin-bottom:6px;
}
.pcb-form-inner input[type="text"],
.pcb-form-inner input[type="email"],
.pcb-form-inner textarea {
  width:100%;
  padding:10px 14px;
  border-radius:8px;
  border:1px solid #ced4da;
  font-size:14px;
  box-sizing:border-box;
}
.pcb-form-inner textarea { min-height:110px; resize:vertical; }
.pcb-form-inner .wpforms-submit {
  background: linear-gradient(180deg,#2b9af3,#1f7fd8);
  color:#fff;
  padding:12px 18px;
  border-radius:10px;
  border:none;
  font-weight:600;
  width:100%;
  cursor:pointer;
  box-shadow: 0 6px 16px rgba(28,80,140,0.14);
}

/* Hide honeypot */
.pcb-form-inner #wpforms-506-field_5-container { display:none !important; }

/* Accessibility focus */
.pcb-input:focus, .pcb-send:focus, .pcb-close:focus, .pcb-form-close:focus {
  outline: 3px solid rgba(35,138,245,0.14);
  outline-offset: 2px;
}

/* Mobile responsive tweaks */
@media (max-width: 480px) {
  #painting-ai-widget, .pcb-widget, .painting-ai-widget {
    right: 12px !important;
    left: 12px !important;
    width: auto;
    bottom: 92px;
    height: 70vh;
  }
  .pcb-form-panel { max-width: 92%; padding:12px; }
  .pcb-btn { font-size: 13px; padding: 10px 12px; }
}

/* Minimal safeguard to prevent theme icon-only replacement (only for chatbot) */
/* This is intentionally conservative (not heavy !important usage). */
#painting-ai-widget .pcb-btn,
#painting-ai-widget .pcb-btn * {
  text-indent: 0;
  overflow: visible;
  white-space: normal;
}

/* final small spacing fix if some themes inject icon-only elements */
#painting-ai-widget .pcb-btn i,
#painting-ai-widget .pcb-btn svg,
#painting-ai-widget .pcb-btn .icon { display: none; }


/* --- FIX SEND BUTTON NOT CENTERED --- */
#painting-ai-widget .pcb-footer {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

#painting-ai-widget .pcb-input {
    height: 44px !important;
    line-height: 44px !important;
    padding: 0 14px !important;
    display: flex !important;
    align-items: center !important;
}

#painting-ai-widget .pcb-send {
    height: 44px !important;
    width: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    transform: translateY(0) !important;
}

#painting-ai-widget .pcb-footer * {
    vertical-align: middle !important;
}

