/**
 * Styles États de Chargement
 */

/* ===== BOUTON EN CHARGEMENT ===== */
.en-chargement {
  cursor: wait !important;
  opacity: 0.8;
}

.en-chargement i.fa-spinner {
  margin-right: 6px;
}

/* ===== OVERLAY CONTENEUR ===== */
.chargement-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(var(--fond-principal-rgb, 255, 255, 255), 0.85);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.chargement-overlay.active {
  opacity: 1;
}

.chargement-contenu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.chargement-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--bordure, #e0e0e0);
  border-top-color: var(--accent, #6366f1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.chargement-message {
  font-size: 14px;
  color: var(--texte-secondaire, #666);
}

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

/* ===== TOAST PROGRESSION ===== */
.toast-progression {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--fond-principal, #fff);
  border: 1px solid var(--bordure, #e0e0e0);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 10002;
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.toast-progression.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-icone {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent, #6366f1);
}

.toast-texte {
  font-size: 14px;
  color: var(--texte-principal, #333);
}

/* États */
.toast-progression.success .toast-icone {
  color: #22c55e;
}

.toast-progression.error .toast-icone {
  color: #ef4444;
}

/* ===== SKELETON LOADER ===== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--fond-tertiaire, #f0f0f0) 25%,
    var(--fond-secondaire, #e8e8e8) 50%,
    var(--fond-tertiaire, #f0f0f0) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}

.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-text:last-child {
  width: 60%;
}

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

.skeleton-button {
  height: 36px;
  width: 100px;
  border-radius: 8px;
}

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

/* ===== DARK MODE ===== */
[data-theme="dark"] .chargement-overlay,
.dark-mode .chargement-overlay {
  background: rgba(30, 30, 30, 0.85);
}

[data-theme="dark"] .toast-progression,
.dark-mode .toast-progression {
  background: var(--fond-principal, #1e1e1e);
  border-color: var(--bordure, #333);
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .toast-progression {
    left: 16px;
    right: 16px;
    transform: translateX(0) translateY(100px);
  }

  .toast-progression.active {
    transform: translateX(0) translateY(0);
  }
}
