/* ===== Reset básico ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

/* ===== Fondo y centrado ===== */
h1 {
  text-align: center;
  margin-bottom: 20px;
}

body {
  background: linear-gradient(135deg, #1a1a1a, #3a3a3a);
  color: #f5f5f5;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  min-height: 100vh;
  padding: 30px;
}

/* ===== Contenedor principal ===== */
.content {
  background: #ffffff15;
  padding: 20px 30px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  width: 100%;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ===== Formulario ===== */
.formulario {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 25px;
}

/* ===== Labels y selects ocultos al inicio ===== */
#formulario label,
#formulario select,
#formulario button {
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* Mostrar por defecto el primer label y select (curso) */
#formulario label[for="curso"],
#formulario #curso {
  display: block;
  opacity: 1;
}

/* ===== Labels ===== */
#formulario label {
  font-weight: bold;
  margin-bottom: 5px;
  color: #ddd;
}

/* ===== Selects ===== */
#formulario select {
  padding: 10px;
  border-radius: 6px;
  border: none;
  background: #f5f5f5;
  color: #333;
  font-size: 14px;
  width: 100%;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* ===== Botón ===== */
#formulario button {
  background: #4cafef;
  color: white;
  font-size: 16px;
  padding: 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: background 0.3s ease;
}

#formulario button:hover {
  background: #1e90ff;
}

/* ===== Tabla de resultados ===== */
.tabla {
  text-align: center;
}

.tabla h2 {
  margin-bottom: 15px;
  color: #fff;
}

#tablaResultado {
  width: 100%;
  border-collapse: collapse;
  background: #f9f9f9;
  color: #333;
  border-radius: 8px;
  overflow: hidden;
}

#tablaResultado th,
#tablaResultado td {
  border: 1px solid #ddd;
  padding: 10px;
  text-align: left;
  font-size: 14px;
}

#tablaResultado th {
  background: #4cafef;
  color: white;
}

#tablaResultado tr:nth-child(even) {
  background: #f1f1f1;
}

#tablaResultado ul {
  margin: 0;
  padding-left: 18px;
}

footer {
  padding-top: 10px;
  text-align: center;
  color: #838383;
}

/* ===== Responsividad ===== */
@media (max-width: 800px) {
  body {
    font-size: 90%;
    padding: 15px;
  }

  .content {
    width: 100%;
    padding: 15px;
  }

  form {
    gap: 10px;
  }

  form select,
  form button {
    font-size: 1rem;
    padding: 12px;
  }

  table,
  th,
  td {
    font-size: 0.9rem;
    word-wrap: break-word;
  }
}

@media (max-width: 500px) {
  #tablaResultado,
  #tablaResultado th,
  #tablaResultado td {
    display: block;
    width: 100%;
  }

  #tablaResultado td:before {
  content: attr(data-label);
}

  #tablaResultado th {
    display: none;
  }

  #tablaResultado td {
    border: none;
    background-color: red;
    padding: 8px;
    border-bottom: 1px solid #ddd;
  }

  #tablaResultado td:before {
    content: attr(data-label);
    font-weight: bold;
    display: block;
    margin-bottom: 4px;
    color: #4ca1af;
  }
}
