/* ==========================================
   GAIN ANIMATIONS - Ultra Modern Redesign
   Really alive, modern, cool, and creative animations
   ========================================== */

/* ==========================================
   CARD 1: PROGRESS TRACKING - Enhanced Interactive Chart
   ========================================== */
.pp-gain-v2__chart-modern {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  height: 130px;
  padding: 24px 20px 20px;
  background: linear-gradient(135deg, rgba(57, 66, 157, 0.05) 0%, rgba(99, 102, 241, 0.03) 100%);
  border-radius: 16px;
  position: relative;
  overflow: visible;
  margin-bottom: 20px;
  border: 1px solid rgba(57, 66, 157, 0.08);
}

.pp-gain-v2__chart-modern::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20px;
  right: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(57, 66, 157, 0.2) 50%, transparent 100%);
}

/* Grid lines for better context */
.pp-gain-v2__chart-modern::after {
  content: "";
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  bottom: 20px;
  background-image: 
    linear-gradient(rgba(57, 66, 157, 0.05) 1px, transparent 1px);
  background-size: 100% 25%;
  pointer-events: none;
}

.pp-gain-v2__bar-modern {
  flex: 1;
  height: var(--height);
  background: linear-gradient(180deg, #6366f1 0%, #39429d 100%);
  border-radius: 10px 10px 4px 4px;
  position: relative;
  animation: growBarModern 1.4s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
  animation-delay: var(--delay);
  box-shadow: 0 4px 16px rgba(57, 66, 157, 0.25), 
              0 0 0 1px rgba(255, 255, 255, 0.15) inset;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  z-index: 1;
}

.pp-gain-v2__bar-modern:hover {
  transform: scaleY(1.12) translateY(-4px);
  box-shadow: 0 12px 28px rgba(57, 66, 157, 0.4), 
              0 0 0 2px rgba(255, 255, 255, 0.25) inset,
              0 0 20px rgba(99, 102, 241, 0.3);
  z-index: 10;
}

.pp-gain-v2__bar-modern:hover .pp-gain-v2__bar-value {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1.1);
  background: linear-gradient(135deg, #6366f1 0%, #39429d 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(57, 66, 157, 0.4);
}

.pp-gain-v2__bar-modern:hover .pp-gain-v2__bar-glow {
  opacity: 1;
}

.pp-gain-v2__bar-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, transparent 100%);
  border-radius: 10px 10px 0 0;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.pp-gain-v2__bar-value {
  position: absolute;
  top: -36px;
  left: 50%;
  transform: translateX(-50%) translateY(-5px);
  font-size: 12px;
  font-weight: 800;
  color: var(--color-primary);
  background: rgba(255, 255, 255, 0.98);
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), 
              0 1px 0 rgba(255, 255, 255, 0.8) inset;
  opacity: 0;
  animation: fadeInValue 0.8s ease-out forwards;
  animation-delay: calc(var(--delay) + 1s);
  white-space: nowrap;
  border: 1px solid rgba(57, 66, 157, 0.1);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  z-index: 20;
}

/* Tooltip arrow */
.pp-gain-v2__bar-value::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid rgba(255, 255, 255, 0.98);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

@keyframes growBarModern {
  from {
    height: 0;
    opacity: 0;
    transform: scaleY(0);
    transform-origin: bottom;
  }
  to {
    height: var(--height);
    opacity: 1;
    transform: scaleY(1);
    transform-origin: bottom;
  }
}

@keyframes fadeInValue {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
  to {
    opacity: 0.9;
    transform: translateX(-50%) translateY(-5px);
  }
}

/* ==========================================
   CARD 2: LEARN FASTER - Interactive Speedometer with Real Character
   ========================================== */
.pp-gain-v2__speed-scene {
  position: relative;
  height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(57, 66, 157, 0.05) 0%, rgba(99, 102, 241, 0.03) 100%);
  border-radius: 16px;
  overflow: visible;
  border: 1px solid rgba(57, 66, 157, 0.08);
  padding: 20px;
}

/* Animated background pulse */
.pp-gain-v2__speed-scene::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(57, 66, 157, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulseBackground 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulseBackground {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.5;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
}

/* Speedometer Container */
.pp-gain-v2__speedometer {
  position: relative;
  width: 200px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* SVG Gauge */
.pp-gain-v2__gauge {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.pp-gain-v2__gauge-bg {
  stroke: rgba(57, 66, 157, 0.15);
  stroke-linecap: round;
}

.pp-gain-v2__gauge-fill {
  stroke: #6366f1;
  stroke-linecap: round;
  stroke-dasharray: 251.2;
  stroke-dashoffset: 251.2;
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.6));
  transition: stroke-dashoffset 3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pp-gain-v2__speedometer:hover .pp-gain-v2__gauge-fill {
  stroke-dashoffset: 0;
}

/* Animated Needle */
.pp-gain-v2__needle {
  position: absolute;
  bottom: 20px;
  left: 50%;
  width: 4px;
  height: 70px;
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  border-radius: 2px 2px 0 0;
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(-90deg);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
  z-index: 2;
  transition: transform 3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pp-gain-v2__speedometer:hover .pp-gain-v2__needle {
  transform: translateX(-50%) rotate(90deg);
}

.pp-gain-v2__needle::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 10px solid #ef4444;
  filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.8));
}

/* Center Hub */
.pp-gain-v2__hub {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #6366f1 0%, #39429d 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4),
              0 0 0 3px rgba(255, 255, 255, 0.9),
              0 0 0 5px rgba(99, 102, 241, 0.2);
  z-index: 3;
  animation: pulseHub 2s ease-in-out infinite;
}

@keyframes pulseHub {
  0%, 100% {
    transform: translateX(-50%) scale(1);
  }
  50% {
    transform: translateX(-50%) scale(1.1);
  }
}

.pp-gain-v2__hub svg {
  width: 16px;
  height: 16px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Speed Value Display */
.pp-gain-v2__speed-value {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: baseline;
  gap: 2px;
  z-index: 1;
  pointer-events: none;
}

.pp-gain-v2__speed-number {
  font-size: 28px;
  font-weight: 900;
  color: #6366f1;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.pp-gain-v2__speed-unit {
  font-size: 14px;
  font-weight: 700;
  color: #39429d;
  opacity: 0.8;
}

/* Hover effect on speedometer speeds up hub pulse */
.pp-gain-v2__speedometer:hover .pp-gain-v2__hub {
  animation: pulseHub 1s ease-in-out infinite;
}

/* ==========================================
   CARD 3: GET CERTIFIED - Sophisticated Certificate Stack
   ========================================== */
.pp-gain-v2__cert-display {
  position: relative;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(57, 66, 157, 0.05) 0%, rgba(99, 102, 241, 0.03) 100%);
  border-radius: 16px;
  overflow: visible;
  border: 1px solid rgba(57, 66, 157, 0.08);
  padding: 20px;
}

/* Subtle animated background */
.pp-gain-v2__cert-display::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 30%, rgba(57, 66, 157, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(99, 102, 241, 0.06) 0%, transparent 50%);
  animation: floatBackground 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes floatBackground {
  0%, 100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

/* Certificate Stack */
.pp-gain-v2__cert-stack {
  position: relative;
  width: 140px;
  height: 100px;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pp-gain-v2__cert-stack:hover {
  transform: scale(1.05);
}

.pp-gain-v2__cert-card {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #FFFFFF 0%, #EEF2FF 100%);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(57, 66, 157, 0.2),
              0 1px 0 rgba(255, 255, 255, 0.8) inset;
  border: 2px solid rgba(99, 102, 241, 0.2);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Stacked cards with stagger effect */
.pp-gain-v2__cert-card--3 {
  transform: translateY(8px) translateX(-4px) rotate(-3deg);
  opacity: 0.4;
  z-index: 1;
  animation: slideInCard 1s ease-out backwards;
  animation-delay: 0s;
}

.pp-gain-v2__cert-card--2 {
  transform: translateY(4px) translateX(-2px) rotate(-1.5deg);
  opacity: 0.6;
  z-index: 2;
  animation: slideInCard 1s ease-out backwards;
  animation-delay: 0.2s;
}

.pp-gain-v2__cert-card--1 {
  transform: translateY(0) translateX(0) rotate(0deg);
  opacity: 1;
  z-index: 3;
  animation: slideInCard 1s ease-out backwards;
  animation-delay: 0.4s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
}

@keyframes slideInCard {
  from {
    opacity: 0;
    transform: translateY(30px) translateX(-10px) rotate(-10deg);
  }
  to {
    opacity: 1;
  }
}

/* Hover effect - fan out cards */
.pp-gain-v2__cert-stack:hover .pp-gain-v2__cert-card--3 {
  transform: translateY(12px) translateX(-8px) rotate(-6deg);
  opacity: 0.7;
}

.pp-gain-v2__cert-stack:hover .pp-gain-v2__cert-card--2 {
  transform: translateY(6px) translateX(-4px) rotate(-3deg);
  opacity: 0.85;
}

.pp-gain-v2__cert-stack:hover .pp-gain-v2__cert-card--1 {
  transform: translateY(0) translateX(0) rotate(0deg) scale(1.02);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3),
              0 2px 0 rgba(255, 255, 255, 0.9) inset;
}

/* Certificate Seal */
.pp-gain-v2__cert-seal {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #6366f1 0%, #39429d 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4),
              0 0 0 3px rgba(255, 255, 255, 0.9),
              0 0 0 5px rgba(99, 102, 241, 0.2);
  animation: rotateSeal 8s linear infinite;
  position: relative;
}

.pp-gain-v2__cert-seal::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(99, 102, 241, 0.3) 90deg,
    transparent 180deg,
    rgba(99, 102, 241, 0.3) 270deg,
    transparent 360deg
  );
  animation: rotateSeal 4s linear infinite reverse;
  z-index: -1;
}

@keyframes rotateSeal {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.pp-gain-v2__cert-seal svg {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  animation: pulseStar 2s ease-in-out infinite;
}

@keyframes pulseStar {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Certificate Lines (text simulation) */
.pp-gain-v2__cert-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  align-items: center;
}

.pp-gain-v2__cert-line {
  height: 3px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(99, 102, 241, 0.3) 10%, 
    rgba(99, 102, 241, 0.5) 50%, 
    rgba(99, 102, 241, 0.3) 90%, 
    transparent 100%);
  border-radius: 2px;
  width: 0;
  animation: drawLine 1.2s ease-out forwards;
  animation-delay: 0.8s;
}

.pp-gain-v2__cert-line--short {
  animation-delay: 1s;
}

.pp-gain-v2__cert-line--medium {
  animation-delay: 1.2s;
}

@keyframes drawLine {
  to {
    width: 80%;
  }
}

.pp-gain-v2__cert-line--short {
  width: 0;
}

@keyframes drawLine {
  to {
    width: 80%;
  }
}

.pp-gain-v2__cert-line--short {
  animation-name: drawLineShort;
}

.pp-gain-v2__cert-line--medium {
  animation-name: drawLineMedium;
}

@keyframes drawLineShort {
  to {
    width: 50%;
  }
}

@keyframes drawLineMedium {
  to {
    width: 65%;
  }
}

/* Checkmark Badge */
.pp-gain-v2__cert-check {
  position: absolute;
  bottom: 15px;
  right: 15px;
  width: 48px;
  height: 48px;
  background: #FFFFFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #10b981;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3),
              0 0 0 3px rgba(16, 185, 129, 0.2),
              0 0 0 1px rgba(16, 185, 129, 0.1) inset;
  opacity: 0;
  animation: popCheck 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
  animation-delay: 1.4s;
  z-index: 10;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pp-gain-v2__cert-check:hover {
  transform: scale(1.15) rotate(10deg);
  box-shadow: 0 8px 28px rgba(16, 185, 129, 0.4),
              0 0 0 4px rgba(16, 185, 129, 0.3),
              0 0 0 1px rgba(16, 185, 129, 0.15) inset;
}

@keyframes popCheck {
  from {
    opacity: 0;
    transform: scale(0) rotate(-180deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

.pp-gain-v2__cert-check svg {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  animation: drawCheck 0.6s ease-out forwards;
  animation-delay: 1.6s;
}

@keyframes drawCheck {
  from {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
  }
  to {
    stroke-dasharray: 100;
    stroke-dashoffset: 0;
  }
}

/* Hover Effects */
.pp-gain-v2__card:hover .pp-gain-v2__cert-seal {
  animation: rotateSeal 4s linear infinite;
}

.pp-gain-v2__card:hover .pp-gain-v2__cert-check {
  animation: popCheck 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards,
             bounce 1s ease-in-out infinite;
  animation-delay: 0s, 0.6s;
}

@keyframes bounce {
  0%, 100% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.1) rotate(5deg);
  }
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
  .pp-gain-v2__chart-modern {
    height: 100px;
    padding: 16px;
  }
  
  .pp-gain-v2__speed-meter,
  .pp-gain-v2__cert-badge {
    height: 120px;
  }
  
  .pp-gain-v2__speed-icon,
  .pp-gain-v2__cert-star {
    width: 56px;
    height: 56px;
  }
  
  .pp-gain-v2__speed-icon svg,
  .pp-gain-v2__cert-star svg {
    width: 28px;
    height: 28px;
  }
}
