/* ========================================
   TOMOVEOUT DASHBOARD - SKELETON & ANIMATIONS
   Loaders + animations progressives
   ======================================== */

/* ========================================
   SKELETON - Composants de base
   ======================================== */

.skeleton-card {
  background: white !important;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  position: relative;
}

.skeleton-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* ========================================
   SKELETON - Éléments
   ======================================== */

.skeleton-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  border-radius: 12px;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  margin-bottom: 16px;
}

.skeleton-text {
  height: 12px;
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  border-radius: 6px;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.skeleton-number {
  height: 32px;
  width: 60%;
  margin-bottom: 8px;
}

.skeleton-label {
  height: 14px;
  width: 80%;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  border-radius: 50%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  flex-shrink: 0;
  margin-right: 16px;
}

.skeleton-badge {
  width: 80px;
  height: 24px;
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  border-radius: 12px;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* ========================================
   SKELETON - Containers spécifiques
   ======================================== */

.stats-skeleton {
  display: contents;
}

.stats-skeleton .skeleton-card {
  animation: fade-in 0.3s ease;
}

.history-skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-skeleton .skeleton-card {
  display: flex;
  align-items: center;
  padding: 16px;
  animation: fade-in 0.3s ease;
}

/* ========================================
   ANIMATIONS - Apparition
   ======================================== */

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ========================================
   PACKAGE HISTORY - Améliorations
   ======================================== */

.package-history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.package-history-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.package-history-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  border-color: #FF5757;
}

.package-item-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #f3f4f6;
}

.package-item-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.package-item-info {
  flex: 1;
  min-width: 0;
}

.package-item-title {
  font-weight: 600;
  font-size: 14px;
  color: #1f2937;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.package-item-meta {
  font-size: 12px;
  color: #9ca3af;
}

.package-item-value {
  font-weight: 700;
  font-size: 16px;
  color: #1f2937;
  margin-right: 12px;
}

.package-item-status {
  flex-shrink: 0;
}

.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* ========================================
   COMPTEURS - Stats
   ======================================== */

.count__box {
  position: relative;
  overflow: hidden;
}

.count__heading {
  font-size: 32px;
  font-weight: 700;
  color: #1f2937;
  transition: all 0.3s ease;
}

/* Animation lors du changement de valeur */
.count__heading.updating {
  transform: scale(1.1);
}

/* ========================================
   EMPTY STATE
   ======================================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state p {
  color: #9ca3af;
  font-size: 14px;
  margin: 0;
}

/* ========================================
   LOADING SPINNER (fallback)
   ======================================== */

.loading-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid #f3f4f6;
  border-top-color: #FF5757;
  border-radius: 50%;
  animation: spinner-rotate 0.8s linear infinite;
}

@keyframes spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  .package-history-item {
    flex-wrap: wrap;
    gap: 12px;
  }

  .package-item-value {
    order: 3;
    width: 100%;
    text-align: right;
    margin-right: 0;
  }

  .package-item-status {
    order: 4;
    width: 100%;
  }

  .status-badge {
    display: block;
    text-align: center;
  }
}

/* ========================================
   TRANSITIONS GLOBALES
   ======================================== */

.count__box,
.package-history-item,
.mybox {
  transition: all 0.2s ease;
}

/* ========================================
   PERFORMANCE
   ======================================== */

.skeleton-card,
.skeleton-icon,
.skeleton-text,
.skeleton-avatar,
.skeleton-badge {
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
}