/* === FLYING ROBOT CHATBOT STYLES === */

/* Robot Container */
#cb-robot {
  position: fixed;
  z-index: 10001;
  cursor: pointer;
  width: 200px;
  height: 200px;
  bottom: 40px;
  right: 40px;
  pointer-events: auto;
  overflow: visible;
}
#cb-robot.docked {
  animation: none !important;
  overflow: hidden;
}

.robot-inner {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: visible;
}
.robot-inner::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 140%;
  height: 140%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.3) 0%, rgba(0, 229, 255, 0.15) 35%, rgba(124, 58, 237, 0.05) 55%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: glowPulse 3s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}

#robotCanvas {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  pointer-events: none;
}

/* Particle trail */
.robot-particle {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  animation: particle-fade 1s ease-out forwards;
}
@keyframes particle-fade {
  0% { opacity: 0.8; transform: scale(1); }
  100% { opacity: 0; transform: scale(0); }
}

/* Speed lines */
.robot-speed-line {
  position: fixed;
  height: 2px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 10000;
  animation: speed-fade 0.6s ease-out forwards;
}
@keyframes speed-fade {
  0% { opacity: 0.5; width: 30px; }
  100% { opacity: 0; width: 0; }
}

/* Notification badge */
#cb-badge {
  position: absolute;
  top: -6px; right: -6px;
  width: 26px; height: 26px;
  background: linear-gradient(135deg, #FF4757, #FF6B81);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: white;
  font-family: var(--font-body);
  z-index: 2;
  border: 3px solid var(--clr-bg);
  animation: badge-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), badge-attention 3s ease-in-out infinite 2s;
  box-shadow: 0 2px 10px rgba(255, 71, 87, 0.5);
}
@keyframes badge-pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes badge-attention {
  0%, 90%, 100% { transform: scale(1); }
  93% { transform: scale(1.3); }
  96% { transform: scale(0.9); }
}
#cb-badge.hidden { display: none; }

/* Speech bubble */
.robot-speech {
  position: absolute;
  top: -14px;
  right: 100%;
  margin-right: 16px;
  background: rgba(19, 19, 43, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 16px 16px 4px 16px;
  padding: 14px 22px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--clr-text);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(10px) scale(0.9);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 10px 40px rgba(0,0,0,0.4), 0 0 20px rgba(124, 58, 237, 0.1);
}
.robot-speech.flip-right {
  right: auto;
  left: 100%;
  margin-right: 0;
  margin-left: 16px;
  border-radius: 16px 16px 16px 4px;
  transform: translateX(-10px) scale(0.9);
}
.robot-speech.flip-right.show {
  transform: translateX(0) scale(1);
}
.robot-speech::after {
  content: '';
  position: absolute;
  top: 18px;
  right: -7px;
  width: 14px;
  height: 14px;
  background: rgba(19, 19, 43, 0.95);
  border-right: 1px solid rgba(124, 58, 237, 0.3);
  border-bottom: 1px solid rgba(124, 58, 237, 0.3);
  transform: rotate(-45deg);
}
.robot-speech.flip-right::after {
  right: auto;
  left: -7px;
  border-right: none;
  border-bottom: none;
  border-left: 1px solid rgba(124, 58, 237, 0.3);
  border-top: 1px solid rgba(124, 58, 237, 0.3);
}
.robot-speech.show {
  opacity: 1;
  transform: translateX(0) scale(1);
}
.robot-speech .activity-icon {
  font-size: 16px;
  margin-right: 6px;
}

/* Docking station */
#cb-dock {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 200px;
  height: 70px;
  border-radius: 35px;
  background: rgba(13, 13, 32, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(124, 58, 237, 0.25);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(124, 58, 237, 0.1);
  z-index: 9998;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
}
#cb-dock.visible {
  opacity: 1;
  animation: dock-pulse 2.5s infinite;
}
#cb-dock .dock-label {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
  letter-spacing: 0.2px;
}
#cb-dock .dock-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-accent));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
}
#cb-dock .dock-icon svg { width: 16px; height: 16px; fill: white; }
@keyframes dock-pulse {
  0%, 100% { border-color: rgba(124, 58, 237, 0.25); box-shadow: 0 10px 40px rgba(0,0,0,0.5), 0 0 30px rgba(124, 58, 237, 0.1); }
  50% { border-color: rgba(124, 58, 237, 0.5); box-shadow: 0 10px 40px rgba(0,0,0,0.5), 0 0 50px rgba(124, 58, 237, 0.25); }
}

/* Close X */
.robot-close-x {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3;
  cursor: pointer;
  transition: background 0.2s;
}
.robot-close-x:hover { background: rgba(255, 71, 87, 0.3); }
.robot-close-x svg { width: 14px; height: 14px; fill: var(--clr-text-3); }
#cb-robot.docked .robot-close-x { display: flex; }

/* Floating service cards */
.service-card-float {
  position: fixed;
  z-index: 10000;
  padding: 12px 20px;
  background: rgba(19, 19, 43, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 14px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--clr-text);
  white-space: nowrap;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 16px rgba(124,58,237,0.12);
  animation: card-float-in 0.5s cubic-bezier(0.34,1.56,0.64,1) forwards,
             card-float-out 0.5s ease-in 3.5s forwards;
}
.service-card-float .card-emoji { font-size: 20px; }
.service-card-float .card-text { display: flex; flex-direction: column; gap: 2px; }
.service-card-float .card-title {
  color: var(--clr-accent);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
@keyframes card-float-in {
  0% { opacity: 0; transform: scale(0.5) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes card-float-out {
  0% { opacity: 1; transform: scale(1) translateY(0); }
  100% { opacity: 0; transform: scale(0.7) translateY(-20px); }
}

/* Emoji burst */
.emoji-burst {
  position: fixed;
  font-size: 24px;
  pointer-events: none;
  z-index: 10002;
  animation: emoji-fly 1.5s ease-out forwards;
}
@keyframes emoji-fly {
  0% { opacity: 1; transform: scale(0.5) translateY(0) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.2) translateY(-60px) rotate(180deg); }
  100% { opacity: 0; transform: scale(0.8) translateY(-120px) rotate(360deg); }
}

/* Attention pulse */
#cb-robot.attention-pulse {
  animation: attention-glow 1.5s ease-in-out infinite !important;
}
@keyframes attention-glow {
  0%, 100% { filter: drop-shadow(0 10px 35px rgba(124,58,237,0.6)) drop-shadow(0 4px 15px rgba(0,0,0,0.5)); }
  50% { filter: drop-shadow(0 10px 50px rgba(6,214,160,0.8)) drop-shadow(0 4px 20px rgba(0,0,0,0.6)) drop-shadow(0 0 40px rgba(6,214,160,0.4)); }
}

/* Score counter */
.robot-score {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10003;
  padding: 10px 18px;
  background: rgba(19,19,43,0.9);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--clr-text);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.4s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.robot-score.visible {
  opacity: 1;
  transform: translateY(0);
}
.robot-score .score-num {
  color: var(--clr-accent);
  font-size: 18px;
  font-weight: 800;
}

/* Chat container */
#cb-container {
  position: fixed;
  bottom: 102px;
  right: 28px;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 140px);
  background: rgba(13, 13, 32, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--radius);
  border: 1px solid rgba(124, 58, 237, 0.35);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.7),
              0 0 60px rgba(124, 58, 237, 0.15),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10002;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
#cb-container.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.cb-header {
  background: linear-gradient(135deg, rgba(24, 24, 56, 0.95), rgba(30, 30, 68, 0.95));
  padding: 16px 18px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(124, 58, 237, 0.2);
  flex-shrink: 0;
}
.cb-header-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.cb-header-close:hover {
  background: rgba(255, 71, 87, 0.2);
  border-color: rgba(255, 71, 87, 0.4);
  color: #FF4757;
}
.cb-header-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-accent));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; position: relative;
}
.cb-header-avatar svg { width: 20px; height: 20px; fill: white; }
.cb-header-avatar::after {
  content: '';
  position: absolute; bottom: 1px; right: 1px;
  width: 10px; height: 10px;
  background: var(--clr-accent);
  border-radius: 50%;
  border: 2px solid var(--clr-surface);
}
.cb-header-info { flex: 1; }
.cb-header-name {
  font-family: var(--font-primary);
  font-size: 14px; font-weight: 700; color: var(--clr-text);
}
.cb-header-status {
  font-size: 12px; color: var(--clr-accent);
  display: flex; align-items: center; gap: 5px; margin-top: 1px;
}
.cb-status-dot {
  width: 6px; height: 6px;
  background: var(--clr-accent);
  border-radius: 50%;
  animation: cb-status 1.5s infinite;
}
@keyframes cb-status {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.cb-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}
.cb-messages::-webkit-scrollbar { width: 4px; }
.cb-messages::-webkit-scrollbar-track { background: transparent; }
.cb-messages::-webkit-scrollbar-thumb { background: var(--clr-text-muted); border-radius: 10px; }

.cb-msg {
  display: flex; gap: 8px; max-width: 88%;
  animation: cb-msg-in 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes cb-msg-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.cb-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.cb-msg-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.cb-msg.bot .cb-msg-avatar {
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-light));
}
.cb-msg.bot .cb-msg-avatar svg { width: 14px; height: 14px; fill: white; }
.cb-msg.user .cb-msg-avatar {
  background: rgba(255,255,255,0.06);
}
.cb-msg.user .cb-msg-avatar svg { width: 14px; height: 14px; fill: var(--clr-text-3); }

.cb-bubble {
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 13.5px; line-height: 1.55;
}
.cb-msg.bot .cb-bubble {
  background: rgba(19, 19, 43, 0.8);
  color: var(--clr-text);
  border-radius: 4px 14px 14px 14px;
  border: 1px solid rgba(124, 58, 237, 0.12);
}
.cb-msg.user .cb-bubble {
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-light));
  color: white;
  border-radius: 14px 4px 14px 14px;
}
.cb-time {
  font-size: 10px; color: var(--clr-text-muted);
  margin-top: 4px;
}
.cb-msg.user .cb-time { text-align: right; }

.cb-typing {
  display: flex; gap: 8px; max-width: 85%;
  animation: cb-msg-in 0.3s ease;
}
.cb-typing .cb-msg-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-light));
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cb-typing .cb-msg-avatar svg { width: 14px; height: 14px; fill: white; }
.cb-dots {
  background: var(--clr-surface);
  border-radius: 4px 14px 14px 14px;
  border: 1px solid rgba(255,255,255,0.04);
  padding: 12px 18px;
  display: flex; align-items: center; gap: 5px;
}
.cb-dots span {
  width: 6px; height: 6px;
  background: var(--clr-text-muted);
  border-radius: 50%;
  animation: cb-dot 1.4s infinite ease-in-out;
}
.cb-dots span:nth-child(2) { animation-delay: 0.16s; }
.cb-dots span:nth-child(3) { animation-delay: 0.32s; }
@keyframes cb-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.cb-quick {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 14px 8px; flex-shrink: 0;
}
.cb-quick-btn {
  padding: 7px 14px;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 18px;
  color: var(--clr-primary-light);
  font-family: var(--font-body);
  font-size: 12px; cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}
.cb-quick-btn:hover {
  background: rgba(124, 58, 237, 0.2);
  border-color: var(--clr-primary-light);
}

.cb-input-area {
  padding: 12px 14px;
  background: rgba(19, 19, 43, 0.6);
  border-top: 1px solid rgba(124, 58, 237, 0.15);
  display: flex; gap: 8px; align-items: flex-end;
  flex-shrink: 0;
}
.cb-input-wrap {
  flex: 1;
  background: var(--clr-bg-3);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 0 12px;
  display: flex; align-items: center;
  transition: var(--transition-fast);
}
.cb-input-wrap:focus-within {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}
#cb-input {
  flex: 1; border: none; background: none;
  color: var(--clr-text);
  font-family: var(--font-body);
  font-size: 13.5px; padding: 11px 0;
  outline: none; resize: none;
  max-height: 80px; line-height: 1.4;
}
#cb-input::placeholder { color: var(--clr-text-muted); }
#cb-send {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-light));
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition); flex-shrink: 0;
}
#cb-send:hover { transform: scale(1.05); box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4); }
#cb-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
#cb-send svg { width: 16px; height: 16px; fill: white; }

.cb-footer {
  text-align: center; padding: 6px;
  background: rgba(19, 19, 43, 0.6);
  font-size: 10px; color: var(--clr-text-muted);
  font-family: var(--font-body);
  border-top: 1px solid rgba(124, 58, 237, 0.08);
  flex-shrink: 0;
}
.cb-footer span { color: var(--clr-primary-light); }

/* Mobile bot responsive — See mobile.css */
