/* ══════════════════════════════════════════════
   Pixel Addis Floating Widget — v4
   Robot mascot + Contact card + Chat window
   ══════════════════════════════════════════════ */

:root {
  --cb-primary: #1a1a2e;
  --cb-primary-dark: #0f0f1e;
  --cb-accent: #e94560;
  --cb-blue: #2b6de8;
  --cb-blue-dark: #1f57c3;
  --cb-blue-light: #e8f0ff;
  --cb-blue-glow: rgba(43, 109, 232, 0.25);
  --cb-bg: #ffffff;
  --cb-surface: #f4f5f7;
  --cb-text: #1a1a2e;
  --cb-text-muted: #6b7280;
  --cb-border: #e5e7eb;
  --cb-radius: 20px;
  --cb-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
  --cb-font: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ═══════════════════════════════════
   FLOATING WIDGET CONTAINER
   ═══════════════════════════════════ */
.cb-widget {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 99999;
  font-family: var(--cb-font);
}

/* ═══ CONTACT CARD ═══ */
.cb-contact-card {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0,0,0,0.03);
  padding: 14px 90px 14px 14px;
  gap: 14px;
  transform: translateY(12px) scale(0.92);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.4s ease;
}

.cb-contact-card.show {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

/* Phone icon box */
.cb-phone-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #dbeafe 0%, #c7d8f8 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cb-phone-icon svg {
  width: 26px;
  height: 26px;
  fill: var(--cb-blue);
}

/* Contact text */
.cb-contact-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cb-contact-phone {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cb-primary);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.3px;
  transition: color 0.2s;
}

.cb-contact-phone:hover {
  color: var(--cb-blue);
}

.cb-contact-email-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.cb-contact-email-row svg {
  width: 14px;
  height: 14px;
  fill: var(--cb-blue);
  flex-shrink: 0;
}

.cb-contact-email {
  font-size: 0.78rem;
  color: var(--cb-blue);
  text-decoration: none;
  transition: opacity 0.2s;
}

.cb-contact-email:hover {
  opacity: 0.7;
}

/* Continue button */
.cb-continue-btn {
  position: absolute;
  bottom: 12px;
  right: 14px;
  background: linear-gradient(135deg, var(--cb-blue) 0%, var(--cb-blue-dark) 100%);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 7px 18px 7px 14px;
  font-family: var(--cb-font);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
}

.cb-continue-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--cb-blue-glow);
}

.cb-continue-btn:active {
  transform: scale(0.96);
}

.cb-continue-btn svg {
  width: 14px;
  height: 14px;
  fill: #fff;
}

/* ═══ ROBOT MASCOT ═══ */
.cb-robot {
  position: absolute;
  top: -28px;
  right: -6px;
  width: 86px;
  height: 86px;
  cursor: pointer;
  z-index: 2;
  filter: drop-shadow(0 4px 12px rgba(43, 109, 232, 0.25));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cb-robot:hover {
  transform: scale(1.08);
}

.cb-robot:active {
  transform: scale(0.95);
}

/* Robot idle bounce */
.cb-robot svg {
  width: 100%;
  height: 100%;
  animation: cbRobotBounce 3s ease-in-out infinite;
}

@keyframes cbRobotBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Antenna sparkle lines */
.cb-sparkle {
  animation: cbSparkle 2s ease-in-out infinite;
  transform-origin: center;
}

.cb-sparkle:nth-child(2) {
  animation-delay: 0.3s;
}

.cb-sparkle:nth-child(3) {
  animation-delay: 0.6s;
}

@keyframes cbSparkle {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* Green online dot */
.cb-online-dot {
  position: absolute;
  top: 18px;
  right: 4px;
  width: 14px;
  height: 14px;
  background: #22c55e;
  border-radius: 50%;
  border: 2.5px solid #fff;
  z-index: 3;
  animation: cbOnline 2s ease infinite;
}

@keyframes cbOnline {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); }
}

/* Close X on robot */
.cb-robot-close {
  position: absolute;
  top: -2px;
  right: -8px;
  width: 24px;
  height: 24px;
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  transition: background 0.2s, border-color 0.2s;
  padding: 0;
  -webkit-user-select: none;
  user-select: none;
}

.cb-robot-close:hover {
  background: #f5f5f5;
  border-color: #ccc;
}

.cb-robot-close svg {
  width: 10px;
  height: 10px;
  fill: #888;
}

/* ═══ MINIMIZED STATE — just the robot FAB ═══ */
.cb-mini-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 68px;
  height: 68px;
  cursor: pointer;
  z-index: 99999;
  filter: drop-shadow(0 6px 20px rgba(43, 109, 232, 0.3));
  border: none;
  background: none;
  padding: 0;
  display: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cb-mini-fab.show {
  display: block;
  animation: cbFabIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cb-mini-fab:hover {
  transform: scale(1.12);
}

.cb-mini-fab:active {
  transform: scale(0.95);
}

.cb-mini-fab svg {
  width: 100%;
  height: 100%;
  animation: cbRobotBounce 3s ease-in-out infinite;
}

@keyframes cbFabIn {
  from { opacity: 0; transform: scale(0.5) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Mini FAB badge */
.cb-mini-badge {
  position: absolute;
  top: 0;
  right: 0;
  width: 16px;
  height: 16px;
  background: var(--cb-accent);
  border-radius: 50%;
  border: 2.5px solid #fff;
  animation: cbBadgePulse 2s ease infinite;
}

@keyframes cbBadgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* Ring ping on mini fab */
.cb-mini-fab::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--cb-blue);
  opacity: 0;
  animation: cbRingPing 3s ease-out infinite;
  pointer-events: none;
}

@keyframes cbRingPing {
  0% { transform: scale(1); opacity: 0.5; }
  70% { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}


/* ══════════════════════════
   CHAT WINDOW
   ══════════════════════════ */
.cb-window {
  position: fixed;
  bottom: 108px;
  right: 28px;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 140px);
  background: var(--cb-bg);
  border-radius: var(--cb-radius);
  box-shadow: var(--cb-shadow);
  border: 1px solid rgba(0, 0, 0, 0.06);
  z-index: 99998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(24px) scale(0.92);
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.cb-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ═══ HEADER ═══ */
.cb-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.cb-header::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 200%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
  animation: cbShimmer 4s ease infinite;
}

@keyframes cbShimmer {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(50%); }
}

.cb-header-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.cb-header-avatar svg {
  width: 100%;
  height: 100%;
}

.cb-header-info {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.cb-header-title {
  font-family: var(--cb-font);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
}

.cb-header-status {
  font-size: 0.72rem;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.cb-status-dot {
  width: 7px;
  height: 7px;
  background: #34d399;
  border-radius: 50%;
  display: inline-block;
  animation: cbPulse 2s ease infinite;
}

@keyframes cbPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.cb-header-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  position: relative;
  z-index: 1;
  -webkit-user-select: none;
  user-select: none;
}

.cb-header-close:hover { background: rgba(255,255,255,0.1); }
.cb-header-close svg { width: 18px; height: 18px; fill: rgba(255,255,255,0.7); }

/* ═══ MESSAGES ═══ */
.cb-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--cb-surface);
  scroll-behavior: smooth;
}

.cb-messages::-webkit-scrollbar { width: 4px; }
.cb-messages::-webkit-scrollbar-track { background: transparent; }
.cb-messages::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

.cb-msg {
  max-width: 82%;
  padding: 10px 14px;
  font-family: var(--cb-font);
  font-size: 0.84rem;
  line-height: 1.6;
  word-wrap: break-word;
  animation: cbMsgSlide 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cbMsgSlide {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.cb-msg-user {
  align-self: flex-end;
  background: var(--cb-blue);
  color: #fff;
  border-radius: 18px 18px 6px 18px;
}

.cb-msg-bot {
  align-self: flex-start;
  background: #fff;
  color: var(--cb-text);
  border: 1px solid var(--cb-border);
  border-radius: 18px 18px 18px 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.cb-msg-bot strong { color: var(--cb-blue); }
.cb-msg-bot a { color: var(--cb-blue); text-decoration: none; border-bottom: 1px solid rgba(43,109,232,0.3); }
.cb-msg-bot a:hover { border-bottom-color: var(--cb-blue); }
.cb-msg-bot ul, .cb-msg-bot ol { margin: 6px 0; padding-left: 18px; }
.cb-msg-bot li { margin-bottom: 3px; }

/* ═══ TYPING ═══ */
.cb-typing {
  align-self: flex-start;
  display: none;
  gap: 5px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid var(--cb-border);
  border-radius: 18px 18px 18px 6px;
}

.cb-typing.show {
  display: flex;
  animation: cbMsgSlide 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.cb-typing span {
  width: 8px; height: 8px;
  background: var(--cb-blue);
  border-radius: 50%;
  animation: cbDotBounce 1.4s ease infinite;
}

.cb-typing span:nth-child(1) { animation-delay: 0s; }
.cb-typing span:nth-child(2) { animation-delay: 0.2s; }
.cb-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes cbDotBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
  30% { transform: translateY(-8px); opacity: 1; }
}

/* ═══ INPUT ═══ */
.cb-input-area {
  padding: 12px 16px;
  background: #fff;
  border-top: 1px solid var(--cb-border);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}

.cb-input {
  flex: 1;
  border: 1.5px solid var(--cb-border);
  border-radius: 14px;
  padding: 10px 14px;
  font-family: var(--cb-font);
  font-size: 0.84rem;
  resize: none;
  outline: none;
  max-height: 80px;
  min-height: 40px;
  line-height: 1.4;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--cb-surface);
}

.cb-input:focus {
  border-color: var(--cb-blue);
  box-shadow: 0 0 0 3px var(--cb-blue-glow);
}

.cb-input::placeholder { color: #9ca3af; }

.cb-send-btn {
  width: 42px; height: 42px;
  border: none;
  background: linear-gradient(135deg, var(--cb-blue), var(--cb-blue-dark));
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
  -webkit-user-select: none;
  user-select: none;
}

.cb-send-btn:hover { box-shadow: 0 4px 16px var(--cb-blue-glow); }
.cb-send-btn:active { transform: scale(0.9); }
.cb-send-btn[aria-disabled="true"] { background: #d1d5db; cursor: not-allowed; }
.cb-send-btn svg { width: 18px; height: 18px; fill: #fff; }

/* ═══ SUGGESTIONS ═══ */
.cb-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 4px;
  animation: cbMsgSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cb-suggestion {
  background: var(--cb-blue-light);
  color: var(--cb-blue);
  border: 1.5px solid rgba(43, 109, 232, 0.15);
  border-radius: 20px;
  padding: 7px 14px;
  font-family: var(--cb-font);
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.cb-suggestion:hover {
  background: var(--cb-blue);
  color: #fff;
  border-color: var(--cb-blue);
  transform: translateY(-1px);
}

/* ═══ POWERED BY ═══ */
.cb-powered {
  text-align: center;
  padding: 8px;
  font-size: 0.65rem;
  color: #b0b0b0;
  background: #fff;
  border-top: 1px solid var(--cb-border);
  flex-shrink: 0;
}

.cb-powered a { color: var(--cb-blue); text-decoration: none; font-weight: 600; }

/* ═══ MOBILE ═══ */
@media (max-width: 480px) {
  .cb-window {
    bottom: 0; right: 0;
    width: 100%; max-width: 100%;
    height: 100%; max-height: 100%;
    border-radius: 0;
  }
  .cb-widget { bottom: 18px; right: 12px; }
  .cb-mini-fab { bottom: 18px; right: 18px; width: 58px; height: 58px; }
  .cb-contact-card { padding: 12px 80px 12px 12px; }
  .cb-contact-phone { font-size: 0.92rem; }
  .cb-robot { width: 72px; height: 72px; top: -24px; right: -4px; }
}
