/* ============================================================
   ARJ Finance — Animations CSS
   ============================================================ */

/* ============================================================
   Keyframes
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

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

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

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

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

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.85); }
}

@keyframes pulseBorder {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196,144,32,0.3); }
  50%       { box-shadow: 0 0 0 6px rgba(196,144,32,0); }
}

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

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%            { transform: translateY(-6px); }
}

@keyframes goldGlow {
  0%, 100% { text-shadow: 0 0 8px rgba(232,184,64,0.0); }
  50%       { text-shadow: 0 0 20px rgba(232,184,64,0.4); }
}

@keyframes scanLine {
  0%   { transform: translateY(-100%); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(100vh); opacity: 0; }
}

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

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

/* ============================================================
   Scroll-triggered fade-in
   ============================================================ */
.fade-in-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays */
.fade-in-up:nth-child(2) { transition-delay: 0.08s; }
.fade-in-up:nth-child(3) { transition-delay: 0.16s; }
.fade-in-up:nth-child(4) { transition-delay: 0.24s; }
.fade-in-up:nth-child(5) { transition-delay: 0.32s; }
.fade-in-up:nth-child(6) { transition-delay: 0.40s; }
.fade-in-up:nth-child(7) { transition-delay: 0.48s; }
.fade-in-up:nth-child(8) { transition-delay: 0.56s; }

/* ============================================================
   Shimmer Loading
   ============================================================ */
.shimmer {
  background: linear-gradient(
    90deg,
    var(--navy-3) 25%,
    rgba(196,144,32,0.08) 50%,
    var(--navy-3) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  margin-bottom: 0.6rem;
}
.skeleton-line.short  { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.full   { width: 100%; }

/* ============================================================
   Status Pulse
   ============================================================ */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.stable      { background: var(--green); animation: pulse 3s ease-in-out infinite; }
.status-dot.caution     { background: var(--amber); animation: pulse 2s ease-in-out infinite; }
.status-dot.opportunity { background: var(--gold-2); animation: pulseBorder 2s ease-in-out infinite; }
.status-dot.shift       { background: var(--red); animation: pulse 1s ease-in-out infinite; }

/* ============================================================
   Modal Slide-in
   ============================================================ */
.modal-enter {
  animation: scaleIn 0.2s ease;
}

/* ============================================================
   Toast Slide-in
   ============================================================ */
.toast-enter {
  animation: slideInRight 0.25s ease;
}
.toast-exit {
  animation: slideInRight 0.25s ease reverse;
}

/* ============================================================
   Nav Logo Gold Arc
   ============================================================ */
.nav-logo svg path {
  animation: goldGlow 3s ease-in-out infinite;
}

/* ============================================================
   Cursor Blink (terminal)
   ============================================================ */
.cursor-blink {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--gold);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}

/* ============================================================
   Regime Score Bar Fill Animation
   ============================================================ */
.regime-bar-fill,
.axis-bar-fill,
.mini-axis-fill {
  animation: none; /* width is set via JS/inline style */
}

/* Page load animation for hero */
.hero-title,
.hero-sub,
.hero-search,
.hero-badge {
  animation: fadeInUp 0.7s ease both;
}
.hero-badge   { animation-delay: 0s; }
.hero-title   { animation-delay: 0.1s; }
.hero-sub     { animation-delay: 0.2s; }
.hero-search  { animation-delay: 0.3s; }
.hero-pills   { animation: fadeInUp 0.7s ease 0.4s both; }

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
