/**
 * Andromeda Agents - 2025 Hero Section Styles
 * Features: CSS Grid, Container Queries, Advanced Animations, GPU Acceleration
 */

/* Modern CSS Reset and Performance Optimizations */
* {
  box-sizing: border-box;
}

.hero-section {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #0f172a 0%, #020617 100%);
  display: grid;
  place-items: center;
  z-index: 1; /* Base layer */
  
  /* Performance optimizations */
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 3D Canvas Background */
#hero-3d-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50 !important; /* Much higher to ensure visibility */
  pointer-events: none;
}

/* Enhanced Container with Modern Layout */
.hero-content {
  position: relative;
  z-index: 100 !important; /* Much higher to stay above particles */
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  
  /* Container query support */
  container-type: inline-size;
}

/* Left Column - Text Content */
.hero-text {
  position: relative;
  z-index: 20; /* Ensure text is on top */
}

/* Force text visibility */
.hero-title, .hero-subtitle {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

/* Launch Badge with Advanced Styling */
.launch-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  margin-bottom: 2rem;
  
  /* Advanced background with backdrop filter */
  background: linear-gradient(135deg, 
    rgba(99, 102, 241, 0.15) 0%, 
    rgba(139, 92, 246, 0.1) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 50px;
  
  /* Typography */
  font-size: 0.875rem;
  font-weight: 600;
  color: #a5b4fc;
  letter-spacing: 0.025em;
  
  /* Animation */
  animation: badgeFloat 4s ease-in-out infinite;
  
  /* Modern shadow */
  box-shadow: 
    0 8px 32px rgba(99, 102, 241, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Pulse Dot Animation */
.pulse-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  position: relative;
  
  /* Pulse animation */
  animation: pulseGlow 2s ease-in-out infinite;
}

.pulse-dot::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  width: 12px;
  height: 12px;
  background: inherit;
  border-radius: 50%;
  opacity: 0.4;
  animation: pulseBeat 2s ease-in-out infinite;
}

/* Hero Title - Clean and Readable */
.hero-title {
  /* Desktop-first sizing; smaller clamp to avoid overflow on mobile */
  font-size: clamp(2.75rem, 6vw, 4.25rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 2rem;
  color: #ffffff;
  
  /* Clean gradient text that works */
  background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  
  /* Fallback for browsers that don't support background-clip */
  color: #ffffff;
  
  /* Subtle text shadow for depth */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Highlight Text with Special Effects */
.highlight {
  position: relative;
  display: inline-block;
  
  /* Glowing effect */
  text-shadow: 
    0 0 20px rgba(99, 102, 241, 0.5),
    0 0 40px rgba(99, 102, 241, 0.3),
    0 0 60px rgba(99, 102, 241, 0.1);
}

/* Removed: highlight underline animation that was overlapping with subtitle */

/* Hero Subtitle - Larger and More Readable */
.hero-subtitle {
  font-size: 1.5rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 3rem;
  max-width: 640px;
  
  /* Clean, readable typography */
  font-weight: 400;
  letter-spacing: 0.005em;
}

/* CTA Section with Modern Form */
.cta-section {
  position: relative;
}

/* Value Proposition Styling */
.value-proposition {
  margin-bottom: 2rem;
}

.value-offer {
  font-size: 1.1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 0;
  text-align: center;
  font-weight: 500;
}

.premium-form {
  position: relative;
}

.input-container {
  display: flex;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 16px;
  padding: 0.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.input-container:focus-within {
  border-color: #6366f1;
  box-shadow: 
    0 0 0 4px rgba(99, 102, 241, 0.1),
    0 8px 32px rgba(99, 102, 241, 0.2);
  transform: translateY(-2px);
}

.input-container input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 1rem 1.5rem;
  color: white;
  font-size: 1rem;
  font-weight: 500;
}

.input-container input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.input-container button {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border: none;
  border-radius: 12px;
  padding: 1rem 2rem;
  color: white;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.input-container button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%);
  transition: left 0.6s ease;
}

.input-container button:hover::before {
  left: 100%;
}

.input-container button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(99, 102, 241, 0.4);
}

.input-container button:active {
  transform: translateY(0);
}

/* Right Column - Interactive Showcase */
.conversation-showcase {
  position: relative;
  perspective: 1000px;
  animation: showcaseFloat 6s ease-in-out infinite;
}

.device-frame {
  background: linear-gradient(145deg, 
    rgba(30, 41, 59, 0.9) 0%,
    rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 24px;
  padding: 1.5rem;
  backdrop-filter: blur(20px);
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  
  /* 3D Transform */
  transform: rotateX(5deg) rotateY(-5deg);
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.device-frame:hover {
  transform: rotateX(0deg) rotateY(0deg) scale(1.02);
}

.device-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.device-controls {
  display: flex;
  gap: 0.5rem;
}

.control-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.control-dot:nth-child(2) {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.control-dot:nth-child(3) {
  background: linear-gradient(135deg, #10b981, #059669);
}

.device-title {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Voice Visualizer */
.voice-visualizer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 2rem;
  height: 60px;
}

.visualizer-bar {
  width: 4px;
  background: linear-gradient(to top, #6366f1, #8b5cf6);
  border-radius: 2px;
  animation: audioWave 1.5s ease-in-out infinite;
}

.visualizer-bar:nth-child(1) { animation-delay: 0s; height: 20px; }
.visualizer-bar:nth-child(2) { animation-delay: 0.1s; height: 35px; }
.visualizer-bar:nth-child(3) { animation-delay: 0.2s; height: 50px; }
.visualizer-bar:nth-child(4) { animation-delay: 0.3s; height: 30px; }
.visualizer-bar:nth-child(5) { animation-delay: 0.4s; height: 25px; }

/* Conversation Messages */
.conversation-transcript {
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
}

.message {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: messageSlideIn 0.6s ease-out forwards;
}

.message:nth-child(1) { animation-delay: 2s; }
.message:nth-child(2) { animation-delay: 3s; }
.message:nth-child(3) { animation-delay: 4s; }

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}

.customer-avatar {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.agent-avatar {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.message-content {
  flex: 1;
}

.message-sender {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.25rem;
}

.message-text {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Keyframe Animations */
@keyframes badgeFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-4px); }
}

@keyframes pulseGlow {
  0%, 100% { 
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
  }
  50% { 
    box-shadow: 0 0 16px rgba(16, 185, 129, 1),
                0 0 24px rgba(16, 185, 129, 0.5);
  }
}

@keyframes pulseBeat {
  0% { 
    transform: scale(1);
    opacity: 0.4;
  }
  50% { 
    transform: scale(1.5);
    opacity: 0.1;
  }
  100% { 
    transform: scale(2);
    opacity: 0;
  }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Removed: underlineExpand animation */

@keyframes showcaseFloat {
  0%, 100% { transform: translateY(0px) rotateX(5deg) rotateY(-5deg); }
  33% { transform: translateY(-8px) rotateX(3deg) rotateY(-3deg); }
  66% { transform: translateY(4px) rotateX(7deg) rotateY(-7deg); }
}

@keyframes audioWave {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}

@keyframes messageSlideIn {
  from { 
    opacity: 0;
    transform: translateX(-30px);
  }
  to { 
    opacity: 1;
    transform: translateX(0);
  }
}

/* Container Queries for Advanced Responsive Design */
@container (max-width: 900px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }
  
  .hero-title {
    font-size: clamp(2.2rem, 5.5vw, 3.2rem);
  }
  
  .device-frame {
    max-width: 400px;
    margin: 0 auto;
  }
}

/* Responsive Design with Modern Approach */
@media (max-width: 768px) {
  .hero-section {
    min-height: 100svh; /* Use small viewport height */
    padding: 88px 0 56px; /* Reduce top/bottom padding on small screens */
  }
  
  .hero-content {
    grid-template-columns: 1fr !important; /* Single column layout on mobile */
    padding: 1.5rem;
    gap: 2rem;
  }
  
  /* Better mobile typography */
  .hero-title {
    font-size: clamp(1.75rem, 6.8vw, 2.25rem);
    line-height: 1.25;
    margin-bottom: 1.25rem;
  }

  .hero-title br { display: none; }

  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 1.25rem;
  }

  .launch-badge {
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
  }

  /* Critical: Fix email form layout for mobile */
  .input-container { 
    flex-direction: column !important;
    gap: 0.75rem !important; 
    padding: 0.75rem !important;
    background: rgba(15, 23, 42, 0.9) !important;
  }
  
  .input-container input {
    min-height: 48px !important; /* Touch target compliance */
    padding: 1rem 1.5rem !important;
    font-size: 16px !important; /* Prevents iOS zoom */
    width: 100% !important;
  }
  
  .input-container button { 
    min-height: 48px !important; /* Touch target compliance */
    padding: 1rem 2rem !important;
    width: 100% !important;
    justify-content: center !important;
    font-size: 1rem !important;
    white-space: nowrap !important;
  }
  
  /* Disable complex animations on mobile for performance */
  @media (prefers-reduced-motion: reduce) {
    * {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }
}

/* High refresh rate displays */
@media (min-resolution: 120dpi) {
  .hero-title {
    text-rendering: optimizeLegibility;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .hero-section {
    color-scheme: dark;
  }
}

/* Mobile performance: hide heavy canvas effects */
@media (max-width: 768px) {
  #hero-3d-canvas { display: none !important; }
}
