/* ==========================================================================
   HydroBot — Precision Design System & Interactive FX
   ========================================================================== */

:root {
  --bg: #000000;
  --fg: #f4f4f5;
  --fg-muted: #8e8e96;
  --line: #26262a;
  --raised: #1c1c1f;
  --window: #0b0b0c;
  --chat-bg: #100f11;
  --accent: #f4f4f5;
  --bot-glow: rgba(42, 168, 240, 0.22);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   Browser Surfaces Theming (Text selection & Scrollbars)
   -------------------------------------------------------------------------- */
::selection {
  background: rgba(42, 168, 240, 0.28);
  color: #ffffff;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #26262a;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3f3f46;
}

/* --------------------------------------------------------------------------
   Background Ambient Living Canvas & Light Rays
   -------------------------------------------------------------------------- */
#ambient-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

.ambient-dot-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1100px;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 25%, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 25%, black 40%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

.hero-light-beam {
  position: absolute;
  top: -140px;
  left: 50%;
  transform: translateX(-50%);
  width: 720px;
  height: 520px;
  background: radial-gradient(ellipse at 50% 0%, rgba(42, 168, 240, 0.16) 0%, rgba(42, 168, 240, 0.05) 50%, transparent 80%);
  filter: blur(50px);
  pointer-events: none;
  z-index: 1;
  animation: beamPulse 8s ease-in-out infinite alternate;
}

@keyframes beamPulse {
  0% { opacity: 0.6; transform: translateX(-50%) scale(0.95); }
  100% { opacity: 1; transform: translateX(-50%) scale(1.08); }
}

/* --------------------------------------------------------------------------
   Dynamic Desktop Window Ambient Glow
   -------------------------------------------------------------------------- */
.window-ambient-glow {
  position: absolute;
  inset: -50px -60px;
  background: radial-gradient(circle at 50% 30%, var(--bot-glow, rgba(42, 168, 240, 0.22)) 0%, transparent 68%);
  filter: blur(65px);
  pointer-events: none;
  z-index: 0;
  transition: background 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s ease;
  opacity: 0.95;
  animation: glowBreathe 7s ease-in-out infinite alternate;
}

@keyframes glowBreathe {
  0% { transform: scale(0.96); opacity: 0.8; }
  100% { transform: scale(1.04); opacity: 1; }
}

/* --------------------------------------------------------------------------
   Mascot Shelf & Slower 3D Float Animation
   -------------------------------------------------------------------------- */
.mascots-header-shelf {
  position: relative;
  perspective: 900px;
  z-index: 10;
}

.mascot-avatar-btn {
  position: relative;
  background: transparent;
  border: none;
  padding: 6px;
  cursor: pointer;
  outline: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  will-change: transform;
}

.mascot-avatar-btn.active-shelf-mascot::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 16px;
  height: 2px;
  background: var(--fg);
  border-radius: 999px;
  animation: pulseIndicator 3s infinite ease-in-out;
}

@keyframes pulseIndicator {
  0%, 100% { opacity: 0.5; transform: scaleX(0.8); }
  50% { opacity: 1; transform: scaleX(1.3); }
}

.mascot-puddle {
  position: absolute;
  bottom: 2px;
  width: 38px;
  height: 10px;
  border-radius: 50%;
  filter: blur(6px);
  opacity: 0.35;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.mascot-avatar-btn:hover .mascot-puddle {
  opacity: 0.9;
}

.mascot-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  background: #1c1c1f;
  color: #f4f4f5;
  border: 1px solid #26262a;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7);
  z-index: 30;
}

.mascot-avatar-btn:hover .mascot-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Slower, observable aquatic float (6.5s) */
.mascot-img {
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.7));
  animation: floatBob 6.5s ease-in-out infinite;
  transition: filter 0.3s ease;
  will-change: transform;
}

.mascot-avatar-btn:nth-child(1) .mascot-img { animation-delay: 0s; }
.mascot-avatar-btn:nth-child(2) .mascot-img { animation-delay: 1.1s; }
.mascot-avatar-btn:nth-child(3) .mascot-img { animation-delay: 2.2s; }
.mascot-avatar-btn:nth-child(4) .mascot-img { animation-delay: 3.3s; }
.mascot-avatar-btn:nth-child(5) .mascot-img { animation-delay: 4.4s; }
.mascot-avatar-btn:nth-child(6) .mascot-img { animation-delay: 5.5s; }

@keyframes floatBob {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  33% {
    transform: translateY(-8px) rotate(1.4deg);
  }
  66% {
    transform: translateY(-4px) rotate(-1.4deg);
  }
}

.mascot-avatar-btn:hover .mascot-img {
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.85));
}

/* --------------------------------------------------------------------------
   Product Updates Marquee Ticker
   -------------------------------------------------------------------------- */
.agent-ticker-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 680px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(11, 11, 14, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 6px 16px;
  font-size: 11.5px;
  color: var(--fg-muted);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  user-select: none;
}

.agent-ticker-wrap:hover .agent-ticker-track {
  animation-play-state: paused;
}

.agent-ticker-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 10px;
  color: #2AA8F0;
  flex-shrink: 0;
  padding-right: 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.agent-ticker-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2AA8F0;
  box-shadow: 0 0 8px #2AA8F0;
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.2); }
}

.ticker-scroll-container {
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent 0%, black 14px, black calc(100% - 14px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 14px, black calc(100% - 14px), transparent 100%);
}

.agent-ticker-track {
  display: flex;
  align-items: center;
  width: max-content;
  white-space: nowrap;
  animation: marqueeCycle 35s linear infinite;
  will-change: transform;
}

.agent-ticker-group {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.ticker-tag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(42, 168, 240, 0.15);
  border: 1px solid rgba(42, 168, 240, 0.3);
  color: #2AA8F0;
  font-size: 9.5px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  margin-right: 4px;
}

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

/* --------------------------------------------------------------------------
   Interactive Simulation App Window
   -------------------------------------------------------------------------- */
.desktop-app-window {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.09), 0 25px 70px -10px rgba(0, 0, 0, 0.95), 0 0 90px -20px var(--bot-glow);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: box-shadow 0.6s ease;
}

.bot-row-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  outline: none;
  width: 100%;
}

.bot-row-btn:hover {
  background: rgba(255, 255, 255, 0.04);
}

.bot-row-btn.active {
  background: var(--raised) !important;
}

/* Chat Transcript */
.chat-row-user {
  align-self: flex-end;
  background: var(--raised);
  color: var(--fg);
  padding: 10px 16px;
  border-radius: 18px;
  font-size: 13px;
  max-width: 85%;
  line-height: 1.5;
  animation: fadeSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tool-steps-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-self: flex-start;
  max-width: 85%;
}

.tool-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: rgba(28, 28, 31, 0.6);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  animation: fadeSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.3s ease;
}

.tool-step-pill.completed {
  border-color: rgba(0, 153, 87, 0.3);
  color: #e4e4e7;
  background: rgba(0, 153, 87, 0.06);
}

.step-spinner {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1.8px solid #009957;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spinStep 0.9s linear infinite;
}

@keyframes spinStep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.tool-step-arrow {
  font-size: 10px;
  color: #009957;
}

.chat-row-bot {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  align-self: flex-start;
  max-width: 88%;
  animation: fadeSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.bot-reply-bubble {
  background: var(--raised);
  color: var(--fg);
  padding: 13px 18px;
  border-radius: 18px;
  font-size: 13px;
  line-height: 1.6;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.typewriter-cursor {
  display: inline-block;
  width: 6px;
  height: 14px;
  background: #2AA8F0;
  vertical-align: middle;
  margin-left: 3px;
  animation: blinkCursor 0.9s infinite;
}

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

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Voice Call Overlay Mode (Slower, relaxing wave cadence)
   -------------------------------------------------------------------------- */
.voice-call-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 24px;
  text-align: center;
  animation: fadeSlideUp 0.4s ease;
}

.voice-call-avatar-wrap {
  position: relative;
  margin-bottom: 22px;
}

.voice-call-wave-ring {
  position: absolute;
  inset: -12px;
  border: 1.5px solid var(--bot-glow, #2AA8F0);
  border-radius: 50%;
  animation: waveRing 3.5s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.voice-call-wave-ring:nth-child(2) {
  inset: -24px;
  animation-delay: 1.2s;
}

@keyframes waveRing {
  0% { transform: scale(0.85); opacity: 0.85; }
  100% { transform: scale(1.4); opacity: 0; }
}

.voice-waveform-canvas {
  width: 260px;
  height: 52px;
  margin: 18px 0;
}

/* --------------------------------------------------------------------------
   Bot Computer / Terminal Overlay Mode
   -------------------------------------------------------------------------- */
.terminal-overlay {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #09090b;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 14px 16px;
  color: #a1a1aa;
  overflow: hidden;
  animation: fadeSlideUp 0.3s ease;
}

.terminal-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid #1c1c1f;
  margin-bottom: 10px;
  color: #71717a;
  font-size: 11px;
}

.terminal-log-output {
  flex: 1;
  overflow-y: auto;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

.terminal-prompt-line {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid #1c1c1f;
}

/* --------------------------------------------------------------------------
   Translucent Glass Spotlight Cards
   -------------------------------------------------------------------------- */
.spotlight-card {
  position: relative;
  background: rgba(11, 11, 14, 0.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.spotlight-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.7);
}

.spotlight-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(460px circle at var(--mouse-x, -200px) var(--mouse-y, -200px), rgba(255, 255, 255, 0.18), transparent 45%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.spotlight-card:hover::before {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Droplet Ripple Particle Effect (Slower, gentle expansion)
   -------------------------------------------------------------------------- */
.droplet-ripple {
  position: fixed;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  border: 1.5px solid var(--ripple-color, rgba(42, 168, 240, 0.6));
  background: radial-gradient(circle, var(--ripple-color, rgba(42, 168, 240, 0.2)) 0%, transparent 70%);
  pointer-events: none;
  animation: rippleWave 1.1s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
  z-index: 9999;
}

@keyframes rippleWave {
  to {
    transform: translate(-50%, -50%) scale(1.6);
    opacity: 0;
  }
}

/* --------------------------------------------------------------------------
   Interactive Name Chip Presets (Feature 1)
   -------------------------------------------------------------------------- */
.role-chip {
  background: #1c1c1f;
  border: 1px solid #26262a;
  color: #8e8e96;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.role-chip:hover {
  color: #f4f4f5;
  border-color: #3f3f46;
}

.role-chip.active {
  background: rgba(42, 168, 240, 0.15);
  border-color: #2AA8F0;
  color: #2AA8F0;
}

/* Code Highlights in Chat */
code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15em 0.35em;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .mascot-img, .voice-call-wave-ring, .agent-ticker-track, .agent-ticker-text, .window-ambient-glow, .hero-light-beam {
    animation: none !important;
    transition: none !important;
  }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .chat-row-user, .chat-row-bot, .tool-steps-group {
    max-width: 95%;
  }
}

/* ==========================================================================
   Language Switcher Component
   ========================================================================== */
.lang-switch-wrap {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 10px;
  border-radius: 9999px;
  border: 1px solid var(--line);
  background: rgba(28, 28, 31, 0.45);
  backdrop-filter: blur(8px);
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.lang-switch-wrap:hover {
  border-color: #3f3f46;
  background: rgba(28, 28, 31, 0.8);
}

.lang-btn {
  color: var(--fg-muted);
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.15s ease;
}

.lang-btn:hover {
  color: var(--fg);
}

.lang-btn.active {
  color: #000000;
  background: #f4f4f5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.lang-divider {
  color: #3f3f46;
  user-select: none;
  font-size: 11px;
}

.mobile-lang-btn {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.15s ease;
}

.mobile-lang-btn:hover {
  color: var(--fg);
  border-color: #3f3f46;
}

.mobile-lang-btn.active {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
  font-weight: 600;
}

