/* États UX globaux : chargement, skeleton, vide, erreur */

.upj-loading {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(13, 27, 62, 0.72);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

.upj-loading[hidden] {
  display: none !important;
}

.upj-loading__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(201, 168, 76, 0.25);
  border-top-color: #c9a84c;
  border-radius: 50%;
  animation: upjSpin 0.75s linear infinite;
}

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

.skeleton {
  background: linear-gradient(90deg, #e8eaf0 25%, #f4f5f8 50%, #e8eaf0 75%);
  background-size: 200% 100%;
  animation: upjSkeleton 1.2s ease-in-out infinite;
  border-radius: 8px;
  min-height: 1rem;
}

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

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted, #7a8094);
}

.empty-state strong {
  display: block;
  color: var(--text, #0d1225);
  margin-bottom: 8px;
  font-size: 16px;
}

.state-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
}

.state-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  .upj-loading__spinner,
  .skeleton {
    animation: none;
  }
}
