/**
 * Performance Analysis – Shared Styles
 * Supplements Tailwind with custom animations and component styles
 */

/* ─── Animations ─────────────────────────────────────── */

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

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

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

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

.animate-fadeInUp  { animation: fadeInUp  0.4s ease forwards; }
.animate-fadeIn    { animation: fadeIn    0.3s ease forwards; }

/* ─── Skeleton Loading ───────────────────────────────── */

.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

/* ─── Progress Bar ───────────────────────────────────── */

.progress-bar-fill {
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── File Drop Zone ─────────────────────────────────── */

.dropzone-active {
  border-color: #2563eb !important;
  background-color: #eff6ff !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.dropzone-active .material-symbols-outlined {
  color: #2563eb;
}

/* ─── Status Tags ────────────────────────────────────── */

.tag-critical { background: #fef2f2; color: #b91c1c; }
.tag-warning  { background: #fffbeb; color: #b45309; }
.tag-info     { background: #eff6ff; color: #1d4ed8; }
.tag-ok       { background: #f0fdf4; color: #15803d; }

/* ─── KPI Cards ──────────────────────────────────────── */

.kpi-card {
  animation: fadeInUp 0.4s ease forwards;
  opacity: 0;
}

.kpi-card:nth-child(1) { animation-delay: 0.05s; }
.kpi-card:nth-child(2) { animation-delay: 0.10s; }
.kpi-card:nth-child(3) { animation-delay: 0.15s; }
.kpi-card:nth-child(4) { animation-delay: 0.20s; }

/* ─── File List Items ────────────────────────────────── */

.file-item {
  animation: fadeInUp 0.25s ease forwards;
}

/* ─── Circular Score Ring ────────────────────────────── */

#scoreCircle {
  transition: stroke-dasharray 1.2s cubic-bezier(0.4, 0, 0.2, 1),
              stroke 0.4s ease;
}

/* ─── Navigation Active State ────────────────────────── */

.nav-active {
  background: #eff6ff;
  color: #1d4ed8;
  border-right: 3px solid #2563eb;
}

/* ─── Toast Notifications ────────────────────────────── */

.perf-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  padding: 12px 20px;
  border-radius: 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  animation: fadeInUp 0.3s ease;
}

/* ─── Responsive Utilities ───────────────────────────── */

@media (max-width: 768px) {
  /* Collapse sidebar on mobile */
  aside.fixed.w-64 {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  aside.fixed.w-64.open {
    transform: translateX(0);
  }
  main.ml-64 {
    margin-left: 0;
  }
  header.left-64 {
    left: 0;
  }
}

/* ─── Chart Tooltip Override ─────────────────────────── */

.chartjs-tooltip {
  border-radius: 10px !important;
  font-family: 'Inter', 'Public Sans', sans-serif !important;
}

/* ─── Print Styles ───────────────────────────────────── */

@media print {
  aside, header, .no-print { display: none !important; }
  main { margin-left: 0 !important; }
  body { background: #fff !important; }
  .editorial-shadow { box-shadow: none !important; }
  .bg-gradient-to-br { background: #eff6ff !important; }
}
