/* ══════════════════════════════════════════════════
   AE ASSISTANT, CHATBOT WIDGET STYLES
══════════════════════════════════════════════════ */

/* ── Shared window ── */
.cb-window {
  background: #001a2e;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  font-family: 'Inter', sans-serif;
}

/* ── Header ── */
.cb-header {
  background: linear-gradient(135deg, #001a2e 0%, #003a6b 100%);
  padding: 15px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative;
}

.cb-avatar {
  width: 40px; height: 40px;
  background: #0078D4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(30,96,145,0.25);
}

.cb-header-info { flex: 1; min-width: 0; }
.cb-bot-name { color: white; font-weight: 700; font-size: 0.93rem; }
.cb-bot-status {
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(255,255,255,0.45);
  font-size: 0.75rem;
  margin-top: 2px;
}
.cb-status-dot {
  width: 6px; height: 6px;
  background: #22c55e;
  border-radius: 50%;
  animation: cb-blink 2.5s ease-in-out infinite;
}
@keyframes cb-blink {
  0%,100% { opacity:1; }
  50%      { opacity:0.35; }
}

.cb-header-badge {
  background: rgba(30,96,145,0.22);
  border: 1px solid rgba(42,122,191,0.4);
  color: rgba(90,159,212,0.95);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
}

/* ── Progress bar ── */
.cb-progress-wrap {
  height: 3px;
  background: rgba(255,255,255,0.04);
  flex-shrink: 0;
}
.cb-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #0078D4, #0078D4);
  transition: width 0.7s cubic-bezier(0.4,0,0.2,1);
  width: 0%;
}

/* ── Messages area ── */
.cb-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.cb-messages::-webkit-scrollbar { width: 3px; }
.cb-messages::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
}

/* ── Message bubbles ── */
.cb-msg {
  display: flex;
  gap: 8px;
  max-width: 88%;
  animation: cb-msg-in 0.3s ease;
}
@keyframes cb-msg-in {
  from { opacity:0; transform:translateY(8px); }
  to   { opacity:1; transform:translateY(0); }
}

.cb-msg-bot  { align-self: flex-start; }
.cb-msg-user { align-self: flex-end; flex-direction: row-reverse; }

.cb-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.6;
  word-break: break-word;
}

.cb-msg-bot .cb-bubble {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.88);
  border-bottom-left-radius: 3px;
}
.cb-msg-user .cb-bubble {
  background: #0078D4;
  color: white;
  border-bottom-right-radius: 3px;
}

/* ── Typing indicator ── */
.cb-typing .cb-bubble {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 13px 16px;
}
.cb-typing .cb-bubble span {
  width: 7px; height: 7px;
  background: rgba(255,255,255,0.35);
  border-radius: 50%;
  display: block;
  animation: cb-dot 1.3s ease-in-out infinite;
}
.cb-typing .cb-bubble span:nth-child(2) { animation-delay: 0.18s; }
.cb-typing .cb-bubble span:nth-child(3) { animation-delay: 0.36s; }
@keyframes cb-dot {
  0%,60%,100% { transform:translateY(0);    opacity:0.35; }
  30%          { transform:translateY(-5px); opacity:1;    }
}

/* ── Input area ── */
.cb-input-area {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 12px 14px;
  min-height: 64px;
  display: flex;
  align-items: flex-start;
  background: rgba(255,255,255,0.02);
}

/* ── Chips ── */
.cb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}
.cb-chip {
  padding: 8px 16px;
  border-radius: 100px;
  border: 1px solid rgba(30,96,145,0.4);
  background: rgba(30,96,145,0.1);
  color: rgba(90,159,212,0.95);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.01em;
}
.cb-chip:hover {
  background: #0078D4;
  border-color: #0078D4;
  color: #001a2e;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,120,212,0.3);
}

/* ── Text / tel / email input ── */
.cb-text-input-wrap {
  display: flex;
  gap: 8px;
  width: 100%;
  align-items: center;
}
.cb-text-input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 9px;
  padding: 10px 14px;
  color: white;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.22s;
  min-width: 0;
}
.cb-text-input:focus  { border-color: rgba(30,96,145,0.7); }
.cb-text-input::placeholder { color: rgba(255,255,255,0.22); }
.cb-text-input.cb-err { border-color: #0078D4; }
.cb-date-input { color-scheme: dark; }

.cb-send-wrap {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-shrink: 0;
}

.cb-send-btn {
  width: 40px; height: 40px;
  background: #0078D4;
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.cb-send-btn:hover { background: #2a90e0; transform: scale(1.08); }
.cb-send-btn.full {
  width: auto;
  border-radius: 9px;
  padding: 10px 18px;
  font-size: 0.84rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  gap: 7px;
}

.cb-skip-btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: rgba(255,255,255,0.38);
  font-size: 0.78rem;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
  white-space: nowrap;
}
.cb-skip-btn:hover {
  border-color: rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.6);
}

/* ── Textarea input ── */
.cb-textarea-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.cb-textarea {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 9px;
  padding: 10px 14px;
  color: white;
  font-size: 0.87rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  resize: none;
  transition: border-color 0.22s;
  min-height: 68px;
  box-sizing: border-box;
}
.cb-textarea:focus { border-color: rgba(30,96,145,0.7); }
.cb-textarea::placeholder { color: rgba(255,255,255,0.22); }

/* ── Package cards ── */
.cb-packages {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
}
.cb-pkg-card {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 11px 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.25s;
  font-family: 'Inter', sans-serif;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 1px 12px;
}
.cb-pkg-card:hover {
  border-color: rgba(30,96,145,0.5);
  background: rgba(30,96,145,0.1);
  transform: translateX(3px);
}
.cb-pkg-name  { color: white; font-weight: 600; font-size: 0.88rem; grid-row:1; grid-column:1; }
.cb-pkg-price { color: #5a9fd4; font-weight: 700; font-size: 0.9rem; grid-row:1; grid-column:2; white-space:nowrap; }
.cb-pkg-dur   { color: rgba(255,255,255,0.35); font-size: 0.74rem; grid-row:2; grid-column:1/3; margin-top:1px; }

/* ── Summary card (in bubble) ── */
.cb-summary { width: 100%; }
.cb-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.83rem;
}
.cb-summary-row:last-child { border-bottom: none; }
.cb-summary-row span { color: rgba(255,255,255,0.4); flex-shrink: 0; min-width: 70px; }
.cb-summary-row strong { color: rgba(255,255,255,0.88); text-align: right; }

/* ── Confirm / restart / success buttons ── */
.cb-confirm-wrap {
  display: flex;
  gap: 8px;
  width: 100%;
}
.cb-confirm-btn {
  flex: 1;
  background: #0078D4;
  border: none;
  border-radius: 9px;
  padding: 12px;
  color: white;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: background 0.2s, transform 0.2s;
}
.cb-confirm-btn:hover { background: #2a90e0; transform: translateY(-1px); }
.cb-confirm-btn.success { background: #16a34a; }
.cb-confirm-btn.success:hover { background: #15803d; }

.cb-restart-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 9px;
  padding: 12px 14px;
  color: rgba(255,255,255,0.35);
  font-size: 0.8rem;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
  white-space: nowrap;
}
.cb-restart-btn:hover {
  border-color: rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.6);
}

/* ── Embed wrapper (contact page) ── */
.cb-embed-wrap {
  max-width: 680px;
  margin: 0 auto;
}
.cb-embed-wrap .cb-window { height: 560px; }

/* ── Floating button ── */
#cb-float-btn {
  position: fixed;
  bottom: 28px;
  right: 98px;
  width: 58px; height: 58px;
  background: linear-gradient(135deg, #003a6b, #0078D4);
  border: 2px solid rgba(42,122,191,0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 8990;
  box-shadow: 0 4px 18px rgba(13,27,75,0.55);
  transition: transform 0.3s, box-shadow 0.3s;
  color: white;
}
#cb-float-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 28px rgba(13,27,75,0.8);
}
.cb-float-badge {
  position: absolute;
  top: -3px; right: -3px;
  width: 18px; height: 18px;
  background: #0078D4;
  border-radius: 50%;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  color: white;
  animation: cb-badge 2.5s ease-in-out infinite;
}
@keyframes cb-badge {
  0%,100% { transform:scale(1); }
  50%      { transform:scale(1.25); }
}
.cb-float-tooltip {
  position: absolute;
  right: 68px;
  background: #111;
  color: #fff;
  font-size: 0.76rem;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(4px);
  transition: opacity 0.22s, transform 0.22s;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}
.cb-float-tooltip::after {
  content: '';
  position: absolute;
  right: -5px; top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: #111;
  border-right: 0;
}
#cb-float-btn:hover .cb-float-tooltip { opacity:1; transform:translateX(-8px); }

/* ── Floating modal ── */
#cb-float-modal {
  position: fixed;
  bottom: 98px;
  right: 20px;
  width: 360px;
  z-index: 9000;
  transform: translateY(20px) scale(0.94);
  transform-origin: bottom right;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.38s cubic-bezier(0.34,1.56,0.64,1), opacity 0.28s ease;
}
#cb-float-modal.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}
#cb-float-modal .cb-window { height: 510px; width: 100%; }

.cb-float-close {
  position: absolute;
  top: 10px; right: 10px;
  width: 26px; height: 26px;
  background: rgba(255,255,255,0.09);
  border: none;
  border-radius: 50%;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: all 0.2s;
}
.cb-float-close:hover { background: rgba(30,96,145,0.4); color: white; }

/* ── Responsive ── */
@media (max-width: 600px) {
  #cb-float-btn { bottom: 20px; right: 80px; width: 50px; height: 50px; }
  #cb-float-modal { bottom: 80px; right: 8px; left: 8px; width: auto; }
  .cb-embed-wrap .cb-window { height: 520px; }
  .cb-pkg-card { grid-template-columns: 1fr; }
  .cb-pkg-price { grid-row: 2; grid-column: 1; }
  .cb-pkg-dur   { grid-row: 3; }
}
