/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    background-color: #f8f9fa;
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: white;
    padding: 20px 0;
    height: 100vh;
    position: fixed;
    z-index: 1030;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 0 20px;
    margin-bottom: 30px;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.nav-links li a {
    display: block;
    padding: 15px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: background-color 0.3s;
}

.nav-links li a:hover,
.nav-links li a.active {
    background-color: #34495e;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e74c3c;
    text-decoration: none;
    padding: 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.logout-link:hover {
    background-color: #e74c3c;
    color: white;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-card h3 {
    color: #7f8c8d;
    margin-bottom: 10px;
}

.stat-card p {
    font-size: 24px;
    color: #2c3e50;
    margin: 0;
}

/* Tables */
table {
    width: 100%;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
}

/* Buttons */
.btn-edit, .btn-delete {
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    margin-right: 5px;
}

.btn-edit {
    background-color: #3498db;
    color: white;
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
}

.btn-logout {
    background-color: #e74c3c;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
}

/* Modal Styles */
.modal-backdrop {
    z-index: 1040;
}

.modal {
    z-index: 1050;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
}

.close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #2c3e50;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.role-specific-fields {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

/* Estado de los registros */
.badge {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-pending {
    background-color: #ffd700;
    color: #000;
}

.badge-processing {
    background-color: #3498db;
    color: white;
}

.badge-completed {
    background-color: #2ecc71;
    color: white;
}

.badge-error {
    background-color: #e74c3c;
    color: white;
}

/* Tabla de registros */
.records-container {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* Estilos para la grid de cursos */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.course-card {
    background-color: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.course-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.course-header h3 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 1.4em;
    overflow-wrap: break-word;
    word-wrap: break-word; /* Deprecated */
}

.course-code {
    display: inline-block;
    background-color: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    color: #6c757d;
    font-size: 0.85em;
}

.course-description {
    color: #34495e;
    margin-bottom: 20px;
    line-height: 1.5;
    overflow-wrap: break-word;
    word-wrap: break-word; /* Deprecated */
    flex-grow: 1; /* Allow description to take available space */
}

.course-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
}

.stat-item i {
    color: #3498db;
}

/* Estilos para la sección de estudiantes */
.student-list-container {
    margin-top: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.student-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding-bottom: 10px;
}

.student-list-header h4 {
    margin: 0;
    font-size: 1.1em;
    color: #2c3e50;
}

.toggle-list {
    color: #6c757d;
    transition: transform 0.3s ease;
}

.toggle-list.active i {
    transform: rotate(180deg);
}

.student-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.student-list.expanded {
    max-height: 500px;
    overflow-y: auto;
}

.student-list ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
}

.student-list li {
    padding: 8px 12px;
    border-bottom: 1px solid #dee2e6;
    color: #495057;
}

.student-list li:last-child {
    border-bottom: none;
}

.no-students {
    color: #6c757d;
    font-style: italic;
    text-align: center;
}

.course-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.course-actions button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
}

.no-courses {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    background-color: white;
    border-radius: 8px;
    color: #6c757d;
}

.quick-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.quick-actions .btn {
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* Estilos para el modal de estudiantes */
#studentsModal .modal-content {
    border-radius: 12px;
}

#studentsModal .modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    color: #2c3e50;
}

#studentSearchInput {
    border-radius: 8px;
    padding: 10px 15px;
}

#studentList {
    max-height: 400px;
    overflow-y: auto;
}

#studentList .list-group-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

#studentList .list-group-item:last-child {
    border-bottom: none;
}

#studentList .list-group-item:hover {
    background-color: #f8f9fa;
    cursor: default;
}

#studentList .list-group-item::before {
    content: '\f007'; /* Ícono de usuario de Font Awesome */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: #3498db;
    font-size: 1.1em;
}

/* Estilos para cursos completados */
.course-card-completed {
    background-color: #f8f9fa; /* Un fondo ligeramente gris */
    opacity: 0.7;
    border: 1px solid #e9ecef;
}

.course-card-completed .course-header h3 {
    text-decoration: line-through; /* Tachar el nombre del curso */
}