:root {
  --novox-blue: #4a69bd;
  --novox-blue-dark: #1e3799;
  --novox-blue-gradient: linear-gradient(135deg, #4a69bd 0%, #1e3799 100%);
  --novox-cyan-glow: rgba(74, 105, 189, 0.3);
  --novox-soft-bg: #f4f7fa;
  --novox-white: #ffffff;
  --novox-text-dark: #1e272e;
  --novox-text-muted: #485460;
  --novox-border: #d2dae2;
  --novox-shadow: 0 10px 30px -5px rgba(74, 105, 189, 0.2);
  --novox-shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
  --radius-lg: 28px;
  --radius-md: 18px;
}

.chatbot-container {
  position: fixed;
  bottom: 80px;
  right: 40px;
  width: 75px;
  height: 75px;
  z-index: 99999;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  overflow: visible !important; /* Ensure children are not clipped */
  will-change: transform; /* Optimize for movement */
}

/* Toggle Button */
.chatbot-toggle {
  width: 75px;
  height: 75px;
  border-radius: 50%;
  background: var(--novox-white);
  border: 1px solid var(--novox-border);
  cursor: pointer;
  box-shadow: var(--novox-shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  overflow: visible;
  position: relative;
  z-index: 10000;
}

.chatbot-toggle:hover {
  transform: scale(1.08) translateY(-5px);
  box-shadow: 0 25px 35px -5px rgba(13, 91, 255, 0.25);
  border-color: var(--novox-blue);
}

.chatbot-container.open .chatbot-toggle {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}

.premium-pulse {
  animation: premiumPulse 2.5s infinite;
}

@keyframes premiumPulse {
  0% { box-shadow: 0 0 0 0 rgba(13, 91, 255, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(13, 91, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(13, 91, 255, 0); }
}

/* Robot SVG Styles */
.novox-robot-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.robot-float {
  animation: robotFloat 3s ease-in-out infinite;
}

@keyframes robotFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.eye-blink {
  animation: eyeBlink 4s infinite;
}

@keyframes eyeBlink {
  0%, 95%, 100% { transform: scaleY(1); opacity: 1; }
  97% { transform: scaleY(0.1); opacity: 0.4; }
}

/* Chat Window */
.premium-frame {
  width: clamp(380px, 25vw, 450px);
  height: clamp(600px, 80vh, 800px);
  background: var(--novox-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--novox-shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: absolute;
  bottom: 0;
  right: 0;
  transform-origin: bottom right;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.9) translateY(20px);
}

.chatbot-container.open .premium-frame {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

.chatbot-container.hug-left .premium-frame {
  right: auto;
  left: 0;
  transform-origin: bottom left;
}

/* Header */
.premium-header {
  background: var(--novox-blue-gradient);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  cursor: grab;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-badge {
  width: 48px;
  height: 48px;
  background: white;
  border-radius: 50%;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.logo-badge img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.header-info .title {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.header-info .subtitle {
  font-size: 13px;
  opacity: 0.9;
  font-weight: 500;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.status-pill {
  background: rgba(255, 255, 255, 0.15);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
}

.status-pill .dot {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 10px #22c55e;
}

.close-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.close-btn:hover { background: rgba(255,255,255,0.2); }

/* Content Area */
.premium-content {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--novox-border) transparent;
  padding: 0;
  background: #fcfdfe;
  display: flex;
  flex-direction: column;
}

.premium-content::-webkit-scrollbar {
  width: 6px;
}

.premium-content::-webkit-scrollbar-track {
  background: transparent;
}

.premium-content::-webkit-scrollbar-thumb {
  background: var(--novox-border);
  border-radius: 10px;
}

/* Hero Greeting Section */
.hero-greeting-section {
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid rgba(13, 91, 255, 0.08);
}

.greeting-content {
  flex: 1;
}

.greeting-content h1 {
  font-size: 20px;
  font-weight: 800;
  color: var(--novox-text-dark);
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
}

.greeting-content p {
  font-size: 13.5px;
  color: var(--novox-text-muted);
  line-height: 1.4;
  margin: 0;
}

.greeting-mascot {
  width: 35%;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
}

/* Animations for Nova */
.arm-wave {
  transform-origin: 150px 115px;
  animation: armWave 2s ease-in-out infinite;
}

@keyframes armWave {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-15deg); }
}

.head-tilt {
  transform-origin: 110px 115px;
  animation: headTilt 4s ease-in-out infinite;
}

@keyframes headTilt {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(3deg); }
}

.shadow-anim {
  animation: shadowScale 3s ease-in-out infinite;
}

@keyframes shadowScale {
  0%, 100% { transform: scale(1); opacity: 0.1; }
  50% { transform: scale(1.1); opacity: 0.05; }
}

/* Suggestion Chips */
.suggestion-chips-wrapper {
  padding: 24px;
}

.suggestion-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--novox-text-muted);
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.suggestion-chip {
  background: white;
  border: 1.5px solid var(--novox-blue);
  color: var(--novox-blue);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(13, 91, 255, 0.05);
}

.suggestion-chip:hover {
  background: var(--novox-blue);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(13, 91, 255, 0.15);
}

/* Messages */
.message-wrapper {
  padding: 12px 24px;
  display: flex;
  width: 100%;
}

.message-wrapper.user { justify-content: flex-end; }
.message-wrapper.bot { justify-content: flex-start; }

.message {
  padding: 16px 20px;
  max-width: 85%;
  font-size: 13.5px;
  line-height: 1.5;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.user-msg {
  background: var(--novox-blue);
  color: white;
  border-bottom-right-radius: 6px;
  box-shadow: 0 6px 18px rgba(13, 91, 255, 0.12);
}

.bot-msg {
  background: white;
  color: var(--novox-text-dark);
  border: 1px solid var(--novox-border);
  border-bottom-left-radius: 6px;
}

/* Typing Indicator */
.typing-dots {
  display: flex;
  gap: 5px;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  background: var(--novox-text-muted);
  border-radius: 50%;
  animation: dotBounce 1.4s infinite ease-in-out both;
  opacity: 0.6;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.4); opacity: 0.3; }
  40% { transform: scale(1); opacity: 0.8; }
}

/* Footer */
.premium-footer {
  padding: 10px 24px 20px 24px;
  background: white;
  border-top: 1px solid var(--novox-border);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.premium-footer input {
  width: 100%;
  background: var(--novox-soft-bg);
  border: 1px solid transparent;
  padding: 12px 55px 12px 20px;
  border-radius: 100px;
  font-size: 14px;
  color: var(--novox-text-dark);
  transition: all 0.3s;
  box-shadow: inset 0 2px 4px rgba(13, 91, 255, 0.02);
}

.premium-footer input:focus {
  background: white;
  border-color: var(--novox-blue);
  outline: none;
  box-shadow: 0 0 0 4px rgba(13, 91, 255, 0.08);
}

.send-btn {
  position: absolute;
  right: 7px;
  width: 44px;
  height: 44px;
  background: var(--novox-blue);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.send-btn:hover {
  transform: scale(1.1);
  background: var(--novox-blue-dark);
  box-shadow: 0 4px 12px rgba(13, 91, 255, 0.3);
}

.footer-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  font-size: 12px;
  color: var(--novox-text-muted);
  padding: 0 4px;
}

.powered-by {
  font-weight: 700;
  color: var(--novox-blue);
}

/* Mobile & Tablet Responsive */
@media (max-width: 1024px) {
  .premium-frame {
    width: clamp(340px, 45vw, 420px);
    height: clamp(550px, 75vh, 750px);
  }
}

@media (max-width: 768px) {
  .chatbot-container {
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    position: fixed !important;
    pointer-events: none;
    z-index: 99999;
  }
  
  .chatbot-container.open {
    pointer-events: none;
    width: 100% !important;
    height: 100% !important;
    bottom: 0 !important;
    right: 0 !important;
    left: 0 !important;
    top: 0 !important;
    transform: none !important;
  }

  .premium-frame {
    position: fixed !important;
    top: 5% !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    border-radius: 24px 24px 0 0 !important;
    transform: translateY(100%);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
  }

  .chatbot-container.open .premium-frame {
    pointer-events: auto;
    transform: translateY(0);
  }

  .hero-greeting-section {
    flex-direction: column;
    text-align: center;
    padding: 30px 20px;
    gap: 15px;
  }

  .greeting-mascot {
    order: -1;
    width: clamp(100px, 40vw, 150px);
    height: auto;
  }
  
  .greeting-content h1 {
    font-size: 1.25rem;
  }
  
  .greeting-content p {
    font-size: 0.9rem;
  }

  .chatbot-toggle {
    bottom: 30px;
    right: 30px;
    left: auto;
    transform: none;
    position: fixed !important;
    width: 65px;
    height: 65px;
    pointer-events: auto;
  }
  
  .premium-header {
    padding: 18px 20px;
  }
  
  .premium-content {
    padding-bottom: 20px;
  }
}

/* Landscape and safe areas */
@supports (padding: env(safe-area-inset-bottom)) {
  @media (max-width: 768px) {
    .premium-footer {
      padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
  }
}


/* --- NEW ANIMATION SEQUENCE --- */
.chatbot-container {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.chatbot-container.visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
.chatbot-toggle.breathing {
  animation: premiumBreathing 3s ease-in-out infinite;
}
@keyframes premiumBreathing {
  0%, 100% { transform: scale(1); box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.15); }
  50% { transform: scale(1.04); box-shadow: 0 0 30px 5px rgba(13, 91, 255, 0.12); }
}

/* Energy Trail - Sharp */
.chatbot-toggle::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 0;
  background: linear-gradient(to top, rgba(13, 91, 255, 0), #0D5BFF);
  opacity: 0;
  transition: all 0.3s;
  border-radius: 3px;
  z-index: -1;
}

.chatbot-container.launching .chatbot-toggle::after {
  height: 50px;
  opacity: 0.8;
}

/* Rocket Launch - Diagonal Move, Scale Zoom, No Rotation, No Blur */
.chatbot-container.launching {
  animation: rocketLaunchSequence 1.5s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}

@keyframes rocketLaunchSequence {
  0% { 
    transform: translate(0, 0) scale(0.7); 
    opacity: 0;
  }
  100% { 
    transform: translate(var(--target-x, -50px), var(--target-y, -250px)) scale(1.15); 
    opacity: 1;
  }
}

/* Settle Effect - Face user, no rotation */
.chatbot-container.settling {
  animation: settleSequence 0.4s ease-out forwards;
}

@keyframes settleSequence {
  0% { transform: translate(var(--target-x, -50px), var(--target-y, -250px)) scale(1.15); }
  100% { transform: translate(var(--target-x, -50px), var(--target-y, -250px)) scale(1); }
}

.chatbot-container.active {
  transform: translate(var(--target-x, -50px), var(--target-y, -250px));
}

.chatbot-container.launching .chatbot-toggle,
.chatbot-container.returning .chatbot-toggle,
.chatbot-container.settling .chatbot-toggle,
.chatbot-container.active .chatbot-toggle {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.chatbot-container.returning {
  animation: rocketReturn 1.2s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}
@keyframes rocketReturn {
  0% { transform: translate(var(--target-x, -50px), var(--target-y, -250px)) scale(1); }
  100% { transform: translate(0, 0) scale(1); }
}

/* Greeting Card - Centered Directly Above Robot */
.greeting-card {
  position: absolute;
  bottom: 85px; /* Position above robot */
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 340px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 24px;
  padding: 26px;
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  pointer-events: none;
  z-index: 10;
  text-align: center;
  will-change: transform, opacity;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

@media (max-width: 480px) {
  .greeting-card {
    width: 280px;
    padding: 18px;
    bottom: 75px;
  }
}
.greeting-card.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Wave Animation */
.arm-wave-twice {
  transform-origin: 150px 115px;
  animation: waveTwice 1.2s ease-in-out forwards;
}

@keyframes waveTwice {
  0%, 50%, 100% { transform: rotate(0deg); }
  25%, 75% { transform: rotate(-20deg); }
}

/* Subtle Infinite Floating & Head Tilt */
.robot-float-active { animation: robotFloatSubtle 4.5s ease-in-out infinite; }
@keyframes robotFloatSubtle {
  0%, 100% { transform: translateY(3px); }
  50% { transform: translateY(-3px); }
}
.robot-head-tilt { animation: headTiltSubtle 6s ease-in-out infinite; transform-origin: center 100px; }
@keyframes headTiltSubtle {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(2deg); }
}
.eye-blink { animation: enterpriseBlink 6s infinite; }
@keyframes enterpriseBlink {
  0%, 96%, 100% { transform: scaleY(1); }
  98% { transform: scaleY(0.1); }
}

