/**
 * ═══════════════════════════════════════════════════════════════
 * ILLUMINATE AI - Skeleton Loaders
 * Use these for all async content loading states
 * ═══════════════════════════════════════════════════════════════
 */

/* Base Skeleton Animation */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface) 25%,
    var(--surface-2) 50%,
    var(--surface) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

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

/* Text Skeleton */
.skeleton-text {
  height: 14px;
  margin: 8px 0;
  border-radius: var(--radius-sm);
}

.skeleton-text-sm {
  height: 10px;
  width: 60%;
}

.skeleton-text-md {
  height: 14px;
  width: 80%;
}

.skeleton-text-lg {
  height: 18px;
  width: 100%;
}

/* Title Skeleton */
.skeleton-title {
  height: 24px;
  width: 60%;
  margin: 12px 0;
  border-radius: var(--radius-sm);
}

/* Avatar Skeleton */
.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-avatar-sm {
  width: 32px;
  height: 32px;
}

.skeleton-avatar-lg {
  width: 64px;
  height: 64px;
}

/* Card Skeleton */
.skeleton-card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.skeleton-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.skeleton-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Button Skeleton */
.skeleton-button {
  height: 44px;
  width: 120px;
  border-radius: var(--radius-md);
}

/* Input Skeleton */
.skeleton-input {
  height: 48px;
  width: 100%;
  border-radius: var(--radius-md);
}

/* List Item Skeleton */
.skeleton-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.skeleton-list-item:last-child {
  border-bottom: none;
}

/* Stats Card Skeleton */
.skeleton-stat {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.skeleton-stat-value {
  height: 32px;
  width: 60px;
  margin-bottom: 8px;
}

.skeleton-stat-label {
  height: 14px;
  width: 80px;
}

/* Table Row Skeleton */
.skeleton-table-row {
  display: grid;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.skeleton-table-cell {
  height: 20px;
  background: var(--surface);
  border-radius: var(--radius-sm);
}

/* Grid Skeleton */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.skeleton-grid-item {
  height: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* Sidebar Skeleton */
.skeleton-sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.skeleton-sidebar-item {
  height: 48px;
  margin: 4px 12px;
  border-radius: var(--radius-md);
}

/* Dashboard Skeleton */
.skeleton-dashboard {
  display: grid;
  gap: 24px;
}

.skeleton-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1024px) {
  .skeleton-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .skeleton-stats-row {
    grid-template-columns: 1fr;
  }
}

/* Chart Skeleton */
.skeleton-chart {
  height: 300px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Profile Skeleton */
.skeleton-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

.skeleton-profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 16px;
}

.skeleton-profile-name {
  height: 24px;
  width: 150px;
  margin-bottom: 8px;
}

.skeleton-profile-role {
  height: 16px;
  width: 100px;
}

/* Loading Spinner (alternative to skeleton) */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--accent);
  animation: spin 0.8s ease-in-out infinite;
}

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

.spinner-sm {
  width: 16px;
  height: 16px;
}

.spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

/* Full Page Loader */
.page-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 20px;
}

.page-loader-text {
  color: var(--text-dim);
  font-size: 14px;
}

/* Inline Loading */
.loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 14px;
}

/* Pulse Effect (for subtle loading) */
.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Content Fade In (after skeleton) */
.content-loaded {
  animation: fadeIn 0.3s ease-out;
}

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

/* Hide skeleton when content is loaded */
.skeleton-hidden {
  display: none;
}
