/* ==========================================================================
   SISTEM ARSIP DIGITAL DESA SUNGAI RAYA UTARA
   Animations & Keyframes
   Smooth 60fps micro-interactions + GSAP acceleration
   ========================================================================== */

/* Shimmer Skeleton Loading */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* UI/UX Pro Max: Skeleton Suite for Tables & Cards */
.skeleton-cell {
  height: 13px;
  background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-xs);
  display: inline-block;
  vertical-align: middle;
}

.skeleton-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  display: inline-block;
}

/* Row Collapse for Destructive Removal (Hapus Dokumen) */
tr.row-collapsing {
  background-color: #FEF2F2 !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateX(12px);
}

/* Form Validation Micro-Shake & Amber Focus Glow */
@keyframes errorShake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

.input-error-shake {
  animation: errorShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  border-color: #F59E0B !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Button State Morphing (Simpan / Unduh) */
.btn-morph-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.85;
}

.btn-morph-success {
  background: linear-gradient(135deg, #059669 0%, #10B981 100%) !important;
  color: #FFFFFF !important;
  border-color: #059669 !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.28) !important;
}

/* Cloud Sync Live Spinner & Glow */
@keyframes spinSync {
  100% { transform: rotate(360deg); }
}

.cloud-syncing-spin {
  animation: spinSync 0.9s linear infinite;
  transform-origin: center center;
}

.cloud-sync-success-glow {
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.45) !important;
}

/* Pulsing Status Dot */
@keyframes pulseDot {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.cloud-pulse,
.motion-pulse,
.pulse-indicator.online {
  animation: pulseDot 2s infinite;
}

.pulse-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.pulse-indicator.online {
  background: #10B981;
}

/* Laser Scanner Animation */
@keyframes scanLaser {
  0% {
    top: 0%;
    opacity: 0.8;
  }
  50% {
    top: 98%;
    opacity: 1;
  }
  100% {
    top: 0%;
    opacity: 0.8;
  }
}

.ocr-scanner-line.scanning {
  opacity: 1;
  animation: scanLaser 1.8s ease-in-out infinite;
}

/* AI Thinking Radar & Pulse Animation */
@keyframes aiRadarWave {
  0% {
    transform: scale(0.9);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.25);
    opacity: 0.35;
  }
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}

.ai-radar-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  animation: aiRadarWave 1.8s cubic-bezier(0.25, 1, 0.5, 1) infinite;
  pointer-events: none;
}

/* Accessibility: prefers-reduced-motion (Strict rule in gsap & ui-ux-pro-max) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .cloud-pulse {
    animation: none;
  }
  .ocr-scanner-line.scanning {
    animation: none;
  }
  .ai-radar-ring {
    animation: none;
  }
}

/* ==========================================================================
   MOTION GRAPHICS SUITE (Ponytail Standard: Zero npm bloat, 60fps GPU accelerated)
   - Dynamic SVG Radial Progress Rings (Dashboard Bento Metrics)
   - Ambient Aurora Glow Mesh & Floating Official Emblem (Portal Hero)
   - Cinematic Ken Burns & Photo Stagger (Galeri Foto Desa)
   ========================================================================== */

/* 1. Dynamic SVG Radial Progress Rings (Dashboard Metrics) */
.stat-icon-wrap {
  position: relative !important;
}

.stat-radial-ring {
  position: absolute;
  top: -2px;
  left: -2px;
  width: 44px;
  height: 44px;
  pointer-events: none;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  overflow: visible;
}

.stat-ring-track {
  stroke: rgba(148, 163, 184, 0.22);
}

.stat-ring-fill {
  stroke-linecap: round;
  transition: stroke 0.3s ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.06));
}

.stat-card-blue .stat-ring-fill { stroke: #2563EB; }
.stat-card-indigo .stat-ring-fill { stroke: #4F46E5; }
.stat-card-amber .stat-ring-fill { stroke: #D97706; }
.stat-card-purple .stat-ring-fill { stroke: #7C3AED; }
.stat-card-rose .stat-ring-fill { stroke: #E11D48; }
.stat-card-emerald .stat-ring-fill { stroke: #059669; }

/* 2. Ambient Aurora Glow Mesh (Public Hero - UI/UX Pro Max Seamless Feathering) */
.portal-hero {
  position: relative;
}

.hero-aurora-glow {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  max-width: 1100px;
  height: 380px;
  pointer-events: none;
  z-index: 0;
  /* UI/UX Pro Max: Radial Alpha Masking menghilangkan 100% tepi garis kotak kaku */
  mask-image: radial-gradient(ellipse 55% 50% at 50% 45%, black 25%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 55% 50% at 50% 45%, black 25%, transparent 75%);
  opacity: 0.75;
}

.aurora-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(65px);
  will-change: transform, opacity;
  pointer-events: none;
}

/* Palette River & Village Harmony: Azure River (#0284C7), Lush Emerald (#10B981) & Warm Amber (#F59E0B) */
.aurora-orb-1 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(2, 132, 199, 0.28) 0%, rgba(37, 99, 235, 0.10) 55%, rgba(2, 132, 199, 0) 75%);
  top: -20px;
  left: 10%;
}

.aurora-orb-2 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.22) 0%, rgba(5, 150, 105, 0.08) 55%, rgba(16, 185, 129, 0) 75%);
  top: 10px;
  right: 10%;
}

.aurora-orb-3 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.20) 0%, rgba(251, 191, 36, 0.07) 55%, rgba(245, 158, 11, 0) 75%);
  bottom: -20px;
  left: 36%;
}

.portal-hero-title,
.portal-search-container {
  position: relative;
  z-index: 2;
}

/* 3. Cinematic Ken Burns & Photo Gallery Lightbox */
.lightbox-img-wrap {
  position: relative;
  overflow: hidden !important;
}

.lightbox-img {
  will-change: transform, opacity;
  transform-origin: center center;
}


