/**
 * KROT AI Hero Section
 * Main landing hero with animated background and card
 */

/* ==========================================================================
   Hero Base
   ========================================================================== */

#hero {
  width: 100%;
  min-height: 100vh;
  background: transparent;
  position: relative;
  overflow-x: clip; /* Prevent horizontal scroll from glow effects without creating scroll container */
  padding: 100px 0 60px; /* Minimal padding for header clearance */
}

/* ==========================================================================
   Animated Background Glows
   ========================================================================== */

#hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 70%;
  height: 140%;
  background: radial-gradient(ellipse at center, rgba(var(--krot-accent-rgb), 0.35) 0%, transparent 55%);
  animation: hero-glow-pulse 10s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

#hero::after {
  content: '';
  position: absolute;
  bottom: -60%;
  left: -15%;
  width: 60%;
  height: 120%;
  background: radial-gradient(ellipse at center, rgba(var(--krot-purple-rgb), 0.3) 0%, transparent 55%);
  animation: hero-glow-pulse 12s ease-in-out infinite reverse;
  pointer-events: none;
  z-index: 0;
}

@keyframes hero-glow-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Grid Pattern */
#hero .hero-bg-pattern {
  position: absolute;
  inset: 0;
  background-image: var(--krot-grid-pattern);
  background-size: 50px 50px;
  pointer-events: none;
}

#hero .container {
  position: relative;
  z-index: 2;
}

/* ==========================================================================
   Hero Text
   ========================================================================== */

#hero h1 {
  font-size: clamp(2.5rem, 5.5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

#hero h1 .highlight {
  background: var(--krot-gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
  display: inline-block;
}

/* Subtle underline glow effect */
#hero h1 .highlight::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: var(--krot-gradient-accent);
  opacity: 0.3;
  border-radius: 4px;
  z-index: -1;
  transform: translateY(-4px);
}

#hero .hero-subtitle {
  font-size: clamp(1.0625rem, 2vw, 1.375rem);
  line-height: 1.7;
  max-width: 560px;
  color: var(--bs-secondary-color);
}

/* Hero Benefits List */
#hero .hero-benefits {
  max-width: 560px;
  margin-bottom: 1rem;
}

#hero .hero-benefits li {
  font-size: clamp(1rem, 1.8vw, 1.125rem);
  line-height: 1.6;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

#hero .hero-benefits li i {
  flex-shrink: 0;
  margin-top: 0.2em;
}

/* Hero Description */
#hero .hero-description {
  font-size: clamp(0.9375rem, 1.6vw, 1.0625rem);
  line-height: 1.7;
  max-width: 560px;
  color: var(--bs-secondary-color);
  opacity: 0.9;
}

/* ==========================================================================
   Hero CTA Buttons
   ========================================================================== */

#hero .btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

#hero .btn-primary {
  background: var(--krot-gradient-accent);
  border: none;
  box-shadow: 0 10px 30px rgba(var(--krot-accent-rgb), 0.3);
}

#hero .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(var(--krot-accent-rgb), 0.4);
}

#hero .btn-outline-light {
  border-width: 1px;
  border-color: var(--bs-border-color);
  background: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
}

#hero .btn-outline-light:hover {
  background: var(--bs-secondary-bg);
  border-color: var(--bs-border-color);
  transform: translateY(-2px);
}

/* ==========================================================================
   Hero Badge (Skolkovo)
   ========================================================================== */

#hero .hero-badge {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
  color: var(--krot-accent);
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  font-size: 0.9375rem;
  font-weight: 600;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.1);
  transition: all 0.3s ease;
}

#hero .hero-badge:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.2);
  transform: translateY(-1px);
}

/* ==========================================================================
   Product Demo Animation - Main Layout
   ========================================================================== */

#hero .hero-demo {
  position: relative;
  padding: 1rem 0;
}

/* ==========================================================================
   Demo Card - Main Container
   ========================================================================== */

#hero .demo-card {
  background: var(--krot-glass-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 1.5rem;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--bs-box-shadow-lg);
}

/* Active step highlight */
#hero .demo-step.active {
  background: var(--krot-accent-bg-subtle);
  border: 1px solid var(--krot-accent-glow);
}

#hero .demo-step.active .demo-step-number {
  background: var(--krot-accent);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.2);
}

#hero .demo-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

#hero .demo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

#hero .demo-icon i {
  font-size: 1.25rem;
  color: #fff;
}

#hero .demo-title {
  flex-grow: 1;
}

#hero .demo-title h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

#hero .demo-title span {
  font-size: 1rem;
}

/* Demo Status Badge */
#hero .demo-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  border-radius: var(--bs-border-radius-pill);
  font-size: 1rem;
  font-weight: 500;
  background: rgba(var(--krot-accent-rgb), 0.15);
  color: var(--krot-accent);
  border: 1px solid rgba(var(--krot-accent-rgb), 0.3);
  transition: all 0.5s ease;
}

#hero .demo-status[data-status="complete"] {
  background: rgba(var(--bs-success-rgb), 0.15);
  color: var(--bs-success);
  border-color: rgba(var(--bs-success-rgb), 0.3);
}

#hero .demo-status .status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: status-pulse 2s ease-in-out infinite;
}

/* ==========================================================================
   Demo Progress Bar
   ========================================================================== */

#hero .demo-progress {
  height: 3px;
  background: rgba(var(--krot-accent-rgb), 0.15);
  border-radius: 2px;
  margin-bottom: 1.25rem;
  overflow: hidden;
}

#hero .demo-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--krot-gradient-accent);
  border-radius: 2px;
}

/* Progress bar animation - controlled by .animating class */
#hero .demo-progress-bar.animating {
  animation: progress-fill 5s linear forwards;
}

@keyframes progress-fill {
  from { width: 0%; }
  to { width: 100%; }
}

/* ==========================================================================
   Demo Steps - Animated Timeline
   ========================================================================== */

#hero .demo-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

#hero .demo-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.875rem 1rem;
  background: transparent;
  border-radius: var(--bs-border-radius);
  transition: all 0.4s ease;
  cursor: pointer;
  position: relative;
}

#hero .demo-step:hover {
  background: var(--bs-tertiary-bg);
}

/* Step Indicator (number + line) */
#hero .demo-step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

#hero .demo-step-number {
  width: 32px;
  height: 32px;
  background: var(--bs-tertiary-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  color: var(--bs-secondary-color);
  transition: all 0.4s ease;
  position: relative;
  z-index: 2;
}

#hero .demo-step-line {
  width: 2px;
  height: 24px;
  background: var(--bs-border-color);
  margin-top: 4px;
  transition: all 0.4s ease;
}

#hero .demo-step:last-child .demo-step-line {
  display: none;
}

/* Step Content */
#hero .demo-step-content {
  flex-grow: 1;
  padding-top: 4px;
}

#hero .demo-step-content strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.125rem;
  transition: color var(--krot-transition-base);
}

#hero .demo-step-content small {
  color: var(--bs-secondary-color);
  font-size: 1rem;
  transition: color var(--krot-transition-base);
}

/* Step Status (checkmark) */
#hero .demo-step-status {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
  transition: all 0.4s ease;
  color: var(--bs-success);
  margin-top: 4px;
}

#hero .demo-step-status i {
  font-size: 1rem;
}

/* ==========================================================================
   Demo Step States
   ========================================================================== */

/* Completed step */
#hero .demo-step.completed .demo-step-number {
  background: var(--bs-success);
  color: var(--bs-body-bg);
}

#hero .demo-step.completed .demo-step-line {
  background: var(--bs-success);
}

#hero .demo-step.completed .demo-step-status {
  opacity: 1;
  transform: scale(1);
}

/* Active step */
/* Active step highlight - Premium Look */
#hero .demo-step.active {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.05);
}

#hero .demo-step.active .demo-step-number {
  background: var(--krot-accent);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.25);
  animation: pulse-ring 2s ease-in-out infinite;
}

#hero .demo-step.active .demo-step-content strong {
  color: var(--krot-accent-light);
}

/* Step connector line */
#hero .demo-step-line {
  width: 2px;
  height: 100%;
  min-height: 20px;
  background: var(--bs-border-color);
  margin-top: 4px;
  transition: all 0.4s ease;
}

#hero .demo-step.completed .demo-step-line {
  background: var(--bs-success);
}

@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 4px rgba(var(--krot-accent-rgb), 0.2); }
  50% { box-shadow: 0 0 0 8px rgba(var(--krot-accent-rgb), 0.1); }
}

/* ==========================================================================
   Demo Floating Metrics - Scattered Layout
   ========================================================================== */

#hero .demo-metrics {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

#hero .demo-metric,
#hero .demo-badge {
  pointer-events: auto;
  position: absolute;
}

#hero .demo-metric {
  background: var(--krot-glass-bg-stronger);
  border: 1px solid var(--bs-border-color);
  border-radius: 1rem;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 140px;
  transition: all var(--krot-transition-base);
  box-shadow: var(--bs-box-shadow-lg);
}

#hero .demo-metric:hover {
  border-color: var(--krot-accent-glow);
  transform: translateY(-5px);
  box-shadow: var(--krot-shadow-glow-accent);
}

/* Time metric - Top Right */
#hero .demo-metric-time {
  top: -90px;
  right: -30px;
}

/* Depth metric - Bottom Right */
#hero .demo-metric-depth {
  bottom: 60px;
  right: -100px;
}

#hero .demo-metric:hover {
  border-color: var(--krot-accent-glow);
  box-shadow: var(--krot-shadow-glow-accent);
}

#hero .demo-metric i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

#hero .demo-metric-time i {
  color: var(--krot-accent);
}

#hero .demo-metric-depth i {
  color: var(--krot-purple);
}

#hero .demo-metric-value {
  font-family: var(--krot-font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  background: var(--krot-gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

#hero .demo-metric-depth .demo-metric-value {
  background: linear-gradient(135deg, var(--krot-purple) 0%, var(--krot-purple-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

#hero .demo-metric small {
  font-size: 1rem;
  color: var(--bs-secondary-color);
}

/* On-premise Badge - Bottom Left */
#hero .demo-badge {
  background: var(--krot-glass-bg);
  border: 1px solid rgba(var(--bs-success-rgb), 0.3);
  border-radius: var(--bs-border-radius-pill);
  padding: 0.625rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--bs-success);
  transition: all var(--krot-transition-base);
  /* Position: Bottom Left */
  bottom: -15px;
  left: -40px;
}

#hero .demo-badge:hover {
  border-color: var(--bs-success);
  box-shadow: 0 5px 20px rgba(var(--bs-success-rgb), 0.2);
}

#hero .demo-badge i {
  font-size: 1rem;
}

/* ==========================================================================
   Demo Floating Animations - Different directions for scattered effect
   ========================================================================== */

@keyframes float-top-right {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(5px, -8px); }
}

@keyframes float-bottom-right {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-5px, 6px); }
}

@keyframes float-bottom-left {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-6px, -5px); }
}

#hero .demo-metric-time {
  animation: float-top-right 5s ease-in-out infinite;
}

#hero .demo-metric-depth {
  animation: float-bottom-right 6s ease-in-out infinite;
  animation-delay: 1s;
}

#hero .demo-badge {
  animation: float-bottom-left 7s ease-in-out infinite;
  animation-delay: 2s;
}


/* ==========================================================================
   Staggered Step Entrance Animation
   ========================================================================== */

#hero .demo-step {
  opacity: 0;
  transform: translateX(-20px);
}

#hero .hero-demo.initialized .demo-step {
  opacity: 1;
  transform: translateX(0);
}

#hero .demo-step[data-step="1"] { transition-delay: 0.1s; }
#hero .demo-step[data-step="2"] { transition-delay: 0.2s; }
#hero .demo-step[data-step="3"] { transition-delay: 0.3s; }
#hero .demo-step[data-step="4"] { transition-delay: 0.4s; }

/* ==========================================================================
   Status Pulse Animation
   ========================================================================== */

@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ==========================================================================
   Hero Stats
   ========================================================================== */

#hero .hero-stats {
  margin-top: 1rem;
}

#hero .hero-stat .h2 {
  font-family: var(--krot-font-heading);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

#hero .hero-stat .text-body-secondary {
  font-size: 0.9375rem;
  line-height: 1.4;
  opacity: 0.8;
  max-width: 140px;
}

/* ==========================================================================
   Hero Responsive
   ========================================================================== */

@media (max-width: 991.98px) {
  #hero {
    padding: 100px 0 60px;
    min-height: auto;
    overflow: clip; /* Prevent floating elements from causing horizontal scroll */
  }

  #hero .hero-content {
    text-align: center;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  #hero .hero-subtitle {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  #hero .hero-cta {
    justify-content: center;
  }

  #hero .hero-stats {
    justify-content: center;
  }

  /* Demo tablet adjustments */
  #hero .hero-demo {
    max-width: 500px;
    margin: 0 auto;
  }

  #hero .demo-metrics {
    position: static;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    pointer-events: auto;
  }

  #hero .demo-metric,
  #hero .demo-badge {
    position: static;
    min-width: auto;
    animation: none;
  }

  #hero .demo-metric:hover,
  #hero .demo-badge:hover {
    transform: translateY(-5px);
  }
}

@media (max-width: 767.98px) {
  /* Demo card adjustments */
  #hero .demo-card {
    padding: 1.25rem;
  }

  #hero .demo-header {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  #hero .demo-status {
    margin-left: auto;
  }

  #hero .demo-step {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  #hero .demo-step-number {
    width: 28px;
    height: 28px;
    font-size: 1rem;
  }

  #hero .demo-step-content strong {
    font-size: 1rem;
  }

  #hero .demo-step-content small {
    font-size: 1rem;
  }

  #hero .demo-metrics {
    gap: 0.75rem;
  }

  #hero .demo-metric {
    padding: 0.875rem 1rem;
  }
}

@media (max-width: 575.98px) {
  /* Отступы от краёв экрана */
  #hero .hero-content {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  /* Увеличенный line-height для читаемости */
  #hero h1 {
    line-height: 1.35;
  }

  #hero .hero-subtitle {
    line-height: 1.8;
  }

  /* CTA кнопки вертикально и на всю ширину */
  #hero .hero-cta > div:first-child {
    flex-direction: column;
    width: 100%;
  }

  #hero .hero-cta .btn {
    width: 100%;
    justify-content: center;
  }

  #hero .btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }

  #hero .demo-card {
    padding: 1rem;
  }

  #hero .demo-icon {
    width: 40px;
    height: 40px;
  }

  #hero .demo-icon i {
    font-size: 1.25rem;
  }

  #hero .demo-title h4 {
    font-size: 0.9375rem;
  }

  #hero .demo-title span {
    font-size: 1rem;
  }

  #hero .demo-status {
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
  }

  #hero .demo-step-line {
    height: 16px;
  }

  #hero .demo-metric-value {
    font-size: 1.125rem;
  }

  #hero .demo-metric i {
    font-size: 1.25rem;
  }

  #hero .demo-badge {
    font-size: 1rem;
  }
}

/* ==========================================================================
   Accessibility: Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  #hero::before,
  #hero::after,
  #hero .demo-metric,
  #hero .demo-badge,
  #hero .demo-status .status-indicator,
  #hero .demo-step.active .demo-step-number {
    animation: none;
  }

  #hero .demo-card:hover,
  #hero .demo-metric:hover,
  #hero .demo-badge:hover,
  #hero .demo-step:hover {
    transform: none;
  }

  #hero .demo-step {
    opacity: 1;
    transform: none;
  }

  #hero .hero-demo.running .demo-progress-bar {
    animation: none;
    width: 100%;
  }
}
