/* ============================================
   RESULTS TABS - ESTILOS
   ============================================ */

/* Contenedor principal de tabs */
.results-tabs {
  width: 100%;
  max-width: 900px;
  margin: 2rem auto 0;
}

/* Navegación de tabs */
.tabs-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid rgba(79, 162, 251, 0.2);
  padding: 0 0.5rem;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-normal);
  border-bottom: 3px solid transparent;
  position: relative;
  bottom: -2px;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-light);
  background: rgba(79, 162, 251, 0.05);
}

.tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* Contenido de tabs */
.tabs-content {
  position: relative;
  min-height: 300px;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-panel.active {
  display: block;
}

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

/* ============================================
   TAB RESUMEN
   ============================================ */

.resumen-nota {
  text-align: center;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(79, 162, 251, 0.1) 0%, rgba(34, 211, 238, 0.05) 100%);
  border-radius: var(--radius-lg);
  border: 2px solid rgba(79, 162, 251, 0.3);
}

.resumen-nota-valor {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: 0.3rem;
}

.resumen-nota-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

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

.resumen-stat-card {
  background: var(--bg-dark);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 2px solid rgba(100, 116, 139, 0.2);
  text-align: center;
}

.resumen-stat-valor {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.resumen-stat-valor.aciertos {
  color: #22c55e;
}

.resumen-stat-valor.fallos {
  color: #ef4444;
}

.resumen-stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.resumen-mensaje {
  text-align: center;
  padding: 1rem;
  background: rgba(30, 41, 59, 0.5);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 1rem;
  line-height: 1.5;
}

/* ============================================
   TAB PROGRESO
   ============================================ */

.progreso-section {
  margin-bottom: 2rem;
}

.progreso-section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.progreso-temas {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.progreso-tema-item {
  background: var(--bg-dark);
  padding: 1.2rem;
  border-radius: var(--radius-md);
  border: 2px solid rgba(100, 116, 139, 0.2);
}

.progreso-tema-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.progreso-tema-nombre {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light);
  flex: 1;
}

.progreso-tema-porcentaje {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
}

.progreso-tema-barra {
  width: 100%;
  height: 8px;
  background: rgba(100, 116, 139, 0.3);
  border-radius: 4px;
  overflow: hidden;
}

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

.temas-debiles {
  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);
  padding: 1.5rem;
  border-radius: var(--radius-md);
}

.recomendacion-card {
  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);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.recomendacion-icono {
  font-size: 2rem;
  flex-shrink: 0;
}

.recomendacion-texto {
  flex: 1;
  line-height: 1.6;
}

/* ============================================
   TAB HISTORIAL
   ============================================ */

.historial-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.historial-item {
  background: var(--bg-dark);
  padding: 1.2rem;
  border-radius: var(--radius-md);
  border: 2px solid rgba(100, 116, 139, 0.2);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.historial-fecha {
  font-size: 0.9rem;
  color: var(--text-muted);
  min-width: 70px;
}

.historial-tema {
  flex: 1;
  font-size: 0.95rem;
  color: var(--text-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.historial-nota {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-primary);
  min-width: 60px;
  text-align: center;
}

.historial-stats {
  display: flex;
  gap: 0.8rem;
  font-size: 0.9rem;
}

.historial-stat {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.historial-stat.aciertos {
  color: #22c55e;
}

.historial-stat.fallos {
  color: #ef4444;
}

.historial-ver-mas {
  width: 100%;
  padding: 1rem;
  background: transparent;
  border: 2px dashed rgba(79, 162, 251, 0.3);
  border-radius: var(--radius-md);
  color: var(--color-primary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  margin-top: 1rem;
}

.historial-ver-mas:hover {
  background: rgba(79, 162, 251, 0.1);
  border-color: var(--color-primary);
}

.historial-promedio {
  background: rgba(30, 41, 59, 0.5);
  padding: 1.2rem;
  border-radius: var(--radius-md);
  margin-top: 1.5rem;
  text-align: center;
}

.historial-promedio-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.historial-promedio-valor {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
}

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

@media (max-width: 768px) {
  .results-tabs {
    margin: 1rem auto 0;
  }

  .tabs-nav {
    gap: 0.3rem;
    padding: 0 0.3rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
  }

  .resumen-nota {
    padding: 1.5rem;
  }

  .resumen-nota-valor {
    font-size: 3rem;
  }

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

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

  .historial-fecha {
    min-width: auto;
  }

  .historial-tema {
    white-space: normal;
  }

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

@media (max-width: 480px) {
  .tab-btn {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
  }

  .resumen-nota-valor {
    font-size: 2.5rem;
  }

  .progreso-tema-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}
