/* CR2IQ v2 — Animations & Effects */

/* ===== Boot Sequence ===== */
.boot-sequence {
  position: fixed;
  inset: 0;
  background: var(--color-bg-primary);
  z-index: var(--z-boot);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
}

.boot-content {
  width: 100%;
  max-width: 600px;
  padding: var(--space-8);
}

.boot-logo {
  margin-bottom: var(--space-8);
  text-align: center;
}

.boot-brand {
  display: block;
  font-size: var(--text-4xl);
  font-weight: 800;
  letter-spacing: 8px;
  background: linear-gradient(135deg, var(--color-accent-cyan), var(--color-accent-magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: var(--space-2);
}

.boot-version {
  font-size: var(--text-sm);
  color: var(--text-muted);
  letter-spacing: 4px;
}

.boot-lines {
  margin-bottom: var(--space-8);
}

.boot-line {
  font-size: var(--text-sm);
  color: var(--color-accent-cyan);
  margin-bottom: var(--space-3);
  opacity: 0;
  transform: translateX(-20px);
  animation: bootLine 0.5s ease forwards;
}

.boot-line:nth-child(1) { animation-delay: 0.2s; }
.boot-line:nth-child(2) { animation-delay: 0.6s; }
.boot-line:nth-child(3) { animation-delay: 1.0s; }
.boot-line:nth-child(4) { animation-delay: 1.4s; }
.boot-line:nth-child(5) { animation-delay: 1.8s; }

@keyframes bootLine {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.boot-progress {
  height: 2px;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.boot-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--color-accent-cyan), var(--color-accent-magenta));
  animation: bootProgress 2s ease forwards;
  animation-delay: 0.5s;
  box-shadow: var(--glow-cyan);
}

@keyframes bootProgress {
  0% { width: 0; }
  100% { width: 100%; }
}

.boot-sequence.hide {
  animation: bootHide 0.5s ease forwards;
  animation-delay: 2.5s;
  pointer-events: none;
}

@keyframes bootHide {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* ===== FADE IN ===== */
.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in-delay-1 { animation-delay: 0.1s; }
.fade-in-delay-2 { animation-delay: 0.2s; }
.fade-in-delay-3 { animation-delay: 0.3s; }

/* ===== SLIDE IN ===== */
.slide-in-left {
  animation: slideInLeft 0.5s ease forwards;
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

.slide-in-right {
  animation: slideInRight 0.5s ease forwards;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== PULSE EFFECTS ===== */
.pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 5px var(--color-accent-cyan-dim); }
  50% { box-shadow: 0 0 20px var(--color-accent-cyan), 0 0 40px var(--color-accent-cyan-dim); }
}

/* ===== SCANLINE EFFECT ===== */
.scanline {
  position: relative;
  overflow: hidden;
}

.scanline::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--color-accent-cyan), transparent);
  opacity: 0.3;
  animation: scanline 3s linear infinite;
}

@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

/* ===== GLITCH EFFECT ===== */
.glitch {
  position: relative;
}

.glitch:hover {
  animation: glitch 0.3s ease;
}

@keyframes glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
  100% { transform: translate(0); }
}

/* ===== LOADING SPINNER ===== */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--color-accent-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== SKELETON LOADING ===== */
.skeleton {
  background: linear-gradient(90deg, var(--color-bg-tertiary) 25%, var(--color-bg-glass) 50%, var(--color-bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== NUMBER COUNT UP ===== */
.count-up {
  font-variant-numeric: tabular-nums;
}

/* ===== HOVER LIFT ===== */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-elevated);
}

/* ===== NOTIFICATION SLIDE ===== */
.toast-enter {
  animation: toastEnter 0.4s ease forwards;
}

@keyframes toastEnter {
  from { 
    opacity: 0; 
    transform: translateX(100%) scale(0.9); 
  }
  to { 
    opacity: 1; 
    transform: translateX(0) scale(1); 
  }
}

.toast-exit {
  animation: toastExit 0.3s ease forwards;
}

@keyframes toastExit {
  to { 
    opacity: 0; 
    transform: translateX(100%) scale(0.9); 
  }
}

/* ===== RISK COLOR TRANSITIONS ===== */
.risk-transition {
  transition: color 0.5s ease, background-color 0.5s ease, border-color 0.5s ease;
}

/* ===== CHART DRAW ===== */
.chart-draw {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: chartDraw 2s ease forwards;
}

@keyframes chartDraw {
  to { stroke-dashoffset: 0; }
}

/* ===== BREATHE ===== */
.breathe {
  animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.02); opacity: 0.8; }
}
