/* ========== STATISTIQUES ÉLÈVE ========== */

.student-stats-section {
  margin-top: 42px;
  padding: 28px;
  border-radius: 24px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.student-stats-section.hidden {
  display: none;
}

.stats-title {
  color: #0f172a;
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 8px 0;
  letter-spacing: -0.3px;
}

.stats-subtitle {
  color: #64748b;
  font-size: 15px;
  margin-bottom: 26px;
}

/* ===== GRILLE STATISTIQUES ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 34px;
}

.stat-card {
  border-radius: 18px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #0f172a;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1);
}

.stat-icon {
  font-size: 28px;
  min-width: 36px;
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 12px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #475569;
  font-weight: 500;
}

/* Couleurs alternées pour les stat-cards */
.stat-card:nth-child(1) {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
}

.stat-card:nth-child(2) {
  background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
}

.stat-card:nth-child(3) {
  background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
}

.stat-card:nth-child(4) {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.stat-card:nth-child(5) {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
}

.stat-card:nth-child(6) {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
}

.stat-card:nth-child(7) {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  color: #0f172a;
}

.stat-card:nth-child(7) .stat-label {
  color: #475569;
}

.stat-card:nth-child(8) {
  background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
}

/* ===== DÉTAILS PAR CATÉGORIE ===== */
.stats-details {
  margin-bottom: 28px;
}

.details-title {
  color: #0f172a;
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 16px 0;
}

.details-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 14px;
}

.detail-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.detail-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.detail-name {
  color: #0f172a;
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 12px 0;
}

.detail-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid #e2e8f0;
}

.detail-stat:last-child {
  border-bottom: none;
}

.detail-label {
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
}

.detail-value {
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
}

/* ===== HISTORIQUE D'ACTIVITÉ ===== */
.stats-history {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  margin-top: 22px;
}

.history-title {
  color: #0f172a;
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 14px 0;
}

.recent-activity-list {
  max-height: 400px;
  overflow-y: auto;
}

.activity-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #6366f1;
  padding: 11px 14px;
  margin-bottom: 10px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.activity-item:last-child {
  margin-bottom: 0;
}

.activity-content {
  flex: 1;
}

.activity-text {
  color: #0f172a;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

.activity-time {
  color: #64748b;
  font-size: 12px;
}

.activity-type {
  background: #e2e8f0;
  color: #334155;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.no-activity {
  text-align: center;
  color: #64748b;
  font-size: 14px;
  padding: 24px 20px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
  }

  .stat-card {
    padding: 14px;
    flex-direction: column;
    text-align: center;
  }

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

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

  .stat-label {
    font-size: 12px;
  }

  .details-container {
    grid-template-columns: 1fr;
  }

  .stats-history {
    padding: 14px;
  }

  .activity-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .activity-type {
    margin-top: 8px;
  }
}

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

  .stat-card {
    padding: 12px;
  }

  .stat-icon {
    font-size: 20px;
  }

  .stat-value {
    font-size: 18px;
  }
}
