/* ==========================================================================
   HERO.CSS — Full-viewport Hero Section
   Animated gradient, floating cards, parallax, typing, counters
   ========================================================================== */

/* ---------- Hero Section ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-height) + var(--space-12)) 0 var(--space-16);
  overflow: hidden;
  background: var(--gradient-hero);
}

/* Animated Gradient Background */
.hero__bg {
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
  z-index: 0;
}

.hero__bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(var(--color-primary-rgb), 0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(var(--color-secondary-rgb), 0.1) 0%, transparent 50%),
    radial-gradient(circle at 60% 80%, rgba(var(--color-accent-rgb), 0.08) 0%, transparent 50%);
  animation: heroGradientShift 12s ease-in-out infinite alternate;
}

@keyframes heroGradientShift {
  0% {
    transform: scale(1) translate(0, 0);
  }
  50% {
    transform: scale(1.05) translate(-2%, 1%);
  }
  100% {
    transform: scale(1) translate(1%, -1%);
  }
}

/* ---------- Hero Content ---------- */
.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
  align-items: center;
}

.hero__content {
  text-align: center;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(var(--color-primary-rgb), 0.08);
  border: 1px solid rgba(var(--color-primary-rgb), 0.15);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--color-primary);
  margin-bottom: var(--space-6);
}

.hero__badge svg {
  width: 16px;
  height: 16px;
}

.hero__title {
  font-size: var(--text-6xl);
  font-weight: var(--fw-extrabold);
  line-height: var(--lh-tight);
  margin-bottom: var(--space-6);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero__title .highlight {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Typing Animation */
.hero__typing {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  font-size: var(--text-2xl);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  min-height: 2.5em;
}

.hero__typing-prefix {
  color: var(--text-tertiary);
}

.hero__typing-text {
  color: var(--color-primary);
  position: relative;
}

.hero__typing-text::after {
  content: '|';
  animation: cursorBlink 1s step-end infinite;
  color: var(--color-primary);
  margin-left: 2px;
}

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

.hero__desc {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-8);
  line-height: var(--lh-relaxed);
}

/* Hero Buttons */
.hero__buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-10);
}

@media (max-width: 576px) {
  .hero__buttons {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
    gap: var(--space-2);
  }
  .hero__buttons .btn {
    width: 100%;
    margin-left: 0 !important;
  }
}

/* ---------- Hero Visual / Illustration Side ---------- */
.hero__visual {
  display: none;
  position: relative;
  justify-content: center;
  align-items: center;
}

/* Dashboard Illustration Container */
.hero__dashboard {
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 4 / 3;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-xl);
}

/* Floating Analytics Cards */
.hero__float-card {
  position: absolute;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-base);
}

.hero__float-card:nth-child(1) {
  top: -10%;
  right: -8%;
  animation: float 6s ease-in-out infinite;
}

.hero__float-card:nth-child(2) {
  bottom: -8%;
  left: -8%;
  animation: float 8s ease-in-out infinite 1s;
}

.hero__float-card:nth-child(3) {
  top: 40%;
  right: -15%;
  animation: float 7s ease-in-out infinite 2s;
}

.hero__float-card__label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  margin-bottom: var(--space-1);
}

.hero__float-card__value {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
}

.hero__float-card__value.positive {
  color: var(--color-success);
}

.hero__float-card__mini-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  margin-top: var(--space-2);
  height: 30px;
}

.hero__float-card__mini-chart span {
  width: 6px;
  border-radius: 2px;
  background: var(--gradient-primary);
  opacity: 0.6;
}

/* Dashboard Inner Elements */
.hero__dashboard-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.hero__dashboard-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
}

.hero__dashboard-dot:nth-child(1) { background: #ef4444; }
.hero__dashboard-dot:nth-child(2) { background: #f59e0b; }
.hero__dashboard-dot:nth-child(3) { background: #10b981; }

.hero__dashboard-chart {
  width: 100%;
  height: 60%;
  background: var(--bg-section);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.hero__dashboard-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 100%;
  padding: var(--space-4);
}

.hero__dashboard-bar {
  flex: 1;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  animation: barGrow 2s ease-out forwards;
  opacity: 0.7;
}

.hero__dashboard-bar:nth-child(1) { height: 60%; animation-delay: 0.1s; }
.hero__dashboard-bar:nth-child(2) { height: 85%; animation-delay: 0.2s; }
.hero__dashboard-bar:nth-child(3) { height: 45%; animation-delay: 0.3s; }
.hero__dashboard-bar:nth-child(4) { height: 70%; animation-delay: 0.4s; }
.hero__dashboard-bar:nth-child(5) { height: 90%; animation-delay: 0.5s; }
.hero__dashboard-bar:nth-child(6) { height: 55%; animation-delay: 0.6s; }
.hero__dashboard-bar:nth-child(7) { height: 75%; animation-delay: 0.7s; }
.hero__dashboard-bar:nth-child(8) { height: 95%; animation-delay: 0.8s; }

@keyframes barGrow {
  0% { transform: scaleY(0); transform-origin: bottom; }
  100% { transform: scaleY(1); transform-origin: bottom; }
}

.hero__dashboard-stats {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.hero__dashboard-stat {
  flex: 1;
  background: var(--bg-section);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  text-align: center;
}

.hero__dashboard-stat__value {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--fw-bold);
  color: var(--color-primary);
}

.hero__dashboard-stat__label {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Floating Shapes ---------- */
.hero__shapes {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero__shape {
  position: absolute;
  border-radius: var(--radius-full);
  opacity: 0.08;
}

.hero__shape--1 {
  width: 300px;
  height: 300px;
  background: var(--color-primary);
  top: 10%;
  left: -5%;
  animation: float 10s ease-in-out infinite;
}

.hero__shape--2 {
  width: 200px;
  height: 200px;
  background: var(--color-secondary);
  bottom: 15%;
  right: -3%;
  animation: float 8s ease-in-out infinite 2s;
}

.hero__shape--3 {
  width: 100px;
  height: 100px;
  background: var(--color-accent);
  top: 60%;
  left: 15%;
  border-radius: var(--radius-xl);
  animation: float 12s ease-in-out infinite 4s;
}

.hero__shape--4 {
  width: 60px;
  height: 60px;
  background: var(--color-primary);
  top: 20%;
  right: 20%;
  border-radius: var(--radius-lg);
  animation: float 9s ease-in-out infinite 1s;
  transform: rotate(45deg);
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-15px) rotate(2deg); }
  66% { transform: translateY(10px) rotate(-1deg); }
}

/* ---------- Stats Counter Bar ---------- */
.hero__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  max-width: 700px;
  margin: 0 auto;
}

.hero__stat {
  text-align: center;
  padding: var(--space-4);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
}

.hero__stat-number {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: var(--fw-extrabold);
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.hero__stat-label {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}

/* ---------- Scroll Indicator ---------- */
.hero__scroll-indicator {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  animation: scrollBounce 2s ease-in-out infinite;
}

.hero__scroll-indicator .scroll-mouse {
  width: 22px;
  height: 34px;
  border: 2px solid var(--text-tertiary);
  border-radius: 11px;
  position: relative;
}

.hero__scroll-indicator .scroll-mouse::before {
  content: '';
  width: 3px;
  height: 8px;
  background: var(--text-tertiary);
  border-radius: var(--radius-full);
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollDot 2s ease-in-out infinite;
}

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

@keyframes scrollDot {
  0%, 100% { opacity: 1; top: 6px; }
  50% { opacity: 0.3; top: 16px; }
}

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

@media (min-width: 576px) {
  .hero__stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .hero__inner {
    grid-template-columns: 1fr 1fr;
    text-align: left;
  }

  .hero__content {
    text-align: left;
  }

  .hero__title {
    margin-left: 0;
    margin-right: 0;
  }

  .hero__typing {
    justify-content: flex-start;
  }

  .hero__desc {
    margin-left: 0;
    margin-right: 0;
  }

  .hero__buttons {
    justify-content: flex-start;
  }

  .hero__visual {
    display: flex;
  }

  .hero__stats {
    max-width: none;
    margin: 0;
    grid-template-columns: repeat(4, 1fr);
  }

  .hero__scroll-indicator {
    display: flex;
  }
}
