/* ===== Estilos base ===== */
body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #fce4ec;
  color: #4a4a4a;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s, color 0.3s;
}

header {
  background-color: #f8bbd0;
  padding: 20px;
  text-align: center;
  color: #880e4f;
}

h1 {
  margin: 0;
}

/* ===== Stats ===== */
.stats {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 10px;
  font-weight: bold;
}

/* ===== Barra de progreso ===== */
#barra-progreso {
  background-color: #fce4ec;
  border: 1px solid #ec407a;
  width: 80%;
  margin: 10px auto;
  height: 20px;
  border-radius: 10px;
  overflow: hidden;
}

#avance {
  background-color: #d81b60;
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
}

/* ===== Controles ===== */
.controles {
  margin: 10px auto;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.controles button,
.controles input {
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  font-weight: bold;
  cursor: pointer;
}

#reiniciar {
  background-color: #f48fb1;
}

#solo-disponibles {
  background-color: #f06292;
  color: white;
}

#buscador {
  border: 1px solid #ccc;
}

/* ===== Switch modo oscuro ===== */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 26px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #d81b60;
}
input:checked + .slider:before {
  transform: translateX(24px);
}

/* ===== Leyenda ===== */
#leyenda {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}
.leyenda {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 14px;
}
.aprobado { background-color: #c8e6c9; color: #2e7d32; }
.disponible { background-color: #ffe0f0; color: #880e4f; }
.bloqueado { background-color: #f3f3f3; color: #aaa; }

/* ===== Malla ===== */
#malla {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  padding: 20px;
}
.semestre {
  background-color: #f8bbd0;
  border-radius: 10px;
  padding: 15px;
}
.semestre h2 {
  text-align: center;
  margin-bottom: 10px;
  color: #880e4f;
}
.ramo {
  background-color: #ffe0f0;
  border: 2px solid #f06292;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  text-align: center;
  font-weight: bold;
}
.ramo.aprobado {
  background-color: #c8e6c9;
  border-color: #388e3c;
  color: #2e7d32;
}
.ramo.bloqueado {
  background-color: #f3f3f3;
  border-color: #ccc;
  color: #aaa;
  cursor: not-allowed;
}

/* ===== Modo oscuro ===== */
body.dark {
  background-color: #1c1c1c;
  color: white;
}
body.dark header {
  background-color: #333;
  color: #fff;
}
body.dark #barra-progreso {
  background-color: #444;
  border-color: #666;
}
body.dark #avance {
  background-color: #ff80ab;
}
body.dark .semestre {
  background-color: #333;
}
body.dark .ramo {
  background-color: #555;
  border-color: #888;
}
body.dark .ramo.aprobado {
  background-color: #388e3c;
  border-color: #2e7d32;
  color: #fff;
}
body.dark .ramo.bloqueado {
  background-color: #444;
  border-color: #666;
  color: #999;
}
