/* Base styles */
:root {
  /* Colores principales */
  --primary: #1e3a5f;
  --primary-light: #2c5282;
  --primary-dark: #0f1e3a;
  
  --secondary: #3b82f6;
  --secondary-light: #60a5fa;
  --secondary-dark: #2563eb;
  
  /* Estados */
  --success: #10b981;
  --success-light: #d1fae5;
  --success-border: #059669;
  
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --warning-border: #d97706;
  
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --danger-border: #dc2626;
  
  --info: #06b6d4;
  --info-light: #cffafe;
  --info-border: #0891b2;
  
  /* Neutros */
  --light: #f9fafb;
  --light-gray: #e5e7eb;
  --medium-gray: #9ca3af;
  --dark: #1f2937;
  --background: #f3f4f6;
  
  /* Correctas e Incorrectas */
  --correct-bg: #d1fae5;
  --correct-text: #065f46;
  --correct-border: #10b981;
  
  --incorrect-bg: #fee2e2;
  --incorrect-text: #991b1b;
  --incorrect-border: #ef4444;
  
  /* Selección y hover */
  --selected-bg: #dbeafe;
  --selected-border: #3b82f6;
  --hover-bg: #f3f4f6;
  
  /* Diseño */
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  line-height: 1.6;
  color: var(--dark);
  background-color: var(--background);
  min-height: 100vh;
}

h1, h2, h3 {
  color: var(--primary);
  margin-bottom: 1rem;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 2rem;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.description {
  text-align: center;
  color: #555;
  margin-bottom: 2rem;
}

/* Form styles */
#quizForm {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
}

label {
  font-weight: 600;
  color: var(--primary);
}

input, select, button {
  width: 100%;
  padding: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: var(--radius);
  font-size: 1rem;
  transition: var(--transition);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

button {
  background: var(--primary);
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  border: none;
}

button:hover {
  background: var(--secondary);
  transform: translateY(-2px);
}

button:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.field-note {
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.25rem;
}

/* Radio group */
.radio-group {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.2rem;
  background: var(--light);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.radio-group input[type="radio"] {
  display: none;
}

.radio-group input[type="radio"]:checked + label {
  background: var(--secondary);
  color: white;
}

/* Generated content */
.caso-estudio {
  background: #f8f9fa;
  border-left: 4px solid #007bff;
  padding: 20px;
  margin: 20px 0;
  border-radius: 4px;
  white-space: pre-line;
  line-height: 1.6;
}

.pregunta {
  margin: 20px 0;
  padding: 15px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
}

.pregunta.respuesta-incorrecta {
  background: var(--incorrect-bg) !important;
  border-left: 5px solid var(--incorrect-border) !important;
  border: 2px solid var(--incorrect-border) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.pregunta.respuesta-correcta {
  background: var(--correct-bg) !important;
  border-left: 5px solid var(--correct-border) !important;
  border: 2px solid var(--correct-border) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.opcion {
  cursor: pointer;
  padding: 12px 15px;
  border: 1px solid #dee2e6;
  border-left: 4px solid #e9ecef;
  border-radius: 4px;
  background: #fff;
  transition: all 0.2s ease;
}

.opcion:hover {
  transform: translateX(5px);
  background: var(--hover-bg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.opcion.selected {
  background: var(--selected-bg);
  border-left-color: var(--selected-border);
  font-weight: 500;
}

.opcion.correcta.show-correct {
  background: var(--correct-bg);
  border-left-color: var(--correct-border);
  font-weight: 500;
}

.opcion.selected:not(.correcta) {
  background: var(--incorrect-bg);
  border-left-color: var(--incorrect-border);
  font-weight: 500;
}

.opcion.correct {
  background: var(--correct-bg);
  border-left-color: var(--correct-border);
  color: var(--correct-text);
  font-weight: 500;
}

.opcion.incorrect {
  background: var(--incorrect-bg);
  border-left-color: var(--incorrect-border);
  color: var(--incorrect-text);
  font-weight: 500;
}

.opcion.show-correct {
  background: var(--correct-bg);
  border-left-color: var(--correct-border);
  opacity: 0.85;
}

.explicacion {
  background: var(--warning-light);
  padding: 1rem;
  border-radius: var(--radius);
  margin-top: 1rem;
  position: relative;
  border-left: 4px solid var(--warning-border);
  display: none;
}

/* Loading indicator */
#loadingIndicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.9);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
  z-index: 1000;
  display: none;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #4A90E2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error message */
.error {
  background: var(--danger-light);
  color: var(--incorrect-text);
  padding: 1rem;
  border-radius: var(--radius);
  margin: 1rem 0;
  border-left: 4px solid var(--danger-border);
  border: 1px solid var(--danger-border);
  display: none;
  text-align: center;
  font-weight: 500;
}

.no-results {
  color: var(--warning-border);
  padding: 1rem;
  margin: 1rem 0;
  background-color: var(--warning-light);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius);
  text-align: center;
  font-weight: 500;
}

.analysis-grid {
  display: block;
  max-width: 800px;
  margin: 2rem auto;
}

/* Action buttons */
.actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.btn-secondary {
  background: var(--medium-gray);
  padding: 0.75rem 1.5rem;
  width: auto;
  border: 1px solid var(--light-gray);
}

.btn-secondary:hover {
  background: var(--dark);
  border-color: var(--dark);
}

/* Footer */
footer {
  text-align: center;
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
  color: #7f8c8d;
}

footer .small {
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    margin: 1rem;
    padding: 1.5rem;
  }
  
  .pregunta::before {
    left: -0.5rem;
    top: -0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.8rem;
  }
  
  .radio-group {
    flex-direction: column;
  }
  
  .actions {
    flex-direction: column;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
  }
  
  .container {
    box-shadow: none;
    margin: 0;
    padding: 0;
  }
  
  #quizForm, .actions, #loadingIndicator, .error, button {
    display: none !important;
  }
  
  .pregunta, .caso-estudio {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  
  .explicacion {
    display: block !important;
    background: white;
    border: 1px solid #ddd;
  }
}
:root {
  /* Paleta de colores */
  --primary: #2c3e50;
  --secondary: #4A90E2;
  --success: #27ae60;
  --warning: #f1c40f;
  --danger: #e74c3c;
  --light: #ecf0f1;
  --dark: #2c3e50;
  --background: #f8f9fa;

  /* Variables de diseño */
  --radius: 8px;
  --shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

/* Estilos base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  line-height: 1.6;
  color: var(--dark);
  background-color: var(--background);
  min-height: 100vh;
}

h1, h2, h3 {
  color: var(--primary);
  margin-bottom: 1rem;
}

/* Contenedor principal */
.container {
  max-width: 960px;
  margin: 2rem auto;
  padding: 2rem;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Intro y descripción */
.intro {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  color: #555;
  border-left: 4px solid var(--secondary);
  padding-left: 1rem;
}

/* Formulario */
#quizForm {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2rem;
  background: var(--light);
  padding: 1.5rem;
  border-radius: var(--radius);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
}

label {
  font-weight: 600;
  color: var(--primary);
}

input, select, button {
  width: 100%;
  padding: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: var(--radius);
  font-size: 1rem;
  transition: var(--transition);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

button {
  background: var(--primary);
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  border: none;
  margin-top: 1rem;
}

button:hover {
  background: var(--secondary);
  transform: translateY(-2px);
}

.field-hint {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.3rem;
}

/* Indicador de carga */
#loadingIndicator {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(74, 144, 226, 0.2);
  border-radius: 50%;
  border-top-color: var(--secondary);
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 1.5rem;
}

.loading-hint {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0.5rem;
  font-style: italic;
}

/* Contenido generado */
#output {
  margin: 2rem 0;
}

.caso-estudio {
  background: #f5f5f5;
  padding: 2rem;
  border-radius: var(--radius);
  margin-bottom: 25px;
  border-left: 4px solid var(--secondary);
}

.pregunta {
  margin: 20px 0;
  padding: 20px;
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: relative;
  counter-increment: pregunta;
}

.pregunta::before {
  content: counter(pregunta);
  position: absolute;
  left: -15px;
  top: -10px;
  background: var(--secondary);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.opcion, .option {
  padding: 1rem;
  margin: 0.5rem 0;
  border-left: 4px solid #ddd;
  background: var(--light);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.opcion:hover, .option:hover {
  transform: translateX(10px);
  background: #e5e5e5;
}

.opcion.selected, .option.selected {
  border-left-color: var(--success);
  background: #e3f8ec;
}

.option.correct {
  background: #d4edda;
  border-left-color: #28a745;
}

.option.incorrect {
  background: #f8d7da;
  border-left-color: #dc3545;
}

.explicacion, .explanation {
  background: #fff9e6;
  padding: 1.5rem;
  border-radius: var(--radius);
  margin-top: 1rem;
  position: relative;
  display: none;
  border-left: 4px solid var(--warning);
}

.tri-info {
  margin-top: 10px;
  font-size: 0.85rem;
  background: #e3f2fd;
  padding: 8px 12px;
  border-radius: 4px;
  color: #0d47a1;
}

.dificultad-facil {
  color: var(--success);
  font-weight: 600;
}

.dificultad-media {
  color: var(--warning);
  font-weight: 600;
}

.dificultad-alta {
  color: var(--danger);
  font-weight: 600;
}

/* Instrucciones */
.instructions {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: var(--radius);
  margin: 2rem 0;
}

.instructions h3 {
  margin-bottom: 1rem;
  color: var(--primary);
}

.instructions ul {
  margin-left: 1.5rem;
}

.instructions li {
  margin-bottom: 0.5rem;
}

.instructions ul ul {
  margin-top: 0.5rem;
}

/* Footer */
footer {
  margin-top: 3rem;
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
  font-size: 0.9rem;
  color: #666;
}

.back-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--secondary);
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

/* Manejo de errores */
.error-container {
  background-color: var(--danger-light);
  border-left: 5px solid var(--danger-border);
  padding: 1.5rem;
  margin: 1.5rem 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.error-container h3 {
  color: var(--danger-border);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.error-container pre {
  background: #f8f8f8;
  padding: 0.75rem;
  border-radius: 4px;
  margin-top: 1rem;
  overflow-x: auto;
  font-size: 0.9rem;
}

/* Conclusión */
.conclusion {
  margin-top: 30px;
  padding: 20px;
  background: #e3f2fd;
  border-radius: var(--radius);
  border-left: 4px solid var(--secondary);
}

/* Animaciones */
@keyframes spin {
  to { transform: rotate(360deg); }
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .container {
      margin: 1rem;
      padding: 1.5rem;
  }
  
  .pregunta::before {
      left: -10px;
      top: -10px;
      width: 25px;
      height: 25px;
      font-size: 0.9rem;
  }
}

/* Para los elementos generados por DeepSeek/Gemini */
li.option {
  list-style: none;
  padding: 0.75rem;
  margin: 0.5rem 0;
  border-left: 3px solid #ddd;
  background: #f9f9f9;
  transition: all 0.2s ease;
  cursor: pointer;
}

li.option:hover {
  transform: translateX(5px);
  background: #f0f0f0;
}
/* Estilos para las nuevas funcionalidades */
.hint {
  display: block;
  font-size: 0.8rem;
  color: #666;
  margin-top: 4px;
}

.option {
  cursor: pointer;
  padding: 10px 15px;
  margin: 5px 0;
  border-left: 3px solid var(--light-gray);
  background: #fff;
  transition: all 0.2s ease;
  position: relative;
}

.option:hover {
  transform: translateX(5px);
  background: var(--hover-bg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.option.selected {
  background: var(--selected-bg);
  border-left-color: var(--selected-border);
  font-weight: 500;
}

.option.correct {
  background: var(--correct-bg);
  border-left-color: var(--correct-border);
  color: var(--correct-text);
  font-weight: 500;
}

.option.incorrect {
  background: var(--incorrect-bg);
  border-left-color: var(--incorrect-border);
  color: var(--incorrect-text);
  font-weight: 500;
}

.option.correct-answer {
  border-left-color: var(--correct-border) !important;
  background: var(--correct-light);
  opacity: 0.85;
}

.option.correct::after {
  content: "✓";
  position: absolute;
  right: 10px;
  color: var(--success-border);
  font-weight: bold;
  font-size: 1.2em;
}

.option.incorrect::after {
  content: "✗";
  position: absolute;
  right: 10px;
  color: var(--danger-border);
  font-weight: bold;
  font-size: 1.2em;
}

.explicacion {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 6px;
  margin-top: 10px;
  display: none;
  border-left: 4px solid #f1c40f;
}

.result-summary {
  padding: 15px;
  margin-top: 15px;
  background: #f8f9fa;
  border-radius: 4px;
  text-align: center;
}

.score-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 20px 0;
}

.score {
  font-size: 24px;
  font-weight: bold;
  color: #007bff;
  margin-bottom: 10px;
}

.progress-bar {
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  margin: 10px 0;
  overflow: hidden;
}

#progressBar {
  height: 100%;
  background: #007bff;
  transition: width 0.3s ease;
}

.reset-button {
  background: #3498db;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  margin-top: 20px;
}

.reset-button:hover {
  background: #2980b9;
  transform: translateY(-2px);
}

#loadingIndicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-left: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

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

/* Añade esto a tu archivo style.css */
.explicacion {
  background: #f9f9f9;
  padding: 15px;
  border-left: 3px solid #4A90E2;
  margin-top: 10px;
  display: none; /* Oculto por defecto */
}

.option {
  cursor: pointer;
  padding: 8px 12px;
  margin: 5px 0;
  border-left: 3px solid #e0e0e0;
  transition: all 0.2s ease;
}

.option:hover {
  background: #f2f2f2;
  transform: translateX(5px);
}

.option.selected {
  background: #e3f2fd;
  border-left-color: #2196f3;
}

/* Estilos para manejo de timeouts y errores */
.error-container {
  background-color: #fdecea;
  border-left: 4px solid var(--danger);
  padding: 1.5rem;
  margin: 1.5rem 0;
  border-radius: var(--radius);
  animation: fadeIn 0.5s ease;
}

.error-container h3 {
  color: var(--danger);
  margin-bottom: 0.5rem;
}

.error-container ul {
  margin-left: 1.5rem;
  margin-top: 1rem;
}

.error-container li {
  margin-bottom: 0.5rem;
}

.error-container pre {
  background: #f8f8f8;
  padding: 0.75rem;
  border-radius: 4px;
  margin-top: 1rem;
  overflow-x: auto;
  font-size: 0.9rem;
}

.warning-container {
  background-color: var(--warning-light);
  border-left: 5px solid var(--warning-border);
  padding: 1rem;
  margin: 1rem 0;
  border-radius: var(--radius);
  font-size: 0.9rem;
  opacity: 1;
  transition: opacity 0.5s ease;
  animation: slideIn 0.5s ease;
  box-shadow: var(--shadow);
}

/* Animación para deslizar advertencias */
@keyframes slideIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Estilos para mensajes de timeout específicos */
.timeout-message {
  background-color: var(--light);
  border: 1px solid var(--light-gray);
  border-left: 5px solid var(--warning-border);
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow);
}

.timeout-message h3 {
  color: var(--warning-border);
  margin-bottom: 1rem;
  font-weight: 700;
}

.timeout-message .icon {
  font-size: 3rem;
  color: var(--warning);
  margin-bottom: 1rem;
}

.timeout-message .suggestions {
  text-align: left;
  background: #fff;
  padding: 1rem;
  border-radius: var(--radius);
  margin: 1rem 0;
  border: 1px solid #eee;
}

/* Estilos para limitación de preguntas */
.limit-warning {
  background-color: #e3f2fd;
  border-left: 4px solid var(--secondary);
  padding: 0.75rem 1rem;
  margin: 0.5rem 0 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: #0d47a1;
}

/* Estilos para el botón de respuestas cuando está deshabilitado */
.show-answers-btn:disabled {
  background-color: #ccc !important;
  cursor: not-allowed;
  transform: none !important;
}

/* Optimizar spinner de carga */
@keyframes optimizedSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.spinner {
  border: 4px solid rgba(74, 144, 226, 0.1);
  border-radius: 50%;
  border-top: 4px solid var(--secondary);
  animation: optimizedSpin 0.8s linear infinite;
}


.btn-view, .btn-delete {
  padding: 5px 10px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.btn-view {
  background-color: var(--secondary);
  color: white;
}

.btn-view:hover {
  background-color: var(--secondary-dark);
  box-shadow: var(--shadow);
}

.btn-delete {
  background-color: var(--danger);
  color: white;
}

.btn-delete:hover {
  background-color: var(--danger-border);
  box-shadow: var(--shadow);
}

.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 2rem;
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    text-decoration: none;
    color: #495057;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background-color: #e9ecef;
    color: #212529;
}

.nav-link.active {
    background-color: #007bff;
    color: white;
}

#userInfo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #6c757d;
}

#userName {
    font-weight: 500;
}

#userRole {
    font-style: italic;
}

.analysis-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    padding: 20px;
}

.case-study {
    background: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.case-text {
    white-space: pre-line;
    line-height: 1.6;
    margin: 10px 0;
}

.questions-section {
    margin-top: 20px;
}

.question {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
    margin: 10px 0;
}

.question h5 {
    color: #495057;
    margin: 0 0 8px 0;
}

.metadata-footer {
    color: #6c757d;
    font-size: 0.9em;
}

.view-button {
  background: var(--secondary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.view-button:hover {
  background: var(--secondary-dark);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}.no-questions {
    color: #6c757d;
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.loading-indicator {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    flex-direction: column;
    align-items: center;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

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

.question-group {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.options {
    margin-top: 10px;
}

.option {
    cursor: pointer;
    padding: 10px 15px;
    margin: 5px 0;
    border-left: 3px solid #e0e0e0;
    background: #fff;
    transition: all 0.2s ease;
}

.option:hover {
    transform: translateX(5px);
    background: #e9ecef;
}

.option.selected {
    background: #e3f2fd;
    border-left-color: #2196f3;
}

.option.correct {
    background: #d4edda;
    border-left-color: #28a745;
}

.option.incorrect {
    background: #f8d7da;
    border-left-color: #dc3545;
}

.option.correct-answer {
    border-left-color: #28a745;
    background: #d4edda;
    opacity: 0.7;
}

.progress {
    height: 100%;
    background: #28a745;
    transition: width 0.3s ease;
}

.calculate-section {
    position: sticky;
    bottom: 20px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    margin-top: 30px;
    text-align: center;
}

.calculate-all-btn {
    background: #007bff;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 4px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calculate-all-btn:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

.total-result-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: center;
}

.total-result-summary h3 {
    color: #333;
    margin-bottom: 15px;
}

.total-result-summary .score {
    font-size: 36px;
    color: #007bff;
    margin: 10px 0;
}

.resultado {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    margin: 10px 0;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: #28a745;
    transition: width 0.3s ease;
}

.feedback {
    margin-top: 10px;
    font-style: italic;
    color: #6c757d;
}

.show-answers-btn {
    width: 100%;
    padding: 10px;
    margin: 15px 0;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.show-answers-btn:hover {
    background: #0056b3;
}

.show-answers-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.analysis-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    padding: 20px;
}

.caso-section {
    background: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    white-space: pre-line;
    line-height: 1.6;
}

.pregunta {
    margin: 20px 0;
    padding: 15px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.opciones {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.opcion {
    cursor: pointer;
    padding: 12px 15px;
    border: 1px solid #dee2e6;
    border-left: 3px solid #e0e0e0;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.opcion:hover {
    transform: translateX(5px);
    background: #e9ecef;
}

.opcion.selected {
    background: #e3f2fd;
    border-left-color: #2196f3;
}

.opcion.correct {
    background: #d4edda;
    border-left-color: #28a745;
}

.opcion.incorrect {
    background: #f8d7da;
    border-left-color: #dc3545;
}

.opcion.show-correct {
    background: #d4edda;
    border-left-color: #28a745;
    opacity: 0.7;
}

.calculate-btn {
    width: 100%;
    padding: 12px;
    margin-top: 20px;
    background: #ff00dd;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.calculate-btn:hover {
    background: #00b32d;
}

.results {
    margin-top: 20px;
    text-align: center;
}

.progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    margin: 10px 0;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: #28a745;
    transition: width 0.3s ease;
}

.error-messages {
    color: #dc3545;
    margin-bottom: 15px;
    text-align: center;
}

.error-messages p {
    margin: 5px 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.form-group {
    position: relative;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: #007bff;
    outline: none;
}

.protected-link {
    display: none;
}

.guest-only {
    display: inline-block;
}

.feature-card {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.feature-card.protected:not(.authenticated) {
    opacity: 0.7;
    pointer-events: none;
}

.feature-card.protected:not(.authenticated)::after {
    content: "Inicia sesión para acceder";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 1rem;
    border-radius: 4px;
}

.error-container {
    text-align: center;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 600px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.error-container h1 {
    color: #dc3545;
    margin-bottom: 1rem;
}

.error-container p {
    color: #666;
    margin-bottom: 2rem;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #0056b3;
}

/* Estilos para barras de progreso */
.progress {
    background-color: #4CAF50;
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress.warning {
    background-color: #FFC107;
}

.progress.danger {
    background-color: #FF5722;
}

.progress-container {
    margin-bottom: 25px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.progress-bar {
    background-color: #f0f0f0;
    height: 10px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    color: #666;
}

/* Alerta de plan por expirar */
.plan-alert {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    border-radius: 4px;
    padding: 10px 15px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.plan-alert-icon {
    margin-right: 10px;
    font-size: 1.2em;
}

.plan-alert-actions {
    margin-left: 10px;
}

.plan-alert-actions button {
    background-color: #856404;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.9em;
}

.plan-alert-actions button:hover {
    background-color: #6a500a;
}

/* Estilos para las páginas de autenticación */
.auth-container {
  max-width: 450px;
  margin: 40px auto;
  padding: 25px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.auth-header {
  text-align: center;
  margin-bottom: 25px;
}

.auth-header h2 {
  color: #2c3e50;
  margin-bottom: 10px;
}

.auth-header p {
  color: #7f8c8d;
  font-size: 0.9rem;
}

.auth-form {
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #2c3e50;
}

.form-control {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-control:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.auth-btn {
  width: 100%;
  padding: 12px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s;
}

.auth-btn:hover {
  background-color: #2980b9;
}

.auth-btn:disabled {
  background-color: #95a5a6;
  cursor: not-allowed;
}

.auth-toggle {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.auth-toggle a {
  color: #3498db;
  text-decoration: none;
  font-weight: 500;
}

.auth-toggle a:hover {
  text-decoration: underline;
}

.error-message {
  padding: 12px;
  background-color: #f8d7da;
  color: #721c24;
  border-radius: 5px;
  margin-bottom: 20px;
  display: none;
}

.success-message {
  padding: 12px;
  background-color: #d4edda;
  color: #155724;
  border-radius: 5px;
  margin-bottom: 20px;
  display: none;
}

.plan-selection {
  margin: 20px 0;
}

.plan-option {
  display: flex;
  align-items: center;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.3s;
}

.plan-option:hover {
  border-color: #3498db;
  background-color: #f8f9fa;
}

.plan-option.selected {
  border-color: #3498db;
  background-color: #e3f2fd;
}

.plan-option input[type="radio"] {
  margin-right: 15px;
}

.plan-details {
  flex: 1;
}

.plan-title {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 5px;
}

.plan-price {
  font-weight: 600;
  color: #3498db;
}

.plan-description {
  font-size: 0.85rem;
  color: #7f8c8d;
  margin-top: 5px;
}

.auth-separator {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
}

.auth-separator::before,
.auth-separator::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #eee;
}

.auth-separator span {
  padding: 0 10px;
  color: #7f8c8d;
  font-size: 0.9rem;
}

/* Cambios para dispositivos móviles */
@media (max-width: 576px) {
  .auth-container {
      max-width: 100%;
      margin: 20px 10px;
      padding: 20px;
  }

  .auth-header h2 {
      font-size: 1.5rem;
  }
}
/* Estilos adicionales para la selección de planes */
.plan-selection {
  margin: 25px 0;
}

.plan-selection h3 {
  margin-bottom: 15px;
  color: #2c3e50;
  font-size: 1rem;
}

.plan-option {
  display: flex;
  align-items: center;
  padding: 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 15px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.plan-option:hover {
  border-color: #3498db;
  background-color: #f8f9fa;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.plan-option.selected {
  border-color: #3498db;
  background-color: #e3f2fd;
}

.plan-option.selected::before {
  content: "✓";
  position: absolute;
  top: -10px;
  right: -10px;
  width: 25px;
  height: 25px;
  background-color: #3498db;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
}

.plan-option input[type="radio"] {
  margin-right: 15px;
  transform: scale(1.2);
}

.plan-details {
  flex: 1;
}

.plan-title {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 5px;
  font-size: 1.1rem;
}

.plan-price {
  font-weight: 600;
  color: #3498db;
  font-size: 1.2rem;
  margin-bottom: 5px;
}

.plan-description {
  font-size: 0.85rem;
  color: #7f8c8d;
  line-height: 1.4;
}

/* Estilo para checkbox de términos */
.checkbox-container {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  color: #7f8c8d;
  cursor: pointer;
}

.checkbox-container input[type="checkbox"] {
  margin-right: 10px;
  transform: scale(1.2);
}

.checkbox-container a {
  color: #3498db;
  text-decoration: none;
}

.checkbox-container a:hover {
  text-decoration: underline;
}

/* Mensaje inicial para el login */
.auth-welcome {
  text-align: center;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.auth-welcome h3 {
  color: #2c3e50;
  margin-bottom: 10px;
  font-size: 1.3rem;
}

.auth-welcome p {
  color: #7f8c8d;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Estilo para dispositivos móviles */
@media (max-width: 576px) {
  .plan-option {
      flex-direction: column;
      align-items: flex-start;
  }
  
  .plan-option input[type="radio"] {
      margin-bottom: 10px;
      align-self: center;
  }
  
  .plan-details {
      width: 100%;
  }
}
.error-message {
  background-color: #fee2e2;
  border: 1px solid #ef4444;
  color: #dc2626;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.auth-form {
  max-width: 400px;
  margin: 40px auto;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.filters-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
  padding: 15px;
  background: #f5f5f5;
  border-radius: 8px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.analysis-card {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 10px;
}

.timestamp {
  font-size: 0.8em;
  color: #666;
}

.content-preview {
  max-height: 150px;
  overflow: hidden;
  margin-bottom: 15px;
}

.view-button {
  width: 100%;
  padding: 8px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.view-button:hover {
  background: #0056b3;
}

.limit-exceeded {
  color: #e74c3c;
  font-weight: bold;
}

.plan-expiration {
  margin-top: 10px;
  padding: 8px;
  border-radius: 4px;
  background-color: #f8f9fa;
}

.plan-expired {
  background-color: #fee8e7;
}

.plan-expiring-soon {
  background-color: #fff3cd;
}

.days-left {
  font-size: 0.9em;
  color: #555;
  margin-left: 8px;
}

.days-expired {
  font-size: 0.9em;
  color: #e74c3c;
  font-weight: bold;
}

.plan-indicator {
  background-color: #e8f4fd;
  border-radius: 4px;
  padding: 5px 10px;
  display: inline-block;
  margin-bottom: 15px;
  font-size: 0.9em;
}
.plan-premium {
  background-color: #d4edda;
}
#plan-quality {
  font-weight: bold;
}
.demo-banner {
  background-color: #e8f4fd;
  color: #0c5460;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
  border-left: 5px solid #17a2b8;
}

.login-cta {
  text-align: center;
  margin: 30px 0;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.login-button {
  display: inline-block;
  background-color: #3498db;
  color: white;
  padding: 12px 30px;
  border-radius: 30px;
  font-size: 1.1em;
  text-decoration: none;
  transition: background-color 0.3s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  margin-top: 10px;
}

.login-button:hover {
  background-color: #2980b9;
  transform: translateY(-2px);
}

.analysis-card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 15px;
  margin-bottom: 15px;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.analysis-card.selected {
  border: 2px solid #4CAF50;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.analysis-card.selected::before {
  content: "✓";
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #4CAF50;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.analysis-title {
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 8px;
  color: #2c3e50;
}

.analysis-details {
  color: #7f8c8d;
  font-size: 0.9em;
  margin-bottom: 5px;
}

.analysis-questions {
  display: inline-block;
  background-color: #e0f2fe;
  color: #0078d4;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.analysis-date {
  color: #95a5a6;
  font-size: 0.85em;
}

.analyses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.back-link {
  display: inline-block;
  margin-top: 20px;
  color: #3498db;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

/* Estilos para las preguntas y opciones */
.question-container {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 20px;
  margin-bottom: 30px;
}

.question-header {
  font-size: 1.1em;
  font-weight: bold;
  margin-bottom: 15px;
  position: relative;
  padding-right: 80px;
}

.question-difficulty {
  position: absolute;
  right: 0;
  top: 0;
  background-color: #e0f2fe;
  color: #0078d4;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8em;
  font-weight: normal;
}

.options-container {
  margin-bottom: 15px;
}

.option {
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  padding-left: 35px;
}

.option:hover {
  background-color: #f5f5f5;
}

.option.selected {
  background-color: #e8f4fd;
  border-color: #3498db;
}

.option-letter {
  font-weight: bold;
  display: inline-block;
  margin-right: 5px;
  position: absolute;
  left: 15px;
}

.explanation-container {
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 6px;
  border-left: 4px solid #17a2b8;
}

.explanation-container h4 {
  margin-top: 0;
  color: #17a2b8;
}

/* Estilos para resultados */
.correct {
  background-color: #d4edda !important;
  border-color: #28a745 !important;
  color: #155724;
}

.incorrect {
  background-color: #f8d7da !important;
  border-color: #dc3545 !important;
  color: #721c24;
}

.results-summary {
  text-align: center;
  padding: 30px;
  margin-bottom: 40px;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.score {
  font-size: 5em;
  font-weight: bold;
  color: #3498db;
  margin-bottom: 10px;
}

.score-details {
  font-size: 1.2em;
  color: #7f8c8d;
  margin-bottom: 20px;
}

.progress-container {
  width: 100%;
  max-width: 400px;
  margin: 0 auto 20px;
}

.progress-bar {
  height: 15px;
  background-color: #ecf0f1;
  border-radius: 10px;
  overflow: hidden;
}

.progress {
  height: 100%;
  background-color: #3498db;
  border-radius: 10px;
}

.feedback {
  font-size: 1.1em;
  padding: 10px 20px;
  border-radius: 6px;
  display: inline-block;
}

.feedback-excellent {
  background-color: #d4edda;
  color: #155724;
}

.feedback-good {
  background-color: #d1ecf1;
  color: #0c5460;
}

.feedback-average {
  background-color: #fff3cd;
  color: #856404;
}

.feedback-poor {
  background-color: #f8d7da;
  color: #721c24;
}