
:root{
  --aibot-primary:#6d5efc;            /* fallback default */
  --aibot-secondary:#9a7bff;          /* fallback default */
  --aibot-primary-grad: linear-gradient(135deg, var(--aibot-primary), var(--aibot-secondary));

     --aibot-bg:#ffffff;
    --aibot-panel:#ffffff;
    --aibot-text:#0b0c14;
    --aibot-muted:rgba(11,12,20,.65);
    --aibot-border:rgba(11,12,20,.12);

  --aibot-shadow: 0 24px 70px rgba(0,0,0,.55);
  --aibot-radius:18px;
  --aibot-font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
}


/* ===== FORCE WIDGET TO FLOAT (THEME OVERRIDE SHIELD) ===== */
#aibot-root,
#aibot-root *{
  box-sizing:border-box !important;
}

#aibot-root{
  position:fixed !important;
  right:18px !important;
  bottom:18px !important;
  z-index:2147483647 !important;
  width:auto !important;
  max-width:none !important;
  font-family:var(--aibot-font) !important;
}

/* Button */
#aibot-btn{
  display:inline-flex !important;
  align-items:center;
  gap:10px;
  width:auto !important;
  max-width:none !important;

 background: var(--aibot-panel);
  color:white;
  border:0;
  border-radius:999px;
  padding:12px 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  cursor:pointer;
  transition: transform .15s ease, filter .15s ease;
}
#aibot-btn:hover{ transform: translateY(-1px); filter:brightness(1.04); }
#aibot-btn:active{ transform: translateY(0px); filter:brightness(.98); }

#aibot-btn img{
  width:22px;
  height:22px;
  border-radius:999px;
  object-fit:cover;
 background: var(--aibot-primary-grad);
}
#aibot-btn span{
  font-weight:700;
  font-size:14px;
  letter-spacing:.2px;
}

/* Panel */
#aibot-panel{
  width:380px;
  max-width:calc(100vw - 32px);  /* ✅ better mobile spacing */
  height:580px;
  max-height:calc(100vh - 100px); /* ✅ leave room for button */

  background: var(--aibot-primary-grad);
  border:1px solid var(--aibot-border);
  border-radius: var(--aibot-radius);
  box-shadow: var(--aibot-shadow);
  overflow:hidden;

  position:fixed !important;
  right:18px !important;
  bottom:78px !important;
  left:auto !important;
  top:auto !important;
  margin:0 !important;

  display:none;
}
#aibot-panel.open{ display:flex; flex-direction:column; }

/* Header */
#aibot-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 14px 12px;

  background:
    radial-gradient(1000px 220px at 20% -30%,
      color-mix(in srgb, var(--aibot-primary) 55%, transparent),
      transparent 60%);
  border-bottom:1px solid var(--aibot-border);
}

#aibot-title{ display:flex; align-items:center; gap:10px; }
#aibot-title img{
  width:28px;
  height:28px;
  border-radius:10px;
  object-fit:cover;
  background:rgba(255,255,255,.12);
}
#aibot-title .t1{
  color:var(--aibot-text);
  font-weight:800;
  font-size:14px;
  line-height:1;
}
#aibot-title .t2{
  color:var(--aibot-muted);
  font-size:12px;
  margin-top:2px;
}

/* Close */
#aibot-close{
  border:1px solid var(--aibot-border);
  background:rgba(255,255,255,.06);
  color:var(--aibot-text);
  width:34px;
  height:34px;
  border-radius:12px;
  cursor:pointer;
}

/* Messages */
#aibot-messages{
  flex:1;
  padding:14px;
  overflow-y:auto; /* ✅ scroll here */
  overflow-x:hidden;
  min-height:0; /* ✅ CRITICAL */
}
.aibot-bubble{
  max-width: 86%;
  padding:10px 12px;
  border-radius: 14px;
  margin: 10px 0;
  font-size: 13px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.aibot-user{
  margin-left:auto;
  background: color-mix(in srgb, var(--aibot-primary) 22%, transparent);
  border:1px solid color-mix(in srgb, var(--aibot-primary) 35%, transparent);
  color:var(--aibot-text);
}
.aibot-bot{
  background: #f4f6ff;
  border:1px solid rgba(11,12,20,.10);
  color: var(--aibot-text);
}

.aibot-user{
  background: color-mix(in srgb, var(--aibot-primary) 14%, #ffffff);
  border:1px solid color-mix(in srgb, var(--aibot-primary) 30%, transparent);
  color: var(--aibot-text);
}


/* Typing */
#aibot-typing{
  display:none;
  color:var(--aibot-muted);
  font-size:12px;
  padding: 0 14px 10px;
}
#aibot-typing.show{ display:block; }

/* Footer */
#aibot-footer{
  background:#fff;
  padding:12px;
  flex-shrink:0; /* ✅ CRITICAL - stay at bottom */
}

#aibot-form{
  display:flex;
  gap:10px;
  align-items:flex-end;   /* ✅ buttons stay at bottom */
}

#aibot-input{
  flex:1;
  width:100%;
  height:44px;              /* ✅ fixed */
  max-height:44px;          /* ✅ fixed */
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(11,12,20,.12);
  background:#fff;
  color:#0b0c14;
  font-size:14px;
  line-height:1.35;

  resize:none;              /* ✅ no drag resize */
  overflow-y:auto;          /* ✅ scroll INSIDE (no grow) */
  overflow-x:hidden;
  white-space:pre-wrap;     /* ✅ wrap to next line */
  word-break:break-word;    /* ✅ break long words */
}


/* HOSTINGER-LIKE SEND BUTTON (round arrow) */
#aibot-send{
  width:44px;
  height:44px;
  border-radius:999px;        /* ✅ circle */
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;

  background: var(--aibot-primary-grad);
  color:#fff;
  border:0;
  cursor:pointer;

  font-size:0;                /* ✅ hide "Send" text */
}

/* arrow icon size */
#aibot-send svg{
  width:18px;
  height:18px;
}


/* Quick Actions (if you use it later) */
#aibot-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  padding:10px 12px 0;
}
.aibot-action{
  border:1px solid var(--aibot-border);
  background:rgba(255,255,255,.05);
  color:var(--aibot-text);
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  cursor:pointer;
  text-decoration:none;
}

/* Lead form */
#aibot-lead{
  display:none;
  margin-top:10px;
  border-top:1px dashed var(--aibot-border);
  padding-top:10px;
}
#aibot-lead.show{ display:block; }

#aibot-lead input,
#aibot-lead textarea{
  width:100%;
  border:1px solid var(--aibot-border);
  background: rgba(255,255,255,.05);
  color:var(--aibot-text);
  border-radius: 12px;
  padding:8px 10px;
  font-size: 12px;
  outline:none;
}
#aibot-lead textarea{ min-height:70px; resize:vertical; }

#aibot-lead button{
  width:100%;
  border:0;
  border-radius: 12px;
  padding:10px 12px;
  font-weight:800;
  cursor:pointer;
  background: rgba(255,255,255,.10);
  color:var(--aibot-text);
}
#aibot-lead button.primary{
  background: var(--aibot-primary-grad);
  color:white;
}

/* WhatsApp Button in Chat */
.aibot-btn-wrapper{
  margin-top:12px;
  display:flex;
}

.aibot-whatsapp-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 16px;
  border-radius:12px;
  background: linear-gradient(135deg, #25D366, #128C7E); /* WhatsApp green */
  color:#ffffff !important;
  text-decoration:none;
  font-weight:700;
  font-size:13px;
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
  border:0;
}

.aibot-whatsapp-btn:hover{
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
}

.aibot-whatsapp-btn:active{
  transform: translateY(0px);
}

/* Make sure it looks good in bot bubbles */
.aibot-bot .aibot-btn-wrapper{
  margin-top:10px;
}


/* Mobile */
@media (max-width: 420px){
  #aibot-root{
    right:12px !important;
    bottom:12px !important;
  }
  
  #aibot-panel{
    width:calc(100vw - 24px) !important;
    max-width:calc(100vw - 24px) !important;
    height:calc(100vh - 80px) !important;
    max-height:calc(100vh - 80px) !important;
    right:12px !important;
    bottom:70px !important;
  }
  
  #aibot-messages{
    padding:12px !important;
  }
  
  .aibot-bubble{
    max-width:90% !important;
    font-size:12px !important;
  }
  
  #aibot-footer{
    padding:10px !important;
  }
  
  #aibot-input{
    height:40px !important;
    max-height:40px !important;
    font-size:13px !important;
  }
  
  #aibot-send,
  #aibot-mic{
    width:40px !important;
    height:40px !important;
  }

}
/* ChatGPT-style mic button */
#aibot-mic{
  width:44px;
  height:44px;
  display:inline-flex;
  align-items:center;
  justify-content:center;

  border-radius:14px; /* ChatGPT-ish rounded square */
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);

  cursor:pointer;
  transition: transform .12s ease, filter .12s ease, background .12s ease, border-color .12s ease;
  padding:0;
}

#aibot-mic:hover{
  filter: brightness(1.08);
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.18);
}

#aibot-mic:active{
  transform: translateY(0px) scale(.98);
}

#aibot-mic:disabled{
  opacity:.6;
  cursor:not-allowed;
}

/* Icon sizing */
#aibot-mic .aibot-mic-ico{
  width:18px;
  height:18px;
}

/* Listening state (glow + pulse ring) */
#aibot-mic.listening{
  background: var(--aibot-primary-grad);
  border-color: color-mix(in srgb, var(--aibot-primary) 55%, rgba(255,255,255,.12));
  box-shadow: 0 10px 26px rgba(0,0,0,.28);
  position: relative;
}

/* Pulse ring */
#aibot-mic.listening::after{
  content:"";
  position:absolute;
  inset:-6px;
  border-radius:16px;
  border:1px solid color-mix(in srgb, var(--aibot-primary) 55%, transparent);
  opacity:.6;
  animation: aibotMicPulse 1.2s ease-out infinite;
  pointer-events:none;
}

@keyframes aibotMicPulse{
  0%{ transform: scale(.92); opacity:.75; }
  70%{ transform: scale(1.06); opacity:.15; }
  100%{ transform: scale(1.06); opacity:0; }
}

/* ChatGPT-style header icon button */
#aibot-newchat,
#aibot-close{
  width:38px;
  height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;

  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);

  cursor:pointer;
  transition: transform .12s ease, filter .12s ease, background .12s ease, border-color .12s ease;
  padding:0;
}

#aibot-newchat:hover,
#aibot-close:hover{
  filter: brightness(1.08);
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.18);
}

#aibot-newchat:active,
#aibot-close:active{
  transform: translateY(0px) scale(.98);
}

#aibot-newchat .aibot-ico{
  width:18px;
  height:18px;
}
#aibot-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}

#aibot-btn .aibot-launcher-ico{
  width:22px;
  height:22px;
  color: var(--aibot-launcher-icon, #111111);
}

/* shapes */
#aibot-btn[data-shape="pill"]{ border-radius:999px; padding:0 16px; height:56px; }
#aibot-btn[data-shape="circle"]{ border-radius:999px; width:56px; height:56px; padding:0; }
#aibot-btn[data-shape="square"]{ border-radius:16px; width:56px; height:56px; padding:0; }
.aibot-color-dot{
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #cfcfcf;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.aibot-color-dot::-webkit-color-swatch-wrapper{ padding: 0; }
.aibot-color-dot::-webkit-color-swatch{
  border: none;
  border-radius: 999px;
}
.aibot-color-dot::-moz-color-swatch{
  border: none;
  border-radius: 999px;
}
#aibot-lead { display:none; }
#aibot-lead.show { display:flex; }

/* ✅ Powered by bar (Fin style) */
#aibot-powered{
  padding: 10px 12px;
  display:flex;
  justify-content:center;
  background:#ffffff;                 /* ✅ white background */
  border-top:1px solid rgba(0,0,0,.08);/* ✅ subtle line */
}

#aibot-powered .aibot-powered-link{
  display:flex;
  align-items:center;
  gap:8px;
  text-decoration:none;
  font-weight:600;
  font-size:12px;
  color:#6b7280;                      /* ✅ gray text */
}

#aibot-powered .aibot-powered-link:hover{
  color:#111827;                      /* ✅ darker on hover */
}

#aibot-powered img{
  height:14px;                        /* ✅ small logo like Fin */
  width:auto;
  display:block;
}
/* =========================
   BIG COMPANY OVERRIDES
   Paste at BOTTOM
========================= */

/* Launcher */
#aibot-btn{
  background:#fff !important;
  color:#0b0c14 !important;
  border:1px solid rgba(0,0,0,.10) !important;
  box-shadow: 0 12px 28px rgba(0,0,0,.12) !important;
  padding: 0 16px !important;
  height: 56px !important;
}
#aibot-btn:hover{ transform: translateY(-1px) !important; }
#aibot-btn span{ color:#0b0c14 !important; }
#aibot-btn img{ background: rgba(0,0,0,.04) !important; }

/* Panel = WHITE (professional) */
#aibot-panel{
  background:#fff !important;
  border:1px solid rgba(0,0,0,.10) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,.18) !important;
}
#aibot-body{
  flex:1;
  display:flex;
  min-height:0; /* ✅ CRITICAL for flex scrolling */
  overflow:hidden;
}

#aibot-chatview,
#aibot-historyview{
  flex:1;
  display:none;
  flex-direction:column;
  min-height:0; /* ✅ CRITICAL */
}

#aibot-chatview.active,
#aibot-historyview.active{
  display:flex;
}
/* Header = WHITE */
#aibot-header{
  background:#fff !important;
  border-bottom:1px solid rgba(0,0,0,.08) !important;
}
#aibot-title .t1{ color:#0b0c14 !important; }
#aibot-title .t2{ color:rgba(11,12,20,.60) !important; }

/* Header buttons (close/newchat) = light theme */
#aibot-newchat,
#aibot-close{
  background:#fff !important;
  border:1px solid rgba(0,0,0,.10) !important;
  color:#0b0c14 !important;
}
#aibot-newchat:hover,
#aibot-close:hover{
  background: rgba(0,0,0,.03) !important;
}

/* Tabs look cleaner */
#aibot-tabs{
  background:#fff !important;
  border-bottom:1px solid rgba(0,0,0,.08) !important;
}
.aibot-tab{
  background:#fff !important;
  border:1px solid rgba(0,0,0,.10) !important;
  color:#0b0c14 !important;
}
.aibot-tab.active{
  border-color: color-mix(in srgb, var(--aibot-primary) 55%, rgba(0,0,0,.10)) !important;
  background: color-mix(in srgb, var(--aibot-primary) 10%, #ffffff) !important;
}

/* Messages */
#aibot-messages{ background:#fff !important; }
.aibot-bot{
  background:#f5f7fb !important;
  border:1px solid rgba(0,0,0,.08) !important;
}
.aibot-user{
  background: color-mix(in srgb, var(--aibot-primary) 12%, #ffffff) !important;
  border:1px solid color-mix(in srgb, var(--aibot-primary) 28%, rgba(0,0,0,.10)) !important;
}

/* Mic button = light theme */
#aibot-mic{
  background:#fff !important;
  border:1px solid rgba(0,0,0,.10) !important;
  color:#0b0c14 !important;
}
#aibot-mic:hover{ background: rgba(0,0,0,.03) !important; }
#aibot-mic.listening{
  background: var(--aibot-primary-grad) !important;
  color:#fff !important;
}

/* Powered by bar stays clean */
#aibot-powered{
  background:#fff !important;
  border-top:1px solid rgba(0,0,0,.08) !important;
}
