/**
 * UTILS.CSS - Styles pour les composants utilitaires
 * Skeleton loading, confirmations, etc.
 */

/* ========================================
   SKELETON LOADING
   ======================================== */

@keyframes skeleton-pulse {
  0% { opacity: 0.4; }
  50% { opacity: 0.7; }
  100% { opacity: 0.4; }
}

.skeleton-line {
  background: linear-gradient(90deg, 
    rgba(118, 75, 162, 0.1) 25%, 
    rgba(118, 75, 162, 0.2) 50%, 
    rgba(118, 75, 162, 0.1) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: 6px;
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.skeleton-card {
  background: rgba(26, 31, 58, 0.6);
  border: 1px solid rgba(118, 75, 162, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
}

.skeleton-table {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.skeleton-row {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: rgba(26, 31, 58, 0.4);
  border-radius: 8px;
}

.skeleton-row .skeleton-line {
  margin-bottom: 0;
  height: 20px;
}

.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skeleton-list-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(26, 31, 58, 0.4);
  border-radius: 10px;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(90deg, 
    rgba(118, 75, 162, 0.1) 25%, 
    rgba(118, 75, 162, 0.2) 50%, 
    rgba(118, 75, 162, 0.1) 75%
  );
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

.skeleton-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.skeleton-content .skeleton-line {
  margin-bottom: 0;
}

.skeleton-text {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skeleton-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.skeleton-stat-card {
  background: rgba(26, 31, 58, 0.6);
  border: 1px solid rgba(118, 75, 162, 0.2);
  border-radius: 12px;
  padding: 1.25rem;
}

/* ========================================
   CONFIRMATION MODAL
   ======================================== */

.confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.confirm-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.confirm-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.confirm-dialog {
  position: relative;
  background: linear-gradient(145deg, rgba(26, 31, 58, 0.95), rgba(15, 18, 35, 0.98));
  border: 1px solid rgba(118, 75, 162, 0.3);
  border-radius: 16px;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.2s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.confirm-modal.active .confirm-dialog {
  transform: scale(1);
}

.confirm-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.confirm-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.75rem;
}

.confirm-message {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.confirm-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.confirm-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.confirm-cancel {
  background: rgba(100, 100, 100, 0.2);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(100, 100, 100, 0.3);
}

.confirm-cancel:hover {
  background: rgba(100, 100, 100, 0.3);
}

.confirm-ok {
  color: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.confirm-ok:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* ========================================
   EXPORT BUTTONS
   ======================================== */

.export-btn-group {
  display: flex;
  gap: 0.5rem;
}

.export-btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(118, 75, 162, 0.3);
  background: rgba(118, 75, 162, 0.1);
  color: rgba(255, 255, 255, 0.8);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.export-btn:hover {
  background: rgba(118, 75, 162, 0.2);
  border-color: rgba(118, 75, 162, 0.5);
  color: white;
}

.export-btn i {
  font-size: 0.9rem;
}

/* ========================================
   KEYBOARD SHORTCUTS
   ======================================== */

kbd {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
}

.shortcuts-help {
  padding: 1rem;
}

.shortcuts-help h3 {
  margin-bottom: 1rem;
  color: white;
}

.shortcuts-help ul {
  list-style: none;
  padding: 0;
}

.shortcuts-help li {
  padding: 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: rgba(255, 255, 255, 0.7);
}

/* ========================================
   LOADING STATES
   ======================================== */

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 18, 35, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: inherit;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(118, 75, 162, 0.3);
  border-top-color: #a78bfa;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ========================================
   EMPTY STATES
   ======================================== */

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: rgba(255, 255, 255, 0.5);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.5rem;
}

.empty-state-message {
  font-size: 0.9rem;
  max-width: 300px;
  margin: 0 auto;
}

.empty-state-action {
  margin-top: 1.5rem;
}

/* ========================================
   TOOLTIP
   ======================================== */

[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  font-size: 0.8rem;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  margin-bottom: 8px;
  z-index: 1000;
}

[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
}

/* ========================================
   COPY BUTTON
   ======================================== */

.copy-btn {
  padding: 0.25rem 0.5rem;
  border: none;
  background: rgba(118, 75, 162, 0.2);
  color: rgba(255, 255, 255, 0.7);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: rgba(118, 75, 162, 0.4);
  color: white;
}

.copy-btn.copied {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  .confirm-dialog {
    padding: 1.5rem;
    margin: 1rem;
  }
  
  .confirm-actions {
    flex-direction: column;
  }
  
  .confirm-btn {
    width: 100%;
  }
  
  .skeleton-grid {
    grid-template-columns: 1fr;
  }
  
  .skeleton-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
