:root {
  --general: #FFD6E0; /* Rosa pastel */
  --matematicas: #C1E7E3; /* Verde agua pastel */
  --programacion: #FFE5B4; /* Melocotón pastel */
  --sistemas: #E0BBE4; /* Lila pastel */
  --bases-datos: #B5EAD7; /* Menta pastel */
  --redes: #B5D8EB; /* Azul cielo pastel */
  --ingles: #F5E1FD; /* Lila claro */
  --optativas: #FFC8C8; /* Rosa claro */
  --proyectos: #C7CEEA; /* Azul lavanda */
  --requisito-cumplido: #E2F0CB; /* Verde claro para requisitos cumplidos */
  --requisito-pendiente: #FFDAC1; /* Naranja claro para requisitos pendientes */
  --texto: #333333;
  --borde: #e0e0e0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f9f9f9;
  color: var(--texto);
  margin: 0;
  padding: 20px;
}

h1, h2, h3 {
  color: #5a5a5a;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.ciclo {
  margin-bottom: 30px;
  background-color: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.ciclo-title {
  font-size: 1.5rem;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--borde);
  color: #4a6fa5;
}

.cursos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
}

.curso {
  border-radius: 8px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 3px 5px rgba(0,0,0,0.1);
}

.curso:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.curso.general { background-color: var(--general); }
.curso.matematicas { background-color: var(--matematicas); }
.curso.programacion { background-color: var(--programacion); }
.curso.sistemas { background-color: var(--sistemas); }
.curso.bases-datos { background-color: var(--bases-datos); }
.curso.redes { background-color: var(--redes); }
.curso.ingles { background-color: var(--ingles); }
.curso.optativas { background-color: var(--optativas); }
.curso.proyectos { background-color: var(--proyectos); }

.curso-codigo {
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 5px;
}

.curso-nombre {
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.curso-creditos {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(255,255,255,0.7);
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: bold;
}

.curso-requisitos {
  font-size: 0.8rem;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(0,0,0,0.1);
}

/* Estados del curso */
.curso.completado {
  opacity: 1;
  border-left: 5px solid #4CAF50;
}

.curso.disponible {
  opacity: 1;
  border-left: 5px solid #FFC107;
  animation: pulse 2s infinite;
}

.curso.bloqueado {
  opacity: 0.6;
  background-color: #f0f0f0;
  cursor: not-allowed;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(255, 193, 7, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0); }
}

/* Modal para detalles del curso */
.modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
}

.modal-content {
  background-color: white;
  margin: 10% auto;
  padding: 25px;
  border-radius: 10px;
  width: 60%;
  max-width: 600px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
  position: relative;
}

.close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  color: #aaa;
}

.close:hover {
  color: #333;
}

.modal-title {
  margin-top: 0;
  color: #4a6fa5;
}

.modal-info {
  margin-bottom: 15px;
}

.modal-info input[type="number"] {
  width: 60px;
  padding: 5px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.modal-requisitos {
  background-color: #f5f5f5;
  padding: 15px;
  border-radius: 5px;
  margin-top: 20px;
}

.requisito-cumplido {
  color: #4CAF50;
  font-weight: bold;
}

.requisito-pendiente {
  color: #f44336;
  font-weight: bold;
}

/* Barra de progreso */
.progress-container {
  margin-top: 30px;
  background-color: #f0f0f0;
  border-radius: 10px;
  padding: 20px;
}

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

.progress-fill {
  height: 100%;
  background-color: #4CAF50;
  border-radius: 10px;
  transition: width 0.5s ease;
}

.progress-text {
  text-align: center;
  font-weight: bold;
}

/* Botones */
.btn-completar, .btn-desmarcar {
  padding: 10px 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  margin-top: 15px;
  transition: all 0.3s ease;
}

.btn-completar {
  background-color: #4CAF50;
  color: white;
}

.btn-completar:hover {
  background-color: #3e8e41;
}

.btn-completar:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

.btn-desmarcar {
  background-color: #f44336;
  color: white;
  margin-left: 10px;
}

.btn-desmarcar:hover {
  background-color: #d32f2f;
}

.btn-desmarcar:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

/* Efecto de desbloqueo */
@keyframes unlock {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.unlock-animation {
  animation: unlock 0.5s ease;
}

/* Responsive */
@media (max-width: 768px) {
  .cursos-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-content {
    width: 90%;
    margin: 20% auto;
  }
  
  .btn-completar, .btn-desmarcar {
    width: 100%;
    margin-left: 0;
    margin-top: 10px;
  }
}

.curso.optativas {
    background-color: var(--optativas);
    border-left: 5px solid #9c27b0; /* Color morado para distinguir */
}