* {
   box-sizing: border-box; 
  
}

/* Botón de menú: oculto por defecto (solo visible en móviles) */
.menu-toggle {
  display: none;
}

body { 
  margin: 0; 
  font-family: Arial, sans-serif; 
  background: #f1f1f1;/*Fondo gris de la página*/
  padding: 0;
  margin: 0;
  color: #333;
}

.intro {
  font-size: 1.1em;
  color: #555;
  margin-bottom: 2em;
  line-height: 1.6;
}


h1 {
  color: #2c3e50;
}

img.diagram {
  max-width: 100%;
  height: auto;
  margin: 1.5em 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  display: block;
}
.success {
  color: green;
  font-weight: bold;
}

.quiz-button-container {
  margin: 2.5em 0;
  text-align: center;
}

.btn-primary,
.btn-exercise {
  display: inline-block;
  background: #2980b9;
  color: white;
  padding: 12px 24px;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
  font-size: 1.1em;
  transition: background 0.2s, transform 0.2s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  border: none;
  cursor: pointer;
}
.btn-primary:hover,
.btn-exercise:hover {
  background: #1c5980;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}


/* === LAYOUT PRINCIPAL === */
.layout { 
  display: flex;
   min-height: 100vh;
   }

/* === SIDEBAR === */
.sidebar {
  width: 250px;
  background: #f9f9f9;
  padding: 20px;
  border-right: 1px solid #e0e0e0;
  box-sizing: border-box;
}

/* ✅ SUPERFICIE ELEVADA: Solo en .main-content */
.main-content {
  flex: 1;
  padding: 24px;
  max-width: 900px;
  margin: 20px auto; /* Centra y añade márgenes */
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.exercise-section {
  margin: 2.5em 0;
  padding: 15px;
  background: #f0f7ff;
  border-radius: 6px;
  text-align: center;
}
/*botones*/
.btn-exercise {
  display: inline-block;
  background: #2980b9;
  color: white;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
}

.btn-exercise:hover {
  background: #1c5980;
}


.quiz-question {
  background: #fafafa;
  padding: 16px;
  margin-bottom: 20px;
  border-radius: 6px;
  border-left: 4px solid #2980b9;
}
.quiz-question input[type="radio"] {
  margin-right: 8px;
}
/* === BLOQUES DE TEXTO === */
.note {
  background: #e7f4ff;
  border-left: 4px solid #2980b9;
  padding: 16px;
  margin: 2em 0;
  border-radius: 0 4px 4px 0;
  font-size: 0.95em;
  line-height: 1.6;
}

.hint {
  margin-top: 10px;
}
.hint button {
  background: #f1f1f1;
  border: 1px solid #ccc;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
}
.hint-text {
  margin-top: 8px;
  padding: 10px;
  background: #e7f4ff;
  border-radius: 4px;
  font-size: 0.95em;
}
.status {
  margin-top: 8px;
  font-weight: bold;
  font-size: 0.9em;
}
.status.correct { color: #27ae60; }
.status.incorrect { color: #e74c3c; }
.status.unanswered { color: #f39c12; }

/* === LISTAS: Estilo W3Schools === */
ul, ol {
  margin: 1.5em 0;          /* ✅ Espacio vertical generoso */
  padding-left: 1.8em;      /* ✅ Sangría clara */
  line-height: 1.7;         /* ✅ Altura de línea cómoda */
}

li {
  margin-bottom: 0.6em;     /* ✅ Espacio entre ítems */
}

/* Sublistas: sangría progresiva */
ul ul, ol ol, ul ol, ol ul {
  margin: 0.8em 0;
  padding-left: 1.5em;      /* ✅ Sangría adicional para sublistas */
}

/* Eliminar márgenes extra en el primer/último ítem */
li > ul, li > ol {
  margin-top: 0.6em;
  margin-bottom: 0;
}

/* === RESPONSIVE: MÓVILES (≤768px) === */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  /* ✅ Reiniciar completamente el sidebar para móviles */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -250px !important;
    width: 250px !important;
    height: 100vh !important;
    background: #f9f9f9 !important;
    padding: 20px !important;
    border: none !important;
    z-index: 999 !important;
    transition: left 0.3s ease !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
  }

  .sidebar.active {
    left: 0 !important;
  }

  .menu-toggle {
    display: flex;
    position: fixed;
    top: 15px;
    left: 15px;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1000;
  }

  .menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background: #2c3e50;
    border-radius: 3px;
  }

  .main-content {
    margin: 80px 15px 20px;
    max-width: none;
    padding: 20px;
  }
}

  .btn-primary,
  .btn-exercise {
    font-size: 1em;
    padding: 10px 20px;
  }


/* === RESPONSIVE: MÓVILES PEQUEÑOS (≤480px) === */
@media (max-width: 480px) {
  .btn-primary,
  .btn-exercise {
    display: block;
    width: 100%;
    text-align: center;
  }

  .quiz-button-container {
    margin: 1.5em 0;
  }

  /* Tablas responsivas */
  table.reference-table,
  table.reference-table thead,
  table.reference-table tbody,
  table.reference-table th,
  table.reference-table td,
  table.reference-table tr {
    display: block;
  }

  table.reference-table thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  table.reference-table tr {
    border: 1px solid #ccc;
    margin-bottom: 10px;
    padding-left: 10px;
  }

  table.reference-table td {
    border: none;
    position: relative;
    padding-left: 50%;
  }

  table.reference-table td:before {
    content: attr(data-label) ": ";
    position: absolute;
    left: 15px;
    width: 45%;
    font-weight: bold;
    color: #2c3e50;
  }
}
/* Añadido para los graficos de progreso del curso */
.user-progress {
  position: absolute;
  top: 15px;
  right: 15px;
  display: flex;
  align-items: center;
}

.progress-ring {
  width: 60px;
  height: 60px;
  position: relative;
}

.progress-ring svg {
  transform: rotate(-90deg);
  overflow: visible;
}

.ring-bg {
  fill: none;
  stroke: #e0e0e0;
  stroke-width: 4;
}

.ring-progress {
  fill: none;
  stroke: #2980b9;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.3s;
}

.avatar {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: white;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.7em;
  font-weight: bold;
  color: #2c3e50;
}