/* ============================================
   STORMSMP - Animations & Effects
   ============================================ */

/* ─── Keyframes ─── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1;   transform: scale(1);    box-shadow: 0 0 8px currentColor; }
  50%       { opacity: 0.7; transform: scale(1.15); box-shadow: 0 0 20px currentColor; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200%  0; }
}

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

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(90,160,200,0.3); }
  50%       { box-shadow: 0 0 50px rgba(90,160,200,0.6), 0 0 100px rgba(90,160,200,0.18); }
}

@keyframes borderGlow {
  0%, 100% { border-color: rgba(90,160,200,0.15); }
  50%       { border-color: rgba(90,160,200,0.55); }
}

@keyframes buttonHover {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-4px); }
  100% { transform: translateY(-3px); }
}

@keyframes buttonPulseGlow {
  0%   { box-shadow: 0 4px 20px rgba(90,160,200,0.3); }
  50%  { box-shadow: 0 10px 50px rgba(90,160,200,0.5); }
  100% { box-shadow: 0 8px 40px rgba(90,160,200,0.45); }
}

@keyframes buttonShine {
  0%   { left: -100%; }
  100% { left: 100%; }
}

@keyframes scaleUp {
  from { transform: scale(0.95); }
  to   { transform: scale(1); }
}

@keyframes slideRight {
  from { transform: translateX(-100%); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

@keyframes lightning {
  0%, 92%, 94%, 96%, 98%, 100% { opacity: 0; }
  93%, 95%, 97%, 99%           { opacity: 1; }
}

@keyframes typewriter {
  from { width: 0; }
  to   { width: 100%; }
}

@keyframes blink {
  50% { border-color: transparent; }
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes gradientShift {
  0%   { background-position: 0%   50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}

@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

@keyframes stormFlash {
  0%  { opacity: 0; }
  5%  { opacity: 0.15; }
  10% { opacity: 0; }
  15% { opacity: 0.1; }
  20% { opacity: 0; }
  100%{ opacity: 0; }
}


@keyframes orb {
  0%   { transform: translate(0, 0)       scale(1);   }
  33%  { transform: translate(30px, -20px) scale(1.1); }
  66%  { transform: translate(-20px, 15px) scale(0.9); }
  100% { transform: translate(0, 0)        scale(1);   }
}

@keyframes progressBar {
  from { width: 0; }
  to   { width: var(--progress); }
}

/* ─── Utility animation classes ─── */
.animate-fadeInUp   { animation: fadeInUp 0.7s ease both; }
.animate-fadeInDown { animation: fadeInDown 0.7s ease both; }
.animate-fadeIn     { animation: fadeIn 0.6s ease both; }
.animate-float      { animation: float 4s ease-in-out infinite; }
.animate-pulse      { animation: glowPulse 3s ease-in-out infinite; }
.animate-spin       { animation: spin 1s linear infinite; }

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }
.delay-7 { animation-delay: 0.7s; }
.delay-8 { animation-delay: 0.8s; }

/* ─── Scroll reveal ─── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s cubic-bezier(0.4,0,0.2,1),
              transform 0.7s cubic-bezier(0.4,0,0.2,1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-left.visible { opacity: 1; transform: translateX(0); }

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-right.visible { opacity: 1; transform: translateX(0); }

.reveal-scale {
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-scale.visible { opacity: 1; transform: scale(1); }

/* ─── Lightning bolts ─── */
.lightning-bolt {
  position: absolute;
  width: 3px;
  background: linear-gradient(180deg, transparent, var(--accent-cyan), transparent);
  border-radius: 2px;
  animation: lightning 8s infinite;
  opacity: 0;
}

.lightning-bolt::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, rgba(90,160,200,0.3), transparent);
  border-radius: 50%;
}

/* ─── Animated gradient text ─── */
.gradient-text-animated {
  background: linear-gradient(270deg, #5AA0C8, #1B3045, #5AA0C8);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s linear infinite;
}

/* ─── Shimmer loading skeleton ─── */
.skeleton {
  background: linear-gradient(90deg,
    var(--bg-secondary) 25%,
    rgba(90,160,200,0.07) 50%,
    var(--bg-secondary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ─── Number counter ─── */
.counter { display: inline-block; }

/* ─── Storm orbs in background ─── */
.storm-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.storm-orb-1 {
  width: 500px;
  height: 500px;
  background: rgba(27,48,69,0.45);
  top: -150px;
  left: -100px;
  animation: orb 20s ease-in-out infinite;
}

.storm-orb-2 {
  width: 400px;
  height: 400px;
  background: rgba(90,160,200,0.07);
  bottom: -100px;
  right: -80px;
  animation: orb 15s ease-in-out infinite reverse;
}

.storm-orb-3 {
  width: 300px;
  height: 300px;
  background: rgba(27,48,69,0.3);
  top: 40%;
  right: 20%;
  animation: orb 25s ease-in-out infinite 5s;
}

/* ─── Hero lightning flash ─── */
.storm-flash {
  position: fixed;
  inset: 0;
  background: rgba(90,160,200,0.02);
  pointer-events: none;
  z-index: 0;
  animation: stormFlash 15s infinite;
}

/* ─── Glowing border animation ─── */
.glow-border {
  animation: borderGlow 3s ease-in-out infinite;
}

/* ─── Progress bar ─── */
.progress-bar-track {
  height: 6px;
  background: rgba(0,0,0,0.4);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gradient-main);
  border-radius: 3px;
  width: 0;
  transition: width 1.5s cubic-bezier(0.4,0,0.2,1);
  box-shadow: var(--glow-cyan);
}

/* ─── Typewriter ─── */
.typewriter {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--accent-cyan);
  width: 0;
  animation:
    typewriter 2s steps(40) 1s forwards,
    blink 0.8s step-end infinite;
}

/* ─── Ripple effect ─── */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

/* ─── Hover lift cards with glow trail ─── */
.hover-glow {
  transition: var(--transition-slow);
}
.hover-glow:hover {
  box-shadow:
    0 0 30px rgba(90,160,200,0.18),
    0 30px 60px rgba(0,0,0,0.4);
}

/* ─── Top border gradient on hover ─── */
.card-glow-top {
  position: relative;
}
.card-glow-top::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-main);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
  z-index: 2;
}
.card-glow-top:hover::before { transform: scaleX(1); }

/* ─── Stagger children ─── */
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.10s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.20s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.30s; }
