/* ============================================
   STATISTICS CARDS - ESTILOS
   ============================================ */

/* Contenedor principal de estadísticas */
.stats-cards-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Card base */
.stats-card {
  background: var(--bg-dark);
  border-radius: 12px;
  padding: 1.5rem;
  border: 2px solid rgba(100, 116, 139, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all var(--transition-normal);
}

.stats-card:hover {
  border-color: rgba(79, 162, 251, 0.3);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* Título de card */
.stats-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stats-card-title i {
  font-size: 1.3em;
  color: var(--color-primary);
}

/* ============================================
   CARD 1: RESUMEN GENERAL
   ============================================ */

.stats-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.stats-summary-item {
  background: rgba(30, 41, 59, 0.5);
  padding: 1.2rem;
  border-radius: 8px;
  text-align: center;
}

.stats-summary-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.stats-summary-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
}

.stats-summary-comparison {
  margin-top: 1rem;
  padding: 0.8rem;
  background: rgba(79, 162, 251, 0.1);
  border-radius: 8px;
  font-size: 0.9rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.stats-summary-comparison.below {
  background: rgba(251, 191, 36, 0.1);
}

.stats-summary-comparison i {
  color: var(--color-primary);
}

.stats-summary-comparison.below i {
  color: #fbbf24;
}

/* ============================================
   CARD 2: PROGRESO POR TEMA
   ============================================ */

.stats-progress-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stats-progress-item {
  background: rgba(30, 41, 59, 0.5);
  padding: 1rem;
  border-radius: 8px;
}

.stats-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.stats-progress-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-light);
  flex: 1;
}

.stats-progress-percentage {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
  min-width: 50px;
  text-align: right;
}

.stats-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(100, 116, 139, 0.3);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.stats-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  border-radius: 3px;
  transition: width 0.6s ease;
}

.stats-progress-details {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stats-weak-topics {
  margin-top: 1.2rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.05) 100%);
  border: 2px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
}

.stats-weak-topics-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f87171;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.stats-weak-item {
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.stats-recommendation {
  margin-top: 1.2rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
  border: 2px solid rgba(251, 191, 36, 0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.stats-recommendation-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stats-recommendation-text {
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ============================================
   CARD 3: HISTORIAL
   ============================================ */

.stats-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.stats-history-item {
  background: rgba(30, 41, 59, 0.5);
  padding: 1rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stats-history-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  min-width: 70px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.stats-history-topic {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-history-score {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
  min-width: 60px;
  text-align: center;
}

.stats-history-details {
  display: flex;
  gap: 0.6rem;
  font-size: 0.85rem;
}

.stats-history-detail {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.stats-history-detail.correct {
  color: #22c55e;
}

.stats-history-detail.incorrect {
  color: #ef4444;
}

.stats-no-data {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

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

@media (max-width: 768px) {
  .stats-cards-container {
    margin: 1rem auto;
  }

  .stats-summary-grid {
    grid-template-columns: 1fr;
  }

  .stats-summary-value {
    font-size: 1.8rem;
  }

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

  .stats-history-date {
    min-width: auto;
  }

  .stats-history-topic {
    white-space: normal;
  }

  .stats-history-details {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  .stats-card {
    padding: 1.2rem;
  }

  .stats-card-title {
    font-size: 1.1rem;
  }

  .stats-summary-value {
    font-size: 1.5rem;
  }

  .stats-progress-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .stats-progress-percentage {
    min-width: auto;
  }
}
