/* ===================================================
   Colchis Digital — Animations & Micro-interactions
   =================================================== */

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

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

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

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}

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

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

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

@keyframes orbit {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

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

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

@keyframes tickerScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(62,123,250,0.2); }
  50%       { box-shadow: 0 0 32px rgba(62,123,250,0.5); }
}

@keyframes numberFlip {
  0%   { transform: translateY(0); opacity: 1; }
  50%  { transform: translateY(-8px); opacity: 0; }
  51%  { transform: translateY(8px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

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

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

@keyframes progressFill {
  from { width: 0%; }
  to   { width: var(--target-width, 100%); }
}

@keyframes ripple {
  0%   { transform: scale(0); opacity: 1; }
  100% { transform: scale(4); opacity: 0; }
}

/* ── Animation Classes ── */
.animate-fadeInUp   { animation: fadeInUp 0.5s ease both; }
.animate-fadeInDown { animation: fadeInDown 0.5s ease both; }
.animate-fadeIn     { animation: fadeIn 0.4s ease both; }
.animate-slideLeft  { animation: slideInLeft 0.5s ease both; }
.animate-slideRight { animation: slideInRight 0.5s ease both; }
.animate-scaleIn    { animation: scaleIn 0.4s ease both; }
.animate-pulse      { animation: pulse 2s ease-in-out infinite; }
.animate-spin       { animation: spin 1s linear infinite; }
.animate-float      { animation: floatY 3s ease-in-out infinite; }
.animate-glowPulse  { animation: glowPulse 2s ease-in-out infinite; }

/* Delay variants */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }
.delay-700 { animation-delay: 700ms; }
.delay-800 { animation-delay: 800ms; }

/* ── Logo orbit animation ── */
.orbi-logo-ring {
  animation: orbit 8s linear infinite;
  transform-origin: center;
}
.orbi-logo-ring-slow {
  animation: orbit 12s linear infinite reverse;
  transform-origin: center;
}

/* ── Ticker ── */
.ticker-track {
  display: flex;
  animation: tickerScroll 40s linear infinite;
  width: max-content;
}
.ticker-track:hover { animation-play-state: paused; }

/* ── Shimmer skeleton ── */
.skeleton {
  background: linear-gradient(90deg,
    var(--bg-elevated) 25%,
    rgba(255,255,255,0.04) 50%,
    var(--bg-elevated) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

/* ── Number change animation ── */
.price-change { animation: numberFlip 0.3s ease; }

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Gradient animated button ── */
.btn-animated-gradient {
  background-size: 200% 200%;
  background-image: linear-gradient(135deg, var(--accent-blue), var(--accent-purple), var(--accent-blue));
  animation: gradientShift 3s ease infinite;
}

/* ── Hover underline ── */
.hover-underline {
  position: relative;
}
.hover-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-blue);
  transition: width var(--transition-normal);
}
.hover-underline:hover::after { width: 100%; }

/* ── Card hover glow ── */
.card-hover-glow {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.card-hover-glow:hover {
  box-shadow: 0 0 40px rgba(62,123,250,0.2), 0 8px 32px rgba(0,0,0,0.5);
  transform: translateY(-4px);
}

/* ── Live dot ── */
.live-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-emerald);
  border-radius: 50%;
  display: inline-block;
  animation: dotBlink 1.5s ease infinite;
}

/* ── Step progress ── */
.step-line {
  flex: 1;
  height: 2px;
  background: var(--bg-border);
  transition: background 0.3s ease;
}
.step-line.active { background: var(--accent-blue); }

/* ── Ripple click effect ── */
.ripple-container {
  position: relative;
  overflow: hidden;
}
.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

/* ── Page transition ── */
.page-enter {
  animation: fadeIn 0.3s ease;
}

/* ── Tooltip ── */
.tooltip {
  position: relative;
}
.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 100;
}
.tooltip:hover::after { opacity: 1; }
