/* ============================================================================
   COMPONENTE: Cuestionario (Realización de Tests)
   ============================================================================ */

/* Estilos para la vista de realizar test */
.realizar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.realizar-header {
  margin-bottom: 20px;
}

.realizar-content {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}

.realizar-main {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.pregunta-actual {
  margin-bottom: 20px;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

.pregunta-actual h3 {
  margin-bottom: 15px;
  color: #333;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.opciones {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

/* Selector más específico para evitar que optimizations.css sobrescriba */
.opciones .opcion,
.opcion {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px !important; /* PADDING AUMENTADO PARA MEJOR ESPACIADO */
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  min-height: 48px;
  background: #fff;
}

/* CSS INLINE FORZADO - PRUEBA */
.opciones label.opcion,
label.opcion {
  padding: 12px !important;
  padding-top: 12px !important;
  padding-right: 12px !important;
  padding-bottom: 12px !important;
  padding-left: 12px !important;
}

.opcion:hover {
  border-color: #007bff;
  background: #f8f9fa;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.opcion input[type="radio"],
.opcion input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
  margin-top: 0;
  width: 20px;
  height: 20px;
  accent-color: #007bff;
}

/* Estilos para el span dentro de .opcion */
.opcion span {
  flex: 1;
  margin-left: 0;
  line-height: 1.5;
  color: #2c3e50;
  font-size: 1rem;
  font-weight: 500;
  word-wrap: break-word;
  overflow-wrap: break-word;
  padding-top: 2px;
}



.opcion.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f8f9fa;
}

.opcion.disabled input {
  cursor: not-allowed;
}

.opcion.disabled span {
  color: #6c757d !important;
  /* Mantener la legibilidad incluso cuando está deshabilitado */
  opacity: 0.8 !important;
  font-style: italic !important;
}

/* Mensaje de respuesta bloqueada */
.respuesta-bloqueada {
  background: #e3f2fd;
  border: 1px solid #2196f3;
  border-radius: 6px;
  padding: 10px 15px;
  margin-top: 15px;
  color: #1976d2;
  font-weight: 500;
  text-align: center;
  font-size: 0.9em;
}

/* Estilos para textarea deshabilitado */
.pregunta-texto textarea:disabled {
  background-color: #f8f9fa;
  color: #6c757d;
  cursor: not-allowed;
}

/* Estilos para progreso y advertencias */
.progreso {
  font-size: 1.1rem;
  color: #666;
  padding: 0.5rem;
  background: #f8f9fa;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.progreso-advertencia {
  color: #dc3545;
  font-weight: 500;
}

.progreso-completo {
  color: #198754;
  font-weight: 500;
}

.preguntas-advertencia {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 4px;
  padding: 8px 12px;
  margin-bottom: 12px;
  color: #856404;
  font-size: 0.9em;
}

.advertencia-icon {
  margin-right: 6px;
  font-weight: bold;
}

/* Estilos para texto libre del cuestionario */
.cuestionario-texto-libre-container {
  position: relative;
  margin-bottom: 1em;
}

.cuestionario-texto-libre-container textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95em;
  line-height: 1.4;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.cuestionario-texto-libre-container textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.cuestionario-texto-libre-counter {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 0.75em;
  color: #6c757d;
  background: rgba(255, 255, 255, 0.9);
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: normal;
}

.cuestionario-texto-libre-counter.warning {
  color: #ffc107;
}

.cuestionario-texto-libre-counter.danger {
  color: #dc3545;
}

/* Navegación de preguntas */
.preguntas-navegacion {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  height: fit-content;
}

.preguntas-navegacion h3 {
  margin-bottom: 15px;
  color: #333;
  font-size: 16px;
}

.preguntas-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.pregunta-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
  min-height: 60px;
}

.pregunta-nav-item:hover {
  border-color: #007bff;
  background: #f8f9fa;
}

.pregunta-nav-item.actual {
  border-color: #007bff;
  background: #e3f2fd;
  box-shadow: 0 2px 8px rgba(0,123,255,0.3);
}

.pregunta-nav-item.correcta {
  border-color: #28a745;
  background: #d4edda;
}

.pregunta-nav-item.incorrecta {
  border-color: #dc3545;
  background: #f8d7da;
}

.pregunta-nav-item.contestada {
  border-color: #ffc107;
  background: #fff3cd;
}

.pregunta-nav-item.no-contestada {
  border-color: #6c757d;
  background: #f8f9fa;
}

.pregunta-numero {
  font-weight: bold;
  font-size: 14px;
  color: #333;
}

.pregunta-estado {
  font-size: 16px;
  margin-top: 4px;
}

/* Estilos para la vista de resultados */
.resultados-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.resultados-header {
  margin-bottom: 30px;
  text-align: center;
}

.resultados-header h1 {
  color: #333;
  margin-bottom: 10px;
}

.resultados-header h2 {
  color: #666;
  font-size: 1.2em;
}

/* Estadísticas */
.resultados-summary {
  margin-bottom: 40px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border: 2px solid transparent;
}

.stat-card.correcta {
  border-color: #28a745;
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
}

.stat-card.incorrecta {
  border-color: #dc3545;
  background: linear-gradient(135deg, #f8d7da, #f5c6cb);
}

.stat-card.no-contestada {
  border-color: #6c757d;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.stat-card.total {
  border-color: #007bff;
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
}

.stat-number {
  font-size: 2.5em;
  font-weight: bold;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 1.1em;
  color: #555;
}

/* Detalle de preguntas */
.resultados-detalle {
  background: white;
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 30px;
}

.resultados-detalle h3 {
  margin-bottom: 20px;
  color: #333;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 10px;
}

.preguntas-resultado {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.pregunta-resultado {
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  background: white;
}

.pregunta-resultado.correcta {
  border-color: #28a745;
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
}

.pregunta-resultado.incorrecta {
  border-color: #dc3545;
  background: linear-gradient(135deg, #f8d7da, #f5c6cb);
}

.pregunta-resultado.no-contestada {
  border-color: #6c757d;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.pregunta-resultado.contestada {
  border-color: #ffc107;
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
}

.pregunta-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0e0e0;
}

.pregunta-header h4 {
  margin: 0;
  color: #333;
}

.pregunta-estado {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
}

.pregunta-texto {
  margin-bottom: 20px;
}

.pregunta-texto p {
  font-size: 1.1em;
  color: #333;
  margin: 0;
}

/* Corrección de opciones */
.correccion-opciones {
  margin-top: 15px;
}

.opciones-correccion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.opcion-correccion {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  background: white;
}

.opcion-correccion.correcta {
  border-color: #28a745;
  background: #d4edda;
}

.opcion-correccion.incorrecta-usuario {
  border-color: #dc3545;
  background: #f8d7da;
}

.opcion-correccion.correcta-usuario {
  border-color: #28a745;
  background: #c3e6cb;
}

.opcion-correccion.faltante {
  border-color: #ffc107;
  background: #fff3cd;
}

.opcion-icono {
  font-size: 1.2em;
  min-width: 24px;
}

.opcion-texto {
  flex: 1;
  font-size: 1em;
}

.correcta-label {
  color: #28a745;
  font-weight: bold;
}

.incorrecta-label {
  color: #dc3545;
  font-weight: bold;
}

.faltante-label {
  color: #ffc107;
  font-weight: bold;
}

.no-contestada-nota {
  margin-top: 10px;
  padding: 10px;
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 4px;
  color: #856404;
}

/* Corrección de texto */
.correccion-texto {
  margin-top: 15px;
}

.respuesta-usuario {
  margin-bottom: 15px;
}

.texto-respuesta {
  margin-top: 8px;
  padding: 12px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-style: italic;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  line-height: 1.5;
}

.texto-respuesta * {
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.nota-texto {
  padding: 10px;
  background: #e3f2fd;
  border: 1px solid #bbdefb;
  border-radius: 4px;
  color: #1976d2;
}

/* Acciones de resultados */
.resultados-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 30px;
}

/* Estilos para diploma */
.btn-success {
  background: #28a745;
  color: white;
}

.btn-success:hover {
  background: #218838;
}

.diploma-info {
  text-align: center;
  padding: 15px;
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 6px;
  margin: 10px 0;
}

.diploma-info p {
  margin: 0;
  color: #856404;
  font-weight: bold;
}

/* Responsive para navegación */
@media (max-width: 768px) {
  .realizar-content {
    grid-template-columns: 1fr;
  }
  
  .preguntas-list {
    grid-template-columns: repeat(4, 1fr);
  }
}

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

/* ============================================================================
   CLASES ADICIONALES IDENTIFICADAS EN APP.JS
   ============================================================================ */

/* Clases para progreso */
.progreso {
  font-size: 1.1rem;
  color: #666;
  padding: 0.5rem;
  background: #f8f9fa;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.progreso-advertencia {
  color: #dc3545;
  font-weight: 500;
}

.progreso-completo {
  color: #198754;
  font-weight: 500;
}

/* Clases para preguntas */
.pregunta-opcion {
  margin-bottom: 20px;
}

.pregunta-multiple {
  margin-bottom: 20px;
}

.pregunta-texto {
  margin-bottom: 20px;
}

/* Clases para opciones */
.opciones {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

/* Estilos de opción ya definidos anteriormente - duplicación eliminada */

/* Mensaje de respuesta bloqueada */
.respuesta-bloqueada {
  background: #e3f2fd;
  border: 1px solid #2196f3;
  border-radius: 6px;
  padding: 10px 15px;
  margin-top: 15px;
  color: #1976d2;
  font-weight: 500;
  text-align: center;
  font-size: 0.9em;
}

/* Clases para resultados */
.resultados-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.resultados-header {
  margin-bottom: 30px;
  text-align: center;
}

.resultados-header h1 {
  color: #333;
  margin-bottom: 10px;
}

.resultados-header h2 {
  color: #666;
  font-size: 1.2em;
}

/* Estadísticas */
.resultados-summary {
  margin-bottom: 40px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border: 2px solid transparent;
}

.stat-card.correcta {
  border-color: #28a745;
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
}

.stat-card.incorrecta {
  border-color: #dc3545;
  background: linear-gradient(135deg, #f8d7da, #f5c6cb);
}

.stat-card.no-contestada {
  border-color: #6c757d;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.stat-card.total {
  border-color: #007bff;
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
}

.stat-number {
  font-size: 2.5em;
  font-weight: bold;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 1.1em;
  color: #555;
}

/* Detalle de preguntas */
.resultados-detalle {
  background: white;
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 30px;
}

.resultados-detalle h3 {
  margin-bottom: 20px;
  color: #333;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 10px;
}

.preguntas-resultado {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.pregunta-resultado {
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  background: white;
}

.pregunta-resultado.correcta {
  border-color: #28a745;
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
}

.pregunta-resultado.incorrecta {
  border-color: #dc3545;
  background: linear-gradient(135deg, #f8d7da, #f5c6cb);
}

.pregunta-resultado.no-contestada {
  border-color: #6c757d;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.pregunta-resultado.contestada {
  border-color: #ffc107;
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
}

.pregunta-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0e0e0;
}

.pregunta-header h4 {
  margin: 0;
  color: #333;
}

.pregunta-estado {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
}

.pregunta-texto {
  margin-bottom: 20px;
}

.pregunta-texto p {
  font-size: 1.1em;
  color: #333;
  margin: 0;
}

/* Corrección de opciones */
.correccion-opciones {
  margin-top: 15px;
}

.opciones-correccion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.opcion-correccion {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  background: white;
}

.opcion-correccion.correcta {
  border-color: #28a745;
  background: #d4edda;
}

.opcion-correccion.incorrecta-usuario {
  border-color: #dc3545;
  background: #f8d7da;
}

.opcion-correccion.correcta-usuario {
  border-color: #28a745;
  background: #c3e6cb;
}

.opcion-correccion.faltante {
  border-color: #ffc107;
  background: #fff3cd;
}

.opcion-icono {
  font-size: 1.2em;
  min-width: 24px;
}

.opcion-texto {
  flex: 1;
  font-size: 1em;
}

.correcta-label {
  color: #28a745;
  font-weight: bold;
}

.incorrecta-label {
  color: #dc3545;
  font-weight: bold;
}

.faltante-label {
  color: #ffc107;
  font-weight: bold;
}

.no-contestada-nota {
  margin-top: 10px;
  padding: 10px;
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 4px;
  color: #856404;
}

/* Corrección de texto */
.correccion-texto {
  margin-top: 15px;
}

.respuesta-usuario {
  margin-bottom: 15px;
}

.texto-respuesta {
  margin-top: 8px;
  padding: 12px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-style: italic;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  line-height: 1.5;
}

.texto-respuesta * {
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.nota-texto {
  padding: 10px;
  background: #e3f2fd;
  border: 1px solid #bbdefb;
  border-radius: 4px;
  color: #1976d2;
}

/* Acciones de resultados */
.resultados-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 30px;
}

/* Responsive para resultados */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .pregunta-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .resultados-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .texto-respuesta {
    font-size: 0.95em;
    padding: 10px;
    line-height: 1.4;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .texto-respuesta {
    font-size: 0.9em;
    padding: 8px;
    line-height: 1.3;
  }
}

/* Responsive para resultados */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .pregunta-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .resultados-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .texto-respuesta {
    font-size: 0.95em;
    padding: 10px;
    line-height: 1.4;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .texto-respuesta {
    font-size: 0.9em;
    padding: 8px;
    line-height: 1.3;
  }
}

/* ============================================================================
   ESTILOS ADICIONALES PARA REALIZAR TEST (Migrados desde editor.css)
   ============================================================================ */

/* Estilos para botones de acción */
.action-buttons {
  display: flex;
  gap: 5px;
  justify-content: flex-start;
}

.action-buttons .btn {
  padding: 6px 10px;
  font-size: 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* Estilos básicos para opciones deshabilitadas */
.opcion.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.opcion.disabled input {
  cursor: not-allowed;
}

.opcion.disabled span {
  color: #6c757d;
}

/* Estilos básicos de opción para compatibilidad */


#detalle-preguntas input[type="radio"][disabled],
#detalle-preguntas input[type="checkbox"][disabled] {
  accent-color: #0d6efd;
  margin-right: 0.5em;
}
