/* ══════════════════════════════════════════
   AI Bot Pro v2 — Chat Widget Styles
   ══════════════════════════════════════════ */

/* ── Chat Widget Container ── */
.aibp-widget {
  display: none;
  position: fixed;
  box-sizing: border-box;
  direction: ltr;
  bottom: 20px;
  right: 20px;
  width: 400px;
  max-width: calc(100vw - 24px);
  height: 560px;
  max-height: calc(100vh - 40px);
  background: #12203a;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(26, 188, 156, 0.25);
  flex-direction: column;
  overflow: hidden;
  z-index: 10000;
  border: 3px solid rgba(26, 188, 156, 0.6);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #e0e0e0;
}
.aibp-widget.aibp-open {
  display: flex;
}

/* ── Mobile: full width ── */
@media (max-width: 480px) {
  .aibp-widget {
    top: var(--aibp-vt, 0px);
    right: auto;
    bottom: auto;
    left: var(--aibp-vl, 0px);
    width: var(--aibp-vw, 100vw);
    max-width: var(--aibp-vw, 100vw);
    height: var(--aibp-vh, 100svh);
    max-height: var(--aibp-vh, 100svh);
    border-radius: 0;
    border: none;
  }
  .aibp-input {
    font-size: 16px;
  }
}

/* ── Chat Header ── */
.aibp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, #1abc9c, #16a085);
  color: #fff;
  flex-shrink: 0;
}
.aibp-header-info {
  display: flex;
  flex-direction: column;
}
.aibp-header-title {
  font-weight: 600;
  font-size: 1rem;
}
.aibp-header-subtitle {
  font-size: 0.75rem;
  opacity: 0.85;
}
.aibp-header-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}
.aibp-home-btn,
.aibp-close-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.aibp-home-btn svg,
.aibp-close-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.aibp-close-btn {
  font-size: 1.5rem;
}
.aibp-home-btn:hover,
.aibp-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ── Chat Messages ── */
.aibp-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.aibp-messages::-webkit-scrollbar { width: 6px; }
.aibp-messages::-webkit-scrollbar-track { background: transparent; }
.aibp-messages::-webkit-scrollbar-thumb { background: #2a3a50; border-radius: 3px; }

/* ── Message Bubbles ── */
.aibp-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: normal;
}
.aibp-msg-user {
  align-self: flex-end;
  background: #1abc9c;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.aibp-msg-bot {
  align-self: flex-start;
  background: #1e2d44;
  color: #e0e0e0;
  border-bottom-left-radius: 4px;
}
.aibp-msg-system {
  align-self: center;
  background: #2a3a50;
  color: #8a9bb5;
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 8px;
}
.aibp-msg-confirm {
  align-self: flex-start;
  background: #1a3a2a;
  color: #4ade80;
  border: 1px solid #2d5a3a;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
}

/* RTL support */
.aibp-msg[dir="rtl"] {
  text-align: right;
  direction: rtl;
}

/* ── Quick-Action Buttons ── */
.aibp-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: flex-start;
  max-width: 90%;
}
.aibp-quick-btn {
  padding: 7px 14px;
  border: 1px solid #1abc9c;
  border-radius: 18px;
  background: transparent;
  color: #1abc9c;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
  white-space: normal;
  text-align: center;
}
.aibp-quick-btn:hover {
  background: #1abc9c;
  color: #fff;
}

/* ── Typing Indicator ── */
.aibp-typing {
  display: none;
  align-self: flex-start;
  padding: 10px 14px;
  background: #1e2d44;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  gap: 4px;
  align-items: center;
}
.aibp-typing.aibp-visible {
  display: flex;
}
.aibp-typing-dot {
  width: 7px;
  height: 7px;
  background: #8a9bb5;
  border-radius: 50%;
  animation: aibpBounce 1.2s infinite;
}
.aibp-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.aibp-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes aibpBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

/* ── Chat Input Area ── */
.aibp-input-area {
  display: flex;
  padding: 10px 12px;
  gap: 8px;
  border-top: 1px solid #2a3a50;
  background: #0e1a2e;
  flex-shrink: 0;
  align-items: flex-end;
}
.aibp-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #2a3a50;
  border-radius: 10px;
  background: #12203a;
  color: #e0e0e0;
  font-size: 0.9rem;
  font-family: inherit;
  resize: none;
  outline: none;
  max-height: 80px;
  line-height: 1.4;
}
.aibp-input:focus {
  border-color: #1abc9c;
}
.aibp-input::placeholder {
  color: #5a6a80;
}
.aibp-send-btn {
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: #1abc9c;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
  line-height: 1;
}
.aibp-send-btn:hover {
  background: #16a085;
}
.aibp-send-btn:disabled {
  background: #2a3a50;
  cursor: not-allowed;
}

/* ── PII Form (inside chat) ── */
.aibp-pii-form {
  background: #1e2d44;
  border-radius: 12px;
  padding: 14px;
  max-width: 90%;
  align-self: flex-start;
}
.aibp-pii-form h4 {
  color: #1abc9c;
  margin: 0 0 10px 0;
  font-size: 0.9rem;
}
.aibp-pii-form label {
  display: block;
  color: #8a9bb5;
  font-size: 0.8rem;
  margin-bottom: 4px;
  margin-top: 8px;
}
.aibp-pii-form label:first-of-type {
  margin-top: 0;
}
.aibp-pii-form input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #2a3a50;
  border-radius: 6px;
  background: #12203a;
  color: #e0e0e0;
  font-size: 0.85rem;
  font-family: inherit;
  box-sizing: border-box;
}
.aibp-pii-form input:focus {
  border-color: #1abc9c;
  outline: none;
}
.aibp-pii-form .aibp-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.aibp-pii-form .aibp-btn-submit {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 6px;
  background: #1abc9c;
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}
.aibp-pii-form .aibp-btn-submit:hover {
  background: #16a085;
}
.aibp-pii-form .aibp-btn-cancel {
  padding: 8px 12px;
  border: 1px solid #2a3a50;
  border-radius: 6px;
  background: transparent;
  color: #8a9bb5;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}
.aibp-pii-form .aibp-btn-cancel:hover {
  border-color: #8a9bb5;
}

/* Date and time inputs */
.aibp-pii-form input[type="date"],
.aibp-pii-form input[type="time"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #2a3a50;
  border-radius: 6px;
  background: #12203a;
  color: #e0e0e0;
  font-size: 0.85rem;
  font-family: inherit;
  box-sizing: border-box;
  color-scheme: dark;
}

/* Radio button group */
.aibp-radio-group {
  display: flex;
  gap: 16px;
  margin-top: 4px;
}
.aibp-radio-label {
  display: flex !important;
  align-items: center;
  gap: 6px;
  color: #e0e0e0 !important;
  font-size: 0.85rem !important;
  margin: 0 !important;
  cursor: pointer;
}
.aibp-radio-label input[type="radio"] {
  width: auto;
  accent-color: #1abc9c;
  cursor: pointer;
}

/* Form section divider */
.aibp-form-divider {
  color: #1abc9c;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 14px;
  margin-bottom: 4px;
  padding-top: 10px;
  border-top: 1px solid #2a3a50;
}

/* Consent notice */
.aibp-consent-notice {
  color: #5a6a80;
  font-size: 0.75rem;
  margin-top: 10px;
  line-height: 1.4;
}

/* RTL form support */
.aibp-pii-form[dir="rtl"] {
  direction: rtl;
  text-align: right;
}
.aibp-pii-form[dir="rtl"] .aibp-radio-group {
  flex-direction: row-reverse;
}

/* ── Demo Picker (GENERAL vertical) ── */
.aibp-demo-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: flex-start;
  max-width: 90%;
}
.aibp-demo-options .aibp-demo-label {
  color: #8a9bb5;
  font-size: 0.82rem;
  margin-bottom: 2px;
}
.aibp-demo-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid #2a3a50;
  border-radius: 10px;
  background: #1e2d44;
  color: #e0e0e0;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
  width: 100%;
}
.aibp-demo-btn:hover {
  border-color: #1abc9c;
  background: #1a2d44;
}
.aibp-demo-btn .aibp-demo-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}
.aibp-demo-btn .aibp-demo-name {
  font-weight: 600;
  color: #1abc9c;
}
.aibp-demo-btn .aibp-demo-desc {
  font-size: 0.78rem;
  color: #8a9bb5;
}
