/* OneClick Admin Dashboard - Base & Animations */

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

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

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

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

@keyframes pulseSoft {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.35); }
  50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

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

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

/* Animation utilities */
.animate-fadeIn {
  animation: fadeIn 0.5s var(--transition-base) both;
}

.animate-fadeInUp {
  animation: fadeInUp 0.5s var(--transition-base) both;
}

.animate-scaleIn {
  animation: scaleIn 0.4s var(--transition-bounce) both;
}

.animate-slideInRight {
  animation: slideInRight 0.5s var(--transition-base) both;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-pulse-soft {
  animation: pulseSoft 2s infinite;
}

/* Stagger delays */
.animate-delay-1 { animation-delay: 0.05s; }
.animate-delay-2 { animation-delay: 0.1s; }
.animate-delay-3 { animation-delay: 0.15s; }
.animate-delay-4 { animation-delay: 0.2s; }
.animate-delay-5 { animation-delay: 0.25s; }
.animate-delay-6 { animation-delay: 0.3s; }

/* Page entrance stagger: auto-animate direct children of .page-animate */
.page-animate > * {
  opacity: 0;
  animation: fadeInUp 0.5s var(--transition-base) forwards;
}

.page-animate > *:nth-child(1) { animation-delay: 0.03s; }
.page-animate > *:nth-child(2) { animation-delay: 0.08s; }
.page-animate > *:nth-child(3) { animation-delay: 0.13s; }
.page-animate > *:nth-child(4) { animation-delay: 0.18s; }
.page-animate > *:nth-child(5) { animation-delay: 0.23s; }
.page-animate > *:nth-child(6) { animation-delay: 0.28s; }
.page-animate > *:nth-child(7) { animation-delay: 0.33s; }
.page-animate > *:nth-child(8) { animation-delay: 0.38s; }
.page-animate > *:nth-child(9) { animation-delay: 0.43s; }
.page-animate > *:nth-child(10) { animation-delay: 0.48s; }

/* Table rows stagger */
.table-animate tbody tr {
  opacity: 0;
  animation: fadeInUp 0.35s var(--transition-base) forwards;
}

.table-animate tbody tr:nth-child(1) { animation-delay: 0.04s; }
.table-animate tbody tr:nth-child(2) { animation-delay: 0.08s; }
.table-animate tbody tr:nth-child(3) { animation-delay: 0.12s; }
.table-animate tbody tr:nth-child(4) { animation-delay: 0.16s; }
.table-animate tbody tr:nth-child(5) { animation-delay: 0.2s; }
.table-animate tbody tr:nth-child(6) { animation-delay: 0.24s; }
.table-animate tbody tr:nth-child(7) { animation-delay: 0.28s; }
.table-animate tbody tr:nth-child(8) { animation-delay: 0.32s; }
.table-animate tbody tr:nth-child(9) { animation-delay: 0.36s; }
.table-animate tbody tr:nth-child(10) { animation-delay: 0.4s; }

/* Base reset */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  background-color: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* Loading shimmer */
.shimmer {
  background: linear-gradient(90deg, var(--border-light) 25%, #f8fafc 50%, var(--border-light) 75%);
  background-size: 1000px 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: var(--radius-md);
}

/* Spin utility */
.spin {
  animation: spin 0.8s linear infinite;
}
