/*
 * 8:28 Solutions - Hero Section Animations
 * Animated dashboard visualization with flowing particles
 */

/* ===================================
   HERO SECTION LAYOUT & BACKGROUND
   =================================== */

.hero {
  position: relative;
  min-height: 600px;
  overflow: hidden;

  /* Gradient background */
  background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 100%);

  /* Subtle dot grid pattern */
  background-image:
    radial-gradient(circle, rgba(0, 102, 204, 0.08) 2px, transparent 2px),
    linear-gradient(135deg, #f8fafc 0%, #e0f2fe 100%);
  background-size: 24px 24px, 100% 100%;
  background-position: 0 0, 0 0;
}

[data-theme="dark"] .hero {
  background: linear-gradient(135deg, #1A1A1A 0%, #2A2A2A 100%);
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.05) 2px, transparent 2px),
    linear-gradient(135deg, #1A1A1A 0%, #2A2A2A 100%);
  background-size: 24px 24px, 100% 100%};
}

.hero__container {
  display: grid;
  grid-template-columns: 40% 60%;
  gap: 4rem;
  align-items: center;
  min-height: 600px;
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.hero__content {
  max-width: 600px;
}

.hero__title {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--color-text-primary, #0f172a);
}

.hero__subtitle {
  font-size: clamp(1.125rem, 2vw, 1.25rem);
  line-height: 1.6;
  margin-bottom: 2rem;
  color: var(--color-text-secondary, #475569);
}

.hero__cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ===================================
   DASHBOARD VISUALIZATION CONTAINER
   =================================== */

.hero__visualization {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dashboard-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  height: 600px;
}

.dashboard-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ===================================
   WORKFLOW NODES ANIMATIONS
   =================================== */

.dashboard-node {
  transform-origin: center;
  animation: nodePulse 3s ease-in-out infinite;
}

/* Staggered pulse timing for wave effect */
.dashboard-node--1 {
  animation-delay: 0s;
}

.dashboard-node--2 {
  animation-delay: 0.15s;
}

.dashboard-node--3 {
  animation-delay: 0.3s;
}

.dashboard-node--4 {
  animation-delay: 0.45s;
}

.dashboard-node--5 {
  animation-delay: 0.6s;
}

@keyframes nodePulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.95;
  }
}

/* ===================================
   CONNECTION LINES DRAW-IN ANIMATION
   =================================== */

.connection-line {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawLine 0.8s ease-out forwards;
}

.connection-lines path:nth-child(1) {
  animation-delay: 0.6s;
}

.connection-lines path:nth-child(2) {
  animation-delay: 0.75s;
}

.connection-lines path:nth-child(3) {
  animation-delay: 0.9s;
}

.connection-lines path:nth-child(4) {
  animation-delay: 1.05s;
}

@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

/* ===================================
   FLOATING METRIC CARDS
   =================================== */

.dashboard-metrics {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.metric-card {
  position: absolute;
  width: 160px;
  height: 100px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;

  /* Entrance animation */
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease-out forwards;
}

[data-theme="dark"] .metric-card {
  background: rgba(42, 42, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Card positions */
.metric-card--1 {
  top: 15%;
  left: 15%;
  animation-delay: 1.2s;
}

.metric-card--2 {
  top: 15%;
  right: 20%;
  animation-delay: 1.4s;
}

.metric-card--3 {
  bottom: 15%;
  right: 10%;
  animation-delay: 1.6s;
}

/* Card content */
.metric-card__value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.5rem;
  font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
}

.metric-card--1 .metric-card__value {
  color: #FF6B35;
}

.metric-card--1 .metric-card__value::after {
  content: '%';
  font-size: 1.5rem;
}

.metric-card--2 .metric-card__value {
  color: #00B4D8;
}

.metric-card--3 .metric-card__value {
  color: #0066CC;
}

.metric-card--3 .metric-card__value::before {
  content: '$';
  font-size: 1.5rem;
}

.metric-card__label {
  font-size: 0.875rem;
  color: var(--color-text-secondary, #475569);
  font-weight: 500;
}

[data-theme="dark"] .metric-card__label {
  color: #A0A0A0;
}

/* Continuous floating animation */
.metric-card--1 {
  animation: fadeInUp 0.6s ease-out 1.2s forwards,
             float1 4s ease-in-out infinite 1.8s;
}

.metric-card--2 {
  animation: fadeInUp 0.6s ease-out 1.4s forwards,
             float2 5s ease-in-out infinite 2s;
}

.metric-card--3 {
  animation: fadeInUp 0.6s ease-out 1.6s forwards,
             float3 4.5s ease-in-out infinite 2.2s;
}

@keyframes float1 {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes float2 {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes float3 {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* ===================================
   ENTRANCE ANIMATIONS (HERO CONTENT)
   =================================== */

.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease-out forwards;
}

.fade-in-right {
  opacity: 0;
  transform: translateX(50px);
  animation: fadeInRight 0.6s ease-out forwards;
}

.delay-100 {
  animation-delay: 0.1s;
}

.delay-200 {
  animation-delay: 0.2s;
}

.delay-300 {
  animation-delay: 0.3s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInRight {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===================================
   RESPONSIVE BREAKPOINTS
   =================================== */

@media (max-width: 1023px) {
  .hero__container {
    grid-template-columns: 45% 55%;
    gap: 2rem;
  }

  .dashboard-container {
    height: 500px;
  }

  .metric-card {
    width: 140px;
    height: 90px;
    padding: 0.75rem;
  }

  .metric-card__value {
    font-size: 1.75rem;
  }

  .metric-card__label {
    font-size: 0.75rem;
  }
}

@media (max-width: 767px) {
  .hero {
    min-height: auto;
  }

  .hero__container {
    grid-template-columns: 1fr;
    gap: 3rem;
    min-height: auto;
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  .hero__content {
    max-width: 100%;
  }

  .hero__cta {
    flex-direction: column;
  }

  .hero__cta .btn {
    width: 100%;
    text-align: center;
  }

  .dashboard-container {
    height: 400px;
  }

  /* Hide middle card on mobile */
  .metric-card--2 {
    display: none;
  }

  /* Adjust remaining card positions for mobile */
  .metric-card--1 {
    top: 10%;
    left: 5%;
  }

  .metric-card--3 {
    bottom: 10%;
    right: 5%;
  }

  /* Reduce float distance on mobile */
  @keyframes float1 {
    0%, 100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-5px);
    }
  }

  @keyframes float3 {
    0%, 100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-5px);
    }
  }

  /* Scale down nodes for mobile */
  .dashboard-node {
    transform: scale(0.75);
    transform-origin: center;
  }
}

/* ===================================
   ACCESSIBILITY: REDUCED MOTION
   =================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .fade-in-up,
  .fade-in-right,
  .dashboard-node,
  .metric-card,
  .data-particle,
  .connection-line {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }

  .connection-line {
    stroke-dasharray: none !important;
    stroke-dashoffset: 0 !important;
  }

  /* Hide particles entirely for reduced motion */
  .data-particles {
    display: none;
  }
}

/* ===================================
   PERFORMANCE OPTIMIZATIONS
   =================================== */

.dashboard-node,
.metric-card,
.data-particle {
  will-change: transform, opacity;
}

/* Remove will-change after animations complete */
.dashboard-node.animation-complete,
.metric-card.animation-complete {
  will-change: auto;
}
