/* optimizations.css - Optimizaciones de rendimiento */

/* Optimizaciones de renderizado */
* {
  box-sizing: border-box;
}

/* Hardware acceleration para animaciones */
.card, .btn, .opcion {
  transform: translateZ(0);
  will-change: transform;
}

/* Optimizaciones para tablas grandes */
#tabla-tests table {
  contain: layout style paint;
}

#tabla-tests tbody tr {
  contain: layout style;
}

/* Lazy loading para imágenes */
/* NOTA: El atributo loading="lazy" se debe agregar en el HTML, no en CSS */
img {
  /* Optimizaciones de imagen */
  max-width: 100%;
  height: auto;
  display: block;
}

/* Optimizaciones de scroll */
html {
  scroll-behavior: smooth;
}

/* Optimizaciones de hover */
.btn-icon:hover,
.opcion:hover {
  transform: translateZ(0) scale(1.02);
  transition: transform 0.15s ease-out;
}

/* Optimizaciones para modales */
.modal-aviso-overlay {
  backdrop-filter: blur(2px);
  will-change: opacity;
}

/* Optimizaciones para formularios */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  transform: translateZ(0);
}

/* Optimizaciones para drag & drop */
.dragging {
  will-change: transform;
  transform: translateZ(0) rotate(2deg);
}

/* Optimizaciones para animaciones de carga */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* Optimizaciones para responsive */
@media (max-width: 768px) {
  .card {
    contain: layout style;
  }
  
  #tabla-tests table {
    font-size: 0.9em;
  }
}

/* Optimizaciones para impresión */
@media print {
  .btn, .btn-icon {
    display: none !important;
  }
  
  #tabla-tests table {
    border-collapse: collapse;
  }
  
  #tabla-tests td,
  #tabla-tests th {
    border: 1px solid #000;
  }
}

/* Optimizaciones para accesibilidad */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Optimizaciones para modo oscuro */
@media (prefers-color-scheme: dark) {
  .card {
    background: #2d3748;
    color: #e2e8f0;
  }
  
  #tabla-tests table th {
    background: #4a5568;
  }
  
  #tabla-tests table tbody tr:nth-child(even) {
    background: #2d3748;
  }
}

/* Estilos para página de detalles */
.detalles-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

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

.detalles-header h1 {
  color: #2c3e50;
  margin: 0;
  font-size: 2.5em;
}

.detalles-content {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.detalles-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.btn-large {
  padding: 15px 30px;
  font-size: 1.2em;
  font-weight: bold;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,123,255,0.3);
  transition: all 0.3s ease;
}

.btn-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,123,255,0.4);
}

.descripcion-card {
  background: white;
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  border: 1px solid #e1e8ed;
  width: 100%;
}

.descripcion-card h3 {
  margin: 0 0 15px 0;
  color: #2c3e50;
  font-size: 1.2em;
}

.descripcion-card p {
  margin: 0;
  line-height: 1.6;
  color: #495057;
  font-size: 1em;
}

.info-cards-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.info-card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  border: 1px solid #e1e8ed;
}

.info-card h3 {
  margin: 0 0 15px 0;
  color: #2c3e50;
  font-size: 1.2em;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.info-item {
  padding: 10px;
  background: #f8f9fa;
  border-radius: 5px;
  border-left: 3px solid #007bff;
}

.preguntas-summary {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.total-preguntas {
  font-size: 1.1em;
  color: #2c3e50;
  padding: 10px;
  background: #e3f2fd;
  border-radius: 5px;
  text-align: center;
}

.preguntas-por-tipo {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tipo-pregunta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 5px;
  border-left: 3px solid #28a745;
}

.tipo-icon {
  font-size: 1.2em;
}

.tipo-nombre {
  flex: 1;
  font-weight: 500;
}

.tipo-cantidad {
  background: #007bff;
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.9em;
  font-weight: bold;
}

.action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Responsive para detalles */
@media (max-width: 768px) {
  .info-cards-container {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
  }
  
  .detalles-header h1 {
    font-size: 2em;
  }
  
  .btn-large {
    padding: 12px 24px;
    font-size: 1.1em;
  }
  
  .descripcion-card {
    padding: 20px;
  }
}

/* Estilos para pantalla de previsualización */
.preview-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: white;
}

.preview-header {
  text-align: center;
  margin-bottom: 40px;
  background: rgba(255, 255, 255, 0.1);
  padding: 30px;
  border-radius: 15px;
  backdrop-filter: blur(10px);
}

.preview-header h1 {
  margin: 0 0 15px 0;
  font-size: 2.5em;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.preview-subtitle {
  display: flex;
  justify-content: center;
  gap: 30px;
  font-size: 1.1em;
  opacity: 0.9;
}

.preview-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  margin-bottom: 40px;
}

.preview-description {
  background: rgba(255, 255, 255, 0.1);
  padding: 25px;
  border-radius: 15px;
  backdrop-filter: blur(10px);
}

.preview-description h2 {
  margin: 0 0 20px 0;
  font-size: 1.5em;
  color: #ffd700;
}

.description-text {
  font-size: 1.1em;
  line-height: 1.6;
  text-align: justify;
}

.preview-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.info-section, .questions-preview {
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 15px;
  backdrop-filter: blur(10px);
}

.info-section h3, .questions-preview h3 {
  margin: 0 0 15px 0;
  font-size: 1.3em;
  color: #ffd700;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.info-item {
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  border-left: 3px solid #ffd700;
}

.questions-types {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.question-type {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  border-left: 3px solid #28a745;
}

.type-icon {
  font-size: 1.3em;
}

.type-name {
  flex: 1;
  font-weight: 500;
}

.type-count {
  background: #ffd700;
  color: #333;
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 0.9em;
  font-weight: bold;
}

.preview-actions {
  background: rgba(255, 255, 255, 0.1);
  padding: 30px;
  border-radius: 15px;
  backdrop-filter: blur(10px);
  text-align: center;
}

.action-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-bottom: 30px;
}

.preview-tips {
  text-align: left;
  max-width: 600px;
  margin: 0 auto;
}

.preview-tips h4 {
  margin: 0 0 15px 0;
  color: #ffd700;
  font-size: 1.2em;
}

.preview-tips ul {
  margin: 0;
  padding-left: 20px;
}

.preview-tips li {
  margin-bottom: 8px;
  line-height: 1.5;
}

/* Responsive para previsualización */
@media (max-width: 768px) {
  .preview-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .preview-header h1 {
    font-size: 2em;
  }
  
  .preview-subtitle {
    flex-direction: column;
    gap: 10px;
  }
  
  .action-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .btn-large {
    width: 100%;
    max-width: 300px;
  }
} 