/* ============================================================
   animations.css — Transitions, loading states & micro-interactions
   ============================================================ */

/* ----------------------------------------------------------------
   FADE IN
   ---------------------------------------------------------------- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

/* ----------------------------------------------------------------
   STAGGER CHILDREN — gallery cards
   ---------------------------------------------------------------- */
.gallery-grid .video-card {
  opacity: 0;
  animation: fadeIn 0.4s ease forwards;
}

.gallery-grid .video-card:nth-child(1)  { animation-delay: 0.05s; }
.gallery-grid .video-card:nth-child(2)  { animation-delay: 0.10s; }
.gallery-grid .video-card:nth-child(3)  { animation-delay: 0.15s; }
.gallery-grid .video-card:nth-child(4)  { animation-delay: 0.20s; }
.gallery-grid .video-card:nth-child(5)  { animation-delay: 0.25s; }
.gallery-grid .video-card:nth-child(6)  { animation-delay: 0.30s; }
.gallery-grid .video-card:nth-child(7)  { animation-delay: 0.35s; }
.gallery-grid .video-card:nth-child(8)  { animation-delay: 0.40s; }
.gallery-grid .video-card:nth-child(9)  { animation-delay: 0.45s; }
.gallery-grid .video-card:nth-child(10) { animation-delay: 0.50s; }
.gallery-grid .video-card:nth-child(11) { animation-delay: 0.55s; }
.gallery-grid .video-card:nth-child(12) { animation-delay: 0.60s; }

/* Cards beyond the 12th appear without extra delay */
.gallery-grid .video-card:nth-child(n+13) {
  animation-delay: 0.65s;
}

/* ----------------------------------------------------------------
   SKELETON / LOADING PULSE
   ---------------------------------------------------------------- */
@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 0.8; }
}

.skeleton {
  background: var(--bg-hover);
  border-radius: var(--radius-md);
  animation: pulse 1.5s ease-in-out infinite;
}

/* ----------------------------------------------------------------
   SPINNER
   ---------------------------------------------------------------- */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-subtle);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

/* ----------------------------------------------------------------
   PANEL SLIDE TRANSITIONS
   ---------------------------------------------------------------- */
.panel-enter {
  animation: slideIn 0.3s ease forwards;
}

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

.panel-exit {
  animation: slideOut 0.2s ease forwards;
}

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

/* ----------------------------------------------------------------
   HOVER GLOW — video cards
   ---------------------------------------------------------------- */
.video-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--transition-normal);
  box-shadow: inset 0 0 60px rgba(255, 255, 255, 0.03);
  pointer-events: none;
}

.video-card:hover::after {
  opacity: 1;
}

/* ----------------------------------------------------------------
   PROGRESS BAR
   ---------------------------------------------------------------- */
@keyframes progress {
  0%   { width: 0%; }
  50%  { width: 70%; }
  100% { width: 90%; }
}

.progress-bar {
  height: 2px;
  background: var(--bg-hover);
  border-radius: 1px;
  overflow: hidden;
  width: 100%;
}

.progress-bar .progress-fill {
  height: 100%;
  background: #fff;
  border-radius: 1px;
  animation: progress 60s ease-out forwards;
}

.progress-bar.complete .progress-fill {
  width: 100% !important;
  animation: none;
  transition: width 0.3s ease;
}

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

.status-dot.online {
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.4);
}

.status-dot.offline {
  background: #666;
}

.status-dot.loading {
  background: #fbbf24;
  animation: pulse 1s ease-in-out infinite;
}

.status-dot.error {
  background: #f87171;
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.4);
}

/* ----------------------------------------------------------------
   HERO VIDEO GLOW
   ---------------------------------------------------------------- */
.hero-video-container {
  position: relative;
}

.hero-video-container::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-xl);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0.01) 50%,
    rgba(255, 255, 255, 0.04) 100%
  );
  z-index: -1;
  filter: blur(1px);
}

/* ----------------------------------------------------------------
   SMOOTH SCROLL OFFSET (for fixed header)
   ---------------------------------------------------------------- */
:target::before {
  content: '';
  display: block;
  height: 80px;
  margin-top: -80px;
  visibility: hidden;
  pointer-events: none;
}
