/* Webiome Instructeur Dashboard Styles */
/* Basé sur webiome-forms.css pour la cohérence visuelle */

.webiome-instructeur-container {
  max-width: 1240px;
  margin: 0 auto;

  font-family: "Jost", sans-serif;
}

.webiome-instructeur-header {
  background: linear-gradient(135deg, #78b41e 0%, #6ba01a 100%);
  color: white;
  padding: 30px;
  border-radius: 8px;
  margin-bottom: 30px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.webiome-instructeur-header h3 {
  color: white;
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 10px 0;
  font-family: "Jost", sans-serif;
}

.webiome-instructeur-header p {
  margin: 0;
  opacity: 0.9;
  font-size: 16px;
  font-family: "Jost", sans-serif;
}

/* Statistiques - inspiré des messages webiome */
.webiome-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-item {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid #ddd;
  transition: all 0.3s ease;
}

.stat-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.stat-number {
  display: block;
  font-size: 32px;
  font-weight: 600;
  color: #78b41e;
  margin-bottom: 5px;
  font-family: "Jost", sans-serif;
}

.stat-label {
  display: block;
  color: #1e1b35;
  font-size: 14px;
  font-weight: 500;
  font-family: "Jost", sans-serif;
}

/* Conteneur tableau - inspiré des form-wrapper */
.webiome-table-container {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #ddd;
}

/* Assurer une largeur minimale pour déclencher le scroll si nécessaire */
.webiome-users-table {
  width: 100%;
  min-width: 1000px; /* ajuster selon le nombre de colonnes */
  border-collapse: collapse;
  font-family: "Jost", sans-serif;
  font-size: 14px;
}

.webiome-users-table th,
.webiome-users-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #ddd;
  vertical-align: middle;
}

.webiome-users-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #1e1b35;
  font-size: 14px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.webiome-users-table tbody tr:hover {
  background: #f8f9fa;
  transition: background-color 0.2s ease;
}

/* Styles des utilisateurs - couleurs similaires aux messages */
.user-pending {
  background-color: rgba(194, 39, 34, 0.05);
  border-left: 4px solid #c22722;
}

.user-validated {
  background-color: rgba(120, 180, 30, 0.05);
  border-left: 4px solid #78b41e;
}

.user-pending:hover {
  background-color: rgba(194, 39, 34, 0.1);
}

.user-validated:hover {
  background-color: rgba(120, 180, 30, 0.1);
}

/* Informations utilisateur */
.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  color: #1e1b35;
  margin-bottom: 2px;
  font-size: 14px;
}

.user-meta {
  font-size: 12px;
  color: #666;
}

/* Statuts - inspirés des messages de succès/erreur */
.status-pending {
  display: inline-block;
  padding: 4px 12px;
  background-color: rgba(194, 39, 34, 0.1);
  color: #c22722;
  border: 1px solid rgba(194, 39, 34, 0.3);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-validated {
  display: inline-block;
  padding: 4px 12px;
  background-color: rgba(120, 180, 30, 0.1);
  color: #78b41e;
  border: 1px solid rgba(120, 180, 30, 0.3);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

/* Statuts de progression */
.progress-none {
  color: #6c757d;
  font-size: 12px;
}

.progress-partial {
  color: #ff8c00;
  font-size: 12px;
  font-weight: 600;
}

.progress-complete {
  color: #78b41e;
  font-size: 12px;
  font-weight: 600;
}

.no-learndash {
  color: #6c757d;
  font-style: italic;
  font-size: 12px;
}

/* Quiz statuts */
.quiz-not-attempted {
  color: #6c757d;
  font-size: 12px;
}

.quiz-passed {
  color: #78b41e;
  font-size: 12px;
  font-weight: 600;
}

.quiz-failed {
  color: #c22722;
  font-size: 12px;
  font-weight: 600;
}

.quiz-attempted {
  color: #ff8c00;
  font-size: 12px;
  font-weight: 600;
}

/* Certificat statuts */
.certificate-obtained {
  color: #78b41e;
  font-size: 12px;
  font-weight: 600;
}

.certificate-download-link {
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: #78b41e;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #78b41e;
}

.certificate-download-link:hover {
  color: #ffffff !important;
  background-color: #78b41e;
  text-decoration: none;
  transform: scale(1.05);
  border-color: #78b41e;
}

.certificate-not-obtained {
  color: #6c757d;
  font-size: 12px;
}

/* Messages d'erreur - repris du CSS principal */
.webiome-message {
  padding: 15px 20px;
  border-radius: 4px;
  margin: 15px 0;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.4;
  position: relative;
  animation: slideDown 0.3s ease-out;
  font-family: "Jost", sans-serif;
}

.webiome-error {
  background-color: #f8d7da;
  color: #c22722;
  border: 1px solid #c22722;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .webiome-instructeur-container {
    padding: 15px;
  }

  .webiome-instructeur-header {
    padding: 20px;
  }

  .webiome-instructeur-header h3 {
    font-size: 20px;
  }

  .webiome-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .stat-number {
    font-size: 24px;
  }

  .webiome-users-table {
    font-size: 12px;
  }

  .webiome-users-table th,
  .webiome-users-table td {
    padding: 8px 10px;
  }

  /* Masquer certaines colonnes sur mobile */
  .webiome-users-table th:nth-child(3),
  .webiome-users-table td:nth-child(3),
  .webiome-users-table th:nth-child(4),
  .webiome-users-table td:nth-child(4) {
    display: none;
  }
}

@media (max-width: 480px) {
  .webiome-stats {
    grid-template-columns: 1fr;
  }

  .webiome-instructeur-header {
    padding: 15px;
  }

  .webiome-instructeur-header h3 {
    font-size: 18px;
  }

  /* Masquer plus de colonnes sur très petit écran */
  .webiome-users-table th:nth-child(6),
  .webiome-users-table td:nth-child(6),
  .webiome-users-table th:nth-child(7),
  .webiome-users-table td:nth-child(7),
  .webiome-users-table th:nth-child(8),
  .webiome-users-table td:nth-child(8) {
    display: none;
  }
}

/* Accessibility improvements */
.webiome-users-table:focus-visible {
  outline: 2px solid #78b41e;
  outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .webiome-table-container {
    border: 2px solid #1e1b35;
  }

  .webiome-users-table th {
    border: 2px solid #1e1b35;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .stat-item,
  .webiome-users-table tbody tr,
  .webiome-message {
    transition: none !important;
    animation: none !important;
  }
}

/* Styles pour les filtres */

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.webiome-filters {
  background: #f9f9f9;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 8px;
  border: 1px solid #e1e1e1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.export-group {
  display: flex;
  align-items: center;
}

.export-csv-btn {
  background: linear-gradient(135deg, #78b41e 0%, #6ba01a 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.export-csv-btn:hover {
  background: linear-gradient(135deg, #6ba01a 0%, #5a8a16 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(120, 180, 30, 0.3);
}

.export-csv-btn:active {
  transform: translateY(0);
}

.export-icon {
  font-size: 16px;
}

.filter-group label {
  font-weight: 600;
  color: #333;
  margin-right: 10px;
}

.status-filter-select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.status-filter-select:hover {
  border-color: #007cba;
}

.status-filter-select:focus {
  outline: none;
  border-color: #007cba;
  box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

/* Styles pour les lignes cachées par le filtre */
.webiome-table tbody tr.hidden-by-filter {
  display: none;
}

/* Styles pour les statuts cliquables */
.status-pending.clickable-status {
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.status-pending.clickable-status:hover {
  background-color: #78b41e;
  color: white;
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(120, 180, 30, 0.3);
}

.status-pending.clickable-status::after {
  content: " 👆";
  opacity: 0;
  transition: opacity 0.3s ease;
}

.status-pending.clickable-status:hover::after {
  opacity: 1;
}

/* Styles pour le popup de validation */
.validation-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

.validation-popup {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  text-align: center;
  animation: slideIn 0.3s ease;
}

.validation-popup h3 {
  color: #333;
  margin-bottom: 20px;
  font-size: 24px;
}

.validation-popup .user-details {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
  text-align: left;
}

.validation-popup .user-details strong {
  color: #78b41e;
}

.validation-popup .popup-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 25px;
}

.validation-popup .popup-btn {
  padding: 12px 25px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
}

.validation-popup .popup-btn-confirm {
  background: linear-gradient(135deg, #78b41e 0%, #6ba01a 100%);
  color: white;
}

.validation-popup .popup-btn-confirm:hover {
  background: linear-gradient(135deg, #6ba01a 0%, #5a8a16 100%);
  transform: translateY(-2px);
}

.validation-popup .popup-btn-cancel {
  background: #6c757d;
  color: white;
}

.validation-popup .popup-btn-cancel:hover {
  background: #5a6268;
  transform: translateY(-2px);
}

.validation-popup .popup-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.validation-popup .loading-spinner {
  display: none;
  margin: 0 auto 20px;
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #78b41e;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
