/* ============================================================
   HERO ANIMATIONS - Animated Ecommerce Dashboard Scene
   ============================================================ */

/* 1. Dashboard Frame */
.hero-dashboard {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  perspective: 1200px;
  overflow: visible;
}

.hero-dashboard__frame {
  position: relative;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.12), 0 4px 16px rgba(0,0,0,.06);
  transform: rotateY(-5deg) rotateX(2deg);
  transform-style: preserve-3d;
  will-change: transform;
  overflow: hidden;
  animation: heroFrameFloat 6s ease-in-out infinite;
}

.hero-dashboard__chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #f1f3f5;
  border-bottom: 1px solid var(--color-border);
}

.hero-dashboard__dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
}
.hero-dashboard__dot--red { background: #ff5f57; }
.hero-dashboard__dot--yellow { background: #febc2e; }
.hero-dashboard__dot--green { background: #28c840; }

.hero-dashboard__url {
  flex: 1;
  margin-left: 8px;
  height: 24px;
  background: var(--color-white);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 12px;
  color: var(--color-gray);
  font-family: var(--font-body);
}

.hero-dashboard__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #fafbfc;
  min-height: 380px;
}

/* 2. Dashboard Widgets */
.hero-dashboard__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.hero-dashboard__stat {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  opacity: 0;
  transform: translateY(12px);
  animation: heroStatSlideIn .6s ease forwards;
}
.hero-dashboard__stat:nth-child(1) { animation-delay: .4s; }
.hero-dashboard__stat:nth-child(2) { animation-delay: .6s; }
.hero-dashboard__stat:nth-child(3) { animation-delay: .8s; }

.hero-dashboard__stat-value {
  display: block;
  font-family: var(--font-heading);
  font-weight: var(--font-bold);
  font-size: 26px;
  color: var(--color-dark);
  line-height: 1.2;
  margin-bottom: 4px;
}
.hero-dashboard__stat-value--revenue { color: var(--color-primary-dark); }
.hero-dashboard__stat-value--orders { color: var(--color-teal); }
.hero-dashboard__stat-value--conversion { color: var(--color-primary); }

.hero-dashboard__stat-label {
  display: block;
  font-size: 12px;
  font-weight: var(--font-medium);
  color: var(--color-gray);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.hero-dashboard__stat-value--animated {
  display: inline-flex;
  overflow: hidden;
  height: 1.2em;
  vertical-align: bottom;
}
.hero-dashboard__stat-value--animated .hero-num-scroll {
  display: inline-flex;
  flex-direction: column;
  animation: heroNumberScroll 8s ease-in-out infinite;
}
.hero-dashboard__stat-value--animated .hero-num-scroll span {
  display: block;
  height: 1.2em;
  line-height: 1.2;
}

/* Chart */
.hero-dashboard__chart {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  opacity: 0;
  animation: heroFadeSlideUp .6s ease forwards 1s;
}
.hero-dashboard__chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.hero-dashboard__chart-title {
  font-size: 14px;
  font-weight: var(--font-semibold);
  color: var(--color-dark);
}
.hero-dashboard__chart-badge {
  font-size: 12px;
  font-weight: var(--font-semibold);
  color: var(--color-primary-dark);
  background: rgba(var(--color-primary-rgb), .15);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}
.hero-dashboard__chart-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}
.hero-chart-line {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 500;
  stroke-dashoffset: 500;
  animation: heroDrawLine 2s ease forwards 1.2s;
  will-change: stroke-dashoffset;
}
.hero-chart-area {
  opacity: 0;
  animation: heroFadeIn 1s ease forwards 2.5s;
}
.hero-chart-grid-line {
  stroke: #e9ecef;
  stroke-width: .5;
  stroke-dasharray: 3 3;
}
.hero-chart-label {
  font-size: 11px;
  fill: var(--color-gray);
  font-family: var(--font-body);
}

/* Product Cards */
.hero-dashboard__products {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hero-dashboard__product {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  opacity: 0;
  transform: translateX(30px);
  animation: heroProductSlideIn .5s ease forwards;
}
.hero-dashboard__product:nth-child(1) { animation-delay: 1.8s; }
.hero-dashboard__product:nth-child(2) { animation-delay: 2.1s; }
.hero-dashboard__product:nth-child(3) { animation-delay: 2.4s; }

.hero-dashboard__product-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.hero-dashboard__product-thumb--blue { background: linear-gradient(135deg, #667eea, #764ba2); }
.hero-dashboard__product-thumb--green { background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark)); }
.hero-dashboard__product-thumb--coral { background: linear-gradient(135deg, #f093fb, #f5576c); }

.hero-dashboard__product-info { flex: 1; min-width: 0; }
.hero-dashboard__product-name {
  font-size: 14px;
  font-weight: var(--font-semibold);
  color: var(--color-dark);
  line-height: 1.3;
}
.hero-dashboard__product-meta { font-size: 12px; color: var(--color-gray); }
.hero-dashboard__product-price {
  font-size: 16px;
  font-weight: var(--font-bold);
  color: var(--color-dark);
  white-space: nowrap;
}

/* Notifications */
.hero-dashboard__notification {
  position: absolute;
  right: -12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1), 0 2px 6px rgba(0,0,0,.06);
  white-space: nowrap;
  z-index: 10;
  opacity: 0;
  transform: translateX(20px);
  will-change: transform, opacity;
}
.hero-dashboard__notification--order {
  top: 30%;
  animation: heroNotificationCycle 8s ease-in-out infinite 2.6s;
}
.hero-dashboard__notification--payment {
  top: 58%;
  animation: heroNotificationCycle 8s ease-in-out infinite 4.2s;
}
.hero-dashboard__notification-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
}
.hero-dashboard__notification-icon--green {
  background: rgba(var(--color-primary-rgb), .15);
  color: var(--color-primary-dark);
}
.hero-dashboard__notification-icon--teal {
  background: rgba(var(--color-teal-rgb), .15);
  color: var(--color-teal);
}
.hero-dashboard__notification-text {
  font-size: 14px;
  font-weight: var(--font-semibold);
  color: var(--color-dark);
}
.hero-dashboard__notification-sub {
  font-size: 12px;
  color: var(--color-gray);
  font-weight: var(--font-regular);
}

/* 3. Floating Elements */
.hero-float {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  will-change: transform;
  z-index: 5;
  pointer-events: none;
}
.hero-float--cart {
  top: 5%; right: 8%;
  width: 60px; height: 60px;
  background: var(--color-white);
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  animation: heroFloatBob 4s ease-in-out infinite, heroFadeIn .5s ease forwards .6s;
  opacity: 0;
}
.hero-float--dollar {
  width: 52px; height: 52px;
  background: rgba(var(--color-primary-rgb), .15);
  font-size: 18px;
  font-weight: var(--font-bold);
  color: var(--color-primary-dark);
  animation: heroDollarFloat 5s ease-in-out infinite, heroFadeIn .5s ease forwards 1s;
  opacity: 0;
}
.hero-float--dollar-1 { bottom: 15%; left: -5%; animation-delay: 0s; }
.hero-float--dollar-2 { top: 20%; left: -8%; animation-delay: 1.5s; }

.hero-float--stars {
  top: -4%; left: 15%;
  background: var(--color-white);
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  border-radius: var(--radius-pill);
  width: auto;
  padding: 8px 14px;
  gap: 3px;
  animation: heroFloatBob 5s ease-in-out infinite .5s, heroFadeIn .5s ease forwards .8s;
  opacity: 0;
}
.hero-float--stars .hero-star {
  font-size: 16px;
  color: #e0e0e0;
  display: inline-block;
  animation: heroStarFill .3s ease forwards;
}
.hero-float--stars .hero-star:nth-child(1) { animation-delay: 3s; }
.hero-float--stars .hero-star:nth-child(2) { animation-delay: 3.15s; }
.hero-float--stars .hero-star:nth-child(3) { animation-delay: 3.3s; }
.hero-float--stars .hero-star:nth-child(4) { animation-delay: 3.45s; }
.hero-float--stars .hero-star:nth-child(5) { animation-delay: 3.6s; }

.hero-float--bag {
  bottom: 8%; right: 2%;
  width: 60px; height: 60px;
  background: #95bf47;
  box-shadow: 0 4px 16px rgba(149,191,71,.3);
  animation: heroOrbit 10s linear infinite, heroFadeIn .5s ease forwards 1.2s;
  opacity: 0;
}
.hero-float--bag svg { width: 24px; height: 24px; }

.hero-float--arrow {
  bottom: 25%; left: -10%;
  width: 56px; height: 56px;
  background: rgba(var(--color-primary-rgb), .12);
  animation: heroPulseGrow 3s ease-in-out infinite, heroFadeIn .5s ease forwards 1.4s;
  opacity: 0;
}
.hero-float--arrow svg { width: 22px; height: 22px; }

.hero-float--code {
  top: 10%; left: -6%;
  width: 60px; height: 60px;
  background: var(--color-white);
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  font-size: 18px;
  font-weight: var(--font-bold);
  color: var(--color-teal);
  font-family: 'Fira Code', 'Courier New', monospace;
  animation: heroFloatBob 4.5s ease-in-out infinite 1s, heroFadeIn .5s ease forwards .4s;
  opacity: 0;
}

/* 4. Keyframe Animations */
@keyframes heroFrameFloat {
  0%, 100% { transform: rotateY(-5deg) rotateX(2deg) translateY(0); }
  50% { transform: rotateY(-4deg) rotateX(1.5deg) translateY(-8px); }
}
@keyframes heroStatSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes heroFadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes heroFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes heroDrawLine {
  from { stroke-dashoffset: 500; }
  to { stroke-dashoffset: 0; }
}
@keyframes heroProductSlideIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes heroNotificationCycle {
  0% { opacity: 0; transform: translateX(20px); }
  6% { opacity: 1; transform: translateX(0); }
  30% { opacity: 1; transform: translateX(0); }
  38% { opacity: 0; transform: translateX(-10px); }
  100% { opacity: 0; transform: translateX(20px); }
}
@keyframes heroFloatBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes heroDollarFloat {
  0%, 100% { transform: translateY(0) scale(1); opacity: .7; }
  25% { opacity: 1; }
  50% { transform: translateY(-18px) scale(1.05); opacity: .8; }
  75% { opacity: 1; }
}
@keyframes heroStarFill {
  from { color: #e0e0e0; transform: scale(1); }
  50% { transform: scale(1.3); }
  to { color: #f5a623; transform: scale(1); }
}
@keyframes heroOrbit {
  0% { transform: translateY(0) translateX(0) rotate(0deg); }
  25% { transform: translateY(-6px) translateX(4px) rotate(5deg); }
  50% { transform: translateY(-2px) translateX(0) rotate(0deg); }
  75% { transform: translateY(4px) translateX(-4px) rotate(-5deg); }
  100% { transform: translateY(0) translateX(0) rotate(0deg); }
}
@keyframes heroPulseGrow {
  0%, 100% { transform: scale(1); opacity: .7; }
  50% { transform: scale(1.12); opacity: 1; }
}
@keyframes heroNumberScroll {
  0%, 10% { transform: translateY(0); }
  20%, 30% { transform: translateY(-20%); }
  40%, 50% { transform: translateY(-40%); }
  60%, 70% { transform: translateY(-60%); }
  80%, 90% { transform: translateY(-80%); }
  95%, 100% { transform: translateY(0); }
}

/* 5. Mobile Dashboard Image */
.hero-dashboard-mobile {
  display: none; /* Hidden on desktop */
  width: 100%;
  max-width: 600px;
  height: auto;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.12), 0 4px 16px rgba(0,0,0,.06);
}

/* 6. Responsive */
@media (max-width: 767px) {
  /* MOBILE: Show live dashboard, scaled down */
  .hero-dashboard-mobile { display: none; }
  .hero-dashboard { max-width: 100%; margin-top: var(--space-4); }
  .hero-dashboard__frame {
    transform: none;
    animation: none;
    box-shadow: 0 10px 30px rgba(0,0,0,.1);
  }
  .hero-dashboard__chrome { padding: 7px 10px; gap: 5px; }
  .hero-dashboard__dot { width: 7px; height: 7px; }
  .hero-dashboard__url { height: 20px; font-size: 10px; padding: 0 8px; margin-left: 6px; }
  .hero-dashboard__body { padding: 12px; gap: 8px; min-height: auto; }
  .hero-dashboard__stats { gap: 6px; }
  .hero-dashboard__stat { padding: 8px 6px; }
  .hero-dashboard__stat-value { font-size: 16px; margin-bottom: 2px; }
  .hero-dashboard__stat-label { font-size: 8px; letter-spacing: .03em; }
  .hero-dashboard__chart { padding: 8px; }
  .hero-dashboard__chart-title { font-size: 11px; }
  .hero-dashboard__chart-badge { font-size: 9px; padding: 2px 7px; }
  .hero-chart-label { font-size: 9px; }
  .hero-dashboard__products { gap: 5px; }
  .hero-dashboard__product { padding: 6px 8px; gap: 8px; }
  .hero-dashboard__product-thumb { width: 32px; height: 32px; }
  .hero-dashboard__product-name { font-size: 11px; }
  .hero-dashboard__product-meta { font-size: 9px; }
  .hero-dashboard__product-price { font-size: 12px; }
  /* Hide all floating elements and notifications */
  .hero-float,
  .hero-dashboard__notification { display: none; }
}
@media (max-width: 374px) {
  .hero-dashboard__stat-value { font-size: 14px; }
  .hero-dashboard__stat-label { font-size: 7px; }
  .hero-dashboard__product-thumb { width: 28px; height: 28px; }
  .hero-dashboard__product-name { font-size: 10px; }
  .hero-dashboard__product-price { font-size: 11px; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .hero-dashboard { max-width: 520px; margin-top: var(--space-8); }
  .hero-dashboard__frame { transform: rotateY(-3deg) rotateX(1deg); }
  .hero-dashboard__body { min-height: 300px; }
  .hero-dashboard__stat-value { font-size: 20px; }
  .hero-float--dollar-1, .hero-float--dollar-2 { display: none; }
  .hero-dashboard__notification { right: -8px; }
}
@media (min-width: 1200px) {
  .hero-dashboard { max-width: 680px; }
  .hero-dashboard__stat-value { font-size: 30px; }
  .hero-dashboard__stat-label { font-size: 13px; }
  .hero-dashboard__body { padding: 26px; gap: 16px; min-height: 400px; }
  .hero-dashboard__notification { padding: 10px 18px; }
  .hero-dashboard__notification-icon { width: 40px; height: 40px; }
}
@media (min-width: 1440px) {
  .hero-dashboard { max-width: 720px; }
  .hero-dashboard__stat-value { font-size: 32px; }
  .hero-dashboard__body { padding: 30px; gap: 18px; min-height: 420px; }
}

/* 6. Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .hero-dashboard__frame { animation: none; transform: rotateY(-5deg) rotateX(2deg); }
  .hero-dashboard__stat { animation: none; opacity: 1; transform: none; }
  .hero-dashboard__chart { animation: none; opacity: 1; }
  .hero-chart-line { animation: none; stroke-dashoffset: 0; }
  .hero-chart-area { animation: none; opacity: 1; }
  .hero-dashboard__product { animation: none; opacity: 1; transform: none; }
  .hero-dashboard__notification { animation: none; opacity: 0; }
  .hero-dashboard__notification--order { opacity: 1; transform: translateX(0); }
  .hero-float { animation: none; }
  .hero-float--cart, .hero-float--stars, .hero-float--bag,
  .hero-float--arrow, .hero-float--code { opacity: .7; animation: none; }
  .hero-float--dollar { opacity: .5; animation: none; }
  .hero-float--stars .hero-star { animation: none; color: #f5a623; }
  .hero-dashboard__stat-value--animated .hero-num-scroll { animation: none; transform: translateY(-80%); }
}
