/* ================================
   ROOT VARIABLES – LIGHT MODE
================================ */
:root {
  /* Enhanced Gradient */
  --gradient: linear-gradient(
    135deg,
    #667eea 0%,
    #764ba2 50%,
    #f093fb 100%
  );
  --gradient-hover: linear-gradient(
    135deg,
    #764ba2 0%,
    #667eea 50%,
    #f093fb 100%
  );

  /* Glass Morphism */
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(102, 126, 234, 0.18);

  /* Text Colors */
  --card-text: #1e293b;
  --card-subtext: #64748b;
  --accent-text: #667eea;

  /* Page Background */
  --page-bg: #f8fafc;
  
  /* Shadows */
  --shadow-sm: 0 4px 20px rgba(102, 126, 234, 0.1);
  --shadow-md: 0 10px 40px rgba(102, 126, 234, 0.2);
  --shadow-lg: 0 20px 60px rgba(102, 126, 234, 0.3);
}

/* ================================
   DARK MODE
================================ */
body.active-body {
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(139, 92, 246, 0.3);

  --card-text: #f1f5f9;
  --card-subtext: #cbd5e1;
  --accent-text: #a78bfa;

  --page-bg: #0f172a;
  
  --shadow-sm: 0 4px 20px rgba(139, 92, 246, 0.15);
  --shadow-md: 0 10px 40px rgba(139, 92, 246, 0.25);
  --shadow-lg: 0 20px 60px rgba(139, 92, 246, 0.4);
}

/* ================================
   CONTAINER
================================ */
.flow-container {
  padding: 100px 20px;
  position: relative;
  max-width: 1400px;
  margin: auto;
}

/* ================================
   ENHANCED TIMELINE LINE
================================ */
.flow-line {
  position: absolute;
  top: 50%;
  left: 4%;
  width: 92%;
  height: 6px;
  background: var(--gradient);
  transform: scaleX(0);
  transform-origin: left;
  animation: drawLine 1.5s cubic-bezier(0.65, 0, 0.35, 1) forwards;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.flow-line::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.5) 50%, 
    transparent 100%);
  transform: translateY(-50%) translateX(-100%);
  animation: shimmer 2s ease-in-out 1.5s infinite;
}

/* ================================
   GRID
================================ */
.flow-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 35px;
  position: relative;
  z-index: 2;
}

/* ================================
   ENHANCED GLASS CARD
================================ */
.flow-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid var(--glass-border);
  padding: 40px 24px 32px;
  border-radius: 24px;
  text-align: center;
  color: var(--card-text);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(50px) scale(0.94);
  animation: cardReveal 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: visible;
}

/* Animated gradient border on hover */
.flow-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  padding: 2px;
  background: var(--gradient-hover);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* ================================
   PREMIUM HOVER EFFECTS
================================ */
.flow-card:hover {
  transform: translateY(-24px) scale(1.04);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.flow-card:hover::before {
  opacity: 1;
}

.flow-card:hover .icon-box {
  transform: rotateY(360deg) scale(1.1);
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
}

.flow-card:hover .step-num {
  transform: scale(1.05);
  letter-spacing: 2px;
}

.active-body .flow-card:hover {
  box-shadow: 0 25px 70px rgba(139, 92, 246, 0.45);
}

/* ================================
   STAGGER ANIMATION
================================ */
.flow-card:nth-child(1) { animation-delay: 0.2s; }
.flow-card:nth-child(2) { animation-delay: 0.35s; }
.flow-card:nth-child(3) { animation-delay: 0.5s; }
.flow-card:nth-child(4) { animation-delay: 0.65s; }
.flow-card:nth-child(5) { animation-delay: 0.8s; }
.flow-card:nth-child(6) { animation-delay: 0.95s; }

/* ================================
   ENHANCED ICON BOX
================================ */
.icon-box {
  width: 80px;
  height: 80px;
  background: var(--gradient);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: -75px auto 20px;
  box-shadow: var(--shadow-md);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  z-index: 10;
}

.icon-box svg {
  width: 36px;
  height: 36px;
  stroke-width: 2.5;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Icon glow effect */
.icon-box::after {
  content: '';
  position: absolute;
  inset: -4px;
  background: var(--gradient);
  border-radius: 50%;
  z-index: -1;
  opacity: 0;
  filter: blur(12px);
  transition: opacity 0.5s ease;
}

.flow-card:hover .icon-box::after {
  opacity: 0.6;
}

/* ================================
   STEP NUMBER
================================ */
.step-num {
  display: inline-block;
  padding: 8px 18px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #fff;
  background: var(--gradient);
  border-radius: 40px;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ================================
   ENHANCED TEXT STYLING
================================ */
.flow-card h4 {
  margin: 16px 0 12px;
  font-size: 20px;
  font-weight: 700;
  color: var(--card-text);
  line-height: 1.3;
  transition: color 0.3s ease;
}

.flow-card:hover h4 {
  color: var(--accent-text);
}

.flow-card p {
  font-size: 14px;
  color: var(--card-subtext);
  line-height: 1.7;
  font-weight: 400;
}

/* ================================
   ANIMATIONS
================================ */
@keyframes drawLine {
  to { 
    transform: scaleX(1); 
  }
}

@keyframes shimmer {
  0%, 100% { 
    transform: translateY(-50%) translateX(-100%); 
  }
  50% { 
    transform: translateY(-50%) translateX(100%); 
  }
}

@keyframes cardReveal {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Pulse animation for icons */
@keyframes iconPulse {
  0%, 100% { 
    transform: scale(1); 
  }
  50% { 
    transform: scale(1.05); 
  }
}

/* ================================
   MOBILE – VERTICAL TIMELINE
================================ */
@media (max-width: 900px) {
  .flow-container {
    padding: 80px 20px;
  }

  .flow-grid {
    grid-template-columns: 1fr;
    gap: 90px;
  }

  .flow-line {
    top: 0;
    left: 50%;
    width: 6px;
    height: 100%;
    transform: scaleY(0) translateX(-50%);
    transform-origin: top;
    animation: drawLineVertical 1.5s cubic-bezier(0.65, 0, 0.35, 1) forwards;
  }

  .flow-line::before {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, 
      transparent 0%, 
      rgba(255, 255, 255, 0.5) 50%, 
      transparent 100%);
    transform: translateX(-50%) translateY(-100%);
    animation: shimmerVertical 2s ease-in-out 1.5s infinite;
  }

  .flow-card {
    max-width: 400px;
    margin: 0 auto;
  }

  .icon-box {
    margin: -70px auto 20px;
  }

  @keyframes drawLineVertical {
    to { 
      transform: scaleY(1) translateX(-50%); 
    }
  }

  @keyframes shimmerVertical {
    0%, 100% { 
      transform: translateX(-50%) translateY(-100%); 
    }
    50% { 
      transform: translateX(-50%) translateY(100%); 
    }
  }
}

/* ================================
   TABLET RESPONSIVENESS
================================ */
@media (max-width: 1200px) and (min-width: 901px) {
  .flow-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
  }

  .flow-line {
    display: none;
  }
}

@media (max-width: 600px) {
  .flow-card {
    padding: 35px 20px 28px;
  }

  .flow-card h4 {
    font-size: 18px;
  }

  .flow-card p {
    font-size: 13px;
  }

  .icon-box {
    width: 70px;
    height: 70px;
  }

  .icon-box svg {
    width: 32px;
    height: 32px;
  }
}