/* style.css */

/* General Body Styling */
body {
    font-family: 'Inter', sans-serif; /* Usando Inter para un look más moderno */
    margin: 0;
    padding: 24px; /* Aumentado el padding para más espacio */
    background-color: #e0e0e0; /* Gris claro suave */
    color: #333333; /* Texto más oscuro para contraste */
    line-height: 1.6;
}

/* App Sections (to be toggled by JS) */
.app-section {
    padding: 24px;
    background-color: #ffffff;
    border-radius: 12px; /* Esquinas más redondeadas */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Sombra más suave y extendida */
    margin-bottom: 24px;
    transition: box-shadow 0.3s ease; /* Transición para la sombra */
}

.app-section:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15); /* Sombra ligeramente más pronunciada al pasar el ratón */
}

/* Forms and Inputs */
form {
    display: flex;
    flex-direction: column;
    gap: 16px; /* Espacio entre elementos del formulario */
    margin-bottom: 24px;
}

input[type="text"],
input[type="email"],
select {
    padding: 12px 16px; /* Más padding para un look más limpio */
    border: 1px solid #cccccc; /* Borde gris más suave */
    border-radius: 8px; /* Esquinas redondeadas */
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus {
    border-color: #007bff; /* Borde azul al enfocar */
    outline: none; /* Eliminar el contorno por defecto */
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25); /* Sombra suave al enfocar */
}

button {
    padding: 12px 20px; /* Más padding para botones */
    border: none;
    border-radius: 8px; /* Esquinas redondeadas */
    background-color: #007bff; /* Azul primario */
    color: white;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600; /* Texto más audaz */
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15); /* Sombra sutil para los botones */
}

button:hover {
    background-color: #0056b3; /* Azul más oscuro al pasar el ratón */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Sombra ligeramente más profunda */
}

button.danger {
    background-color: #dc3545; /* Rojo para acciones peligrosas */
}

button.danger:hover {
    background-color: #c82333;
}

/* Dashboard Layout */
.main-layout {
    display: flex;
    gap: 24px; /* Más espacio entre columnas */
    align-items: flex-start;
    flex-wrap: wrap;
}

.column {
    background-color: #f5f5f5; /* Fondo más claro para las columnas */
    border-radius: 8px;
    padding: 16px;
    flex: 1;
    min-width: 300px;
    max-width: 49%;
    box-sizing: border-box;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08); /* Sombra más ligera para columnas */
    transition: all 0.3s ease;
}

/* Ajustes para el encabezado de columna */
.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0; /* Separador sutil */
}

.column-header h2 {
    font-size: 1.2em; /* Título un poco menos pesado */
    color: #555555; /* Color más suave */
    margin: 0;
    font-weight: 500; /* Menos negrita */
    flex-grow: 1; /* Permite que el título crezca */
    white-space: nowrap; /* Evita que el texto se rompa en varias líneas */
    overflow: hidden; /* Oculta el texto que se desborda */
    text-overflow: ellipsis; /* Añade puntos suspensivos si el texto se corta */
}

/* Botones de alternancia de columna */
.toggle-column-button {
    background: none;
    border: none;
    padding: 4px;
    color: #888888;
    cursor: pointer;
    border-radius: 50%; /* Botones redondos */
    transition: background-color 0.2s ease, color 0.2s ease;
    width: 32px; /* Tamaño fijo para el botón */
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0; /* Evita que se encoja */
}

/* Estilo para el icono de Material Symbols dentro del botón */
.toggle-column-button .material-symbols-outlined {
    font-size: 1.5em; /* Tamaño del icono de Material Symbols */
    line-height: 1; /* Asegura que el icono esté centrado verticalmente */
}


.toggle-column-button:hover {
    color: #333333;
    background-color: rgba(0, 0, 0, 0.05);
}

/* Estado colapsado de la columna */
.column.collapsed {
    flex-grow: 0;
    min-width: 60px; /* Un poco más grande cuando colapsado */
    max-width: 60px;
    overflow: hidden;
}

/* Oculta el título de la columna cuando está colapsada */
.column.collapsed .column-header h2 {
    display: none;
}

.column.collapsed .column-content {
    display: none;
}

.main-layout > .column:not(.collapsed) {
    flex-grow: 1;
    max-width: 100%;
    min-width: unset;
}

/* Card List Styling */
.card-list {
    display: flex;
    flex-direction: row; /* Cambiado a fila */
    gap: 20px; /* Espacio entre tarjetas */
    flex-wrap: wrap; /* Permite que las tarjetas se envuelvan a la siguiente línea */
    justify-content: flex-start; /* Alinea las tarjetas al inicio de la fila */
}

/* Student and Group Card Base */
.student-card, .group-card {
    background-color: white;
    border-radius: 8px; /* Esquinas redondeadas */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); /* Sombra más suave */
    padding: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    /* Ajuste para que las tarjetas ocupen un espacio más flexible en la fila */
    flex: 1 1 calc(50% - 10px); /* Dos columnas con un pequeño espacio */
    max-width: calc(50% - 10px); /* Asegura que no se desborden */
    min-width: 280px; /* Mínimo para evitar que sean demasiado pequeñas */
    box-sizing: border-box;
}

@media (max-width: 600px) {
    .student-card, .group-card {
        flex: 1 1 100%; /* Una columna en pantallas muy pequeñas */
        max-width: 100%;
    }
}


.student-card:hover, .group-card:hover {
    background-color: #f9f9f9;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Specific Card Styles */
.student-card h3, .group-card h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.2em;
    color: #333333;
}

.student-card p, .group-card p {
    margin-bottom: 8px;
    font-size: 0.95em;
    color: #666666;
}

.student-card .card-tags, .group-card .card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 12px;
}

.tag {
    background-color: #e0e0e0;
    color: #555555;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: 600;
}

.tag.in-group {
    background-color: #4CAF50; /* Verde más Material */
    color: white;
}

.tag.no-group {
    background-color: #FFC107; /* Amarillo/Naranja más Material */
    color: #333333;
}

.tag.valid {
    background-color: #4CAF50;
    color: white;
}

.tag.pending {
    background-color: #FFC107;
    color: #333333;
}

.in-group-card {
    border-left: 6px solid #4CAF50; /* Borde más pronunciado */
}

.group-card ul {
    list-style: none;
    padding: 0;
    margin: 8px 0;
    font-size: 0.95em;
}

.group-card ul li {
    margin-bottom: 4px;
    color: #444444;
}

/* Card Actions */
.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    justify-content: flex-end;
}

.card-actions button {
    padding: 8px 14px;
    font-size: 0.85em;
    background-color: #eeeeee;
    color: #555555;
    box-shadow: none; /* Sin sombra adicional aquí */
}

.card-actions button:hover {
    background-color: #dddddd;
    box-shadow: none;
}

/* Filters */
.filters {
    background-color: #f0f0f0;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05); /* Sombra interna sutil */
}

.filters h3 {
    margin-top: 0;
    font-size: 1.1em;
    margin-bottom: 12px;
    color: #444444;
}

/* Horizontal Filters */
.horizontal-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
}

.horizontal-filters label {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    color: #555555;
    cursor: pointer;
}

/* Checkboxes and Radios - More prominent styling */
input[type="checkbox"],
input[type="radio"] {
    -webkit-appearance: none; /* For Safari */
    -moz-appearance: none;    /* For Firefox */
    appearance: none;         /* Standard */
    width: 20px; /* Slightly larger */
    height: 20px;
    border: 2px solid #999999; /* Softer gray border */
    border-radius: 4px; /* Slightly rounded square */
    background-color: #ffffff; /* White background */
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease-in-out;
    flex-shrink: 0; /* Prevent shrinking in flex containers */
}

input[type="checkbox"]:checked {
    background-color: #007bff; /* Primary blue when checked */
    border-color: #007bff;
}

input[type="checkbox"]:checked::before {
    content: '✔️'; /* Checkmark emoji */
    font-size: 14px;
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1; /* Ensure it fits */
}

input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* Adjust for horizontal filters to ensure spacing */
.horizontal-filters input[type="checkbox"],
.filter-group-validation input[type="checkbox"],
#course-checkboxes input[type="checkbox"],
#edit-student-courses input[type="checkbox"],
.student-selection-list input[type="checkbox"] { /* Added for student selection in group modal */
    margin-right: 8px; /* Ensure consistent spacing */
}


/* Modals */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Fondo más oscuro para el modal */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background-color: white;
    padding: 30px; /* Más padding */
    border-radius: 12px; /* Esquinas más redondeadas */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); /* Sombra más pronunciada para el modal */
    width: 90%;
    max-width: 550px; /* Un poco más ancho */
    position: relative;
    animation: fadeIn 0.3s ease-out; /* Animación de entrada */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333333;
    font-size: 1.5em;
    text-align: center;
}

.modal button {
    margin-top: 20px;
    margin-right: 12px;
}

.modal .close-modal-button {
    background-color: #6c757d; /* Gris para cerrar */
}
.modal .close-modal-button:hover {
    background-color: #5a6268;
}

/* Student selection list for group modal */
.student-selection-list {
    max-height: 220px; /* Un poco más alto */
    overflow-y: auto;
    border: 1px solid #dddddd; /* Borde más claro */
    padding: 12px;
    border-radius: 8px;
    background-color: #fcfcfc; /* Fondo más claro */
}

.student-selection-list label {
    display: block;
    margin-bottom: 8px;
    color: #444444;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        padding: 16px;
    }
    .main-layout {
        flex-direction: column;
        gap: 16px;
    }
    .column {
        max-width: 100%;
        min-width: unset;
    }
    .horizontal-filters {
        flex-direction: column;
        gap: 8px;
    }
    .app-section {
        padding: 16px;
    }
    .modal {
        padding: 20px;
    }
}

/* Estilos para las etiquetas de validación */
.tag.condition-met {
    background-color: #4CAF50; /* Verde más Material */
    color: white;
}

.tag.condition-not-met {
    background-color: #FFC107; /* Amarillo/Naranja más Material */
    color: #333333;
}

/* Estilos para los nuevos filtros en el dashboard */
.filter-group-validation {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.filter-group-validation label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #555555;
}

.filter-group-validation input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #007bff;
}

/* Estilos específicos para la sección de Registro de Estudiantes */
#student-registration-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px; /* Más padding */
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    margin: 30px auto;
    max-width: 650px; /* Un poco más ancho */
    width: 90%;
}

#student-registration-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px; /* Más espacio */
}

#student-registration-form label {
    font-weight: 600; /* Más audaz */
    margin-bottom: 6px;
    color: #444444;
}

#student-registration-form input[type="text"],
#student-registration-form input[type="email"] {
    width: 100%;
    padding: 14px 18px; /* Más padding */
    border: 1px solid #cccccc;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1.05em;
}

#student-registration-form button[type="submit"] {
    width: 100%;
    padding: 14px 24px; /* Más padding */
    background-color: #28a745; /* Verde de éxito */
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 700;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

#student-registration-form button[type="submit"]:hover {
    background-color: #218838;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

/* Estilos para los Checkboxes de Asignaturas en el Registro */
#course-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 18px; /* Más espacio */
    justify-content: flex-start;
    width: 100%;
    padding: 12px 0;
    border-top: 1px solid #eeeeee; /* Separador */
    border-bottom: 1px solid #eeeeee;
}

#course-checkboxes div {
    display: flex;
    align-items: center;
    gap: 8px; /* Más espacio entre checkbox y label */
}

#course-checkboxes input[type="checkbox"] {
    width: 20px; /* Tamaño ligeramente más grande */
    height: 20px;
    margin: 0;
    flex-shrink: 0;
    accent-color: #007bff; /* Color de acento */
}

#course-checkboxes label {
    margin: 0;
    font-size: 1.05em;
    color: #444444;
}

/* Estilos para el nuevo modal de mensajes/confirmaciones */
.message-modal {
    text-align: center;
}

.message-modal .modal-buttons {
    display: flex;
    justify-content: center;
    gap: 12px; /* Más espacio */
    margin-top: 25px;
}

.message-modal .modal-button {
    padding: 12px 25px; /* Más padding */
    font-size: 1.05em;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

#message-modal-ok-button {
    background-color: #007bff;
    color: white;
}

#message-modal-ok-button:hover {
    background-color: #0056b3;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#message-modal-cancel-button {
    background-color: #6c757d;
    color: white;
}

#message-modal-cancel-button:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
