/**
 * GLPI Control Center - loading.css
 * -----------------------------------------------------------------------------
 * Estilos para estados de carregamento.
 *
 * Sprint 22: Performance & Caching
 */

/* ════════════════════════════════════════════════════════════════════════════
   SPINNER
   ════════════════════════════════════════════════════════════════════════════ */

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
}

.loading-spinner-ring {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-spinner--small .loading-spinner-ring {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.loading-spinner--large .loading-spinner-ring {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

.loading-spinner-text {
  font-size: 13px;
  color: var(--text-secondary);
}

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

/* ════════════════════════════════════════════════════════════════════════════
   SKELETON
   ════════════════════════════════════════════════════════════════════════════ */

.loading-skeleton {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
}

.loading-skeleton-row {
  height: 16px;
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-hover) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: shimmer 1.5s ease-in-out infinite;
}

.loading-skeleton--text {
  height: 14px;
}

.loading-skeleton--title {
  height: 24px;
  width: 60%;
}

.loading-skeleton--avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.loading-skeleton--card {
  height: 120px;
  border-radius: 8px;
}

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

/* ════════════════════════════════════════════════════════════════════════════
   OVERLAY
   ════════════════════════════════════════════════════════════════════════════ */

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  z-index: 100;
  animation: fadeIn 0.2s ease;
}

.loading-overlay--blur {
  backdrop-filter: blur(4px);
}

.loading-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.loading-overlay-text {
  font-size: 14px;
  color: var(--text);
}

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

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVO
   ════════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .loading-spinner-ring {
    animation-duration: 1.5s;
  }

  .loading-skeleton-row {
    animation: none;
    background: var(--bg-secondary);
  }
}
