* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Clase para lectores de pantalla */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    padding: 30px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    flex-wrap: wrap;
    gap: 20px;
}

hgroup h1 {
    color: #333;
    font-size: 2em;
    display: flex;
    align-items: center;
    gap: 10px;
}

hgroup h1 i {
    color: #667eea;
}

hgroup p {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

/* Panel de administración */
.admin-panel {
    flex: 1;
    max-width: 400px;
}

.admin-panel form {
    display: flex;
    gap: 10px;
}

.admin-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
}

.admin-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.admin-btn {
    padding: 12px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s;
}

.admin-btn:hover {
    transform: translateY(-2px);
}

.admin-status {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    display: block;
}

.admin-status[value] {
    color: #28a745;
    font-weight: 500;
}

/* Navegación principal */
.main-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 10px;
}

.nav-link {
    padding: 12px 25px;
    text-decoration: none;
    color: #666;
    border-radius: 8px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.nav-link:hover {
    background: #e9ecef;
    color: #333;
}

.nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.nav-link i {
    font-size: 1.1em;
}

/* Navegación de fechas */
.date-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.nav-btn {
    padding: 12px 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    font-size: 14px;
}

.nav-btn:hover {
    background: #e9ecef;
}

.date-display {
    display: flex;
    gap: 10px;
    align-items: center;
}

.date-picker {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
}

.today-btn {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
}

.today-btn:hover {
    background: #218838;
}

/* Gestión de profesores */
.teacher-management {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
}

.management-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.management-header h2 {
    color: #333;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.management-header h2 i {
    color: #667eea;
}

.admin-badge {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.teacher-list-header {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr;
    padding: 10px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    font-weight: 500;
    margin-bottom: 10px;
}

.teacher-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
}

.teacher-item {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr;
    padding: 15px;
    background: white;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s;
}

.teacher-item:last-child {
    border-bottom: none;
}

.teacher-item:hover {
    background: #f8f9fa;
    transform: translateX(5px);
}

.teacher-item i {
    margin-right: 8px;
    color: #667eea;
}

.teacher-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.edit-teacher-btn {
    padding: 5px 10px;
    background: #ffc107;
    color: #333;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.edit-teacher-btn:hover:not(:disabled) {
    background: #e0a800;
    transform: translateY(-2px);
}

.delete-teacher-btn {
    padding: 5px 10px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.delete-teacher-btn:hover:not(:disabled) {
    background: #c82333;
    transform: translateY(-2px);
}

.edit-teacher-btn:disabled,
.delete-teacher-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Formulario de agregar */
.add-teacher-form {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.add-teacher-form h3 {
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
    font-size: 0.9em;
}

.teacher-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.teacher-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.add-teacher-btn {
    width: 100%;
    padding: 12px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.add-teacher-btn:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-2px);
}

.add-teacher-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Sección de información */
.info-section {
    background: #e8f4fd;
    padding: 20px;
    border-radius: 15px;
    border-left: 4px solid #17a2b8;
}

.info-section h3 {
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-section ul {
    list-style: none;
    margin-top: 15px;
}

.info-section li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #555;
}

/* Horario */
.schedule-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    overflow: hidden;
}

.schedule-header {
    display: grid;
    grid-template-columns: 120px 1fr 100px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    font-weight: 500;
}

.schedule-body {
    max-height: 500px;
    overflow-y: auto;
}

/* Slots de tiempo */
.time-slot {
    display: grid;
    grid-template-columns: 120px 1fr 100px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.3s;
}

.time-slot:hover {
    background: #f8f9fa;
}

.slot-time {
    padding: 15px;
    font-weight: 500;
    color: #333;
    border-right: 2px solid #f0f0f0;
    background: #fafafa;
    display: flex;
    align-items: center;
}

.slot-time-range {
    font-weight: 700;
}

.slot-subject {
    padding: 15px;
    color: #666;
}

.slot-teacher {
    font-size: 0.85em;
    color: #764ba2;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.slot-teacher i {
    font-size: 0.9em;
}

.slot-actions {
    padding: 15px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.slot-actions button {
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.reserve-btn {
    background: #28a745;
    color: white;
}

.reserve-btn:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-2px);
}

.edit-btn {
    background: #ffc107;
    color: #333;
}

.edit-btn:hover:not(:disabled) {
    background: #e0a800;
    transform: translateY(-2px);
}

.delete-btn {
    background: #dc3545;
    color: white;
}

.delete-btn:hover:not(:disabled) {
    background: #c82333;
    transform: translateY(-2px);
}

.slot-actions button:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.reserved-slot {
    background: #e8f5e9;
    border-left: 4px solid #28a745;
}

.receso-slot {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    opacity: 0.8;
}

.receso-slot .slot-subject {
    color: #856404;
    font-style: italic;
}

/* Resumen */
.summary-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
}

.summary-section h3 {
    margin-bottom: 15px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.summary-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.summary-item h4 {
    color: #667eea;
    margin-bottom: 5px;
}

.summary-item p {
    color: #666;
    font-size: 0.9em;
    margin: 5px 0;
}

.summary-item .teacher-name {
    color: #764ba2;
    font-weight: 500;
    font-size: 0.85em;
}

/* Modales */
dialog {
    padding: 0;
    border: none;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
}

dialog::backdrop {
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    padding: 30px;
}

.modal-content header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
}

.close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #aaa;
    transition: color 0.3s;
    padding: 0 10px;
}

.close:hover {
    color: #333;
}

/* Modal de edición de profesor */
.edit-teacher-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.save-btn {
    flex: 1;
    padding: 12px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.save-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

.cancel-btn {
    flex: 1;
    padding: 12px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.cancel-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Lista de materias en modal */
.subject-list {
    margin: 20px 0;
    max-height: 300px;
    overflow-y: auto;
}

.subject-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 5px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.subject-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.subject-item i {
    color: #667eea;
    margin-right: 10px;
}

.subject-info {
    display: flex;
    flex-direction: column;
}

.subject-name {
    font-weight: 500;
}

.teacher-name {
    font-size: 0.85em;
    color: #764ba2;
}

/* Notificaciones */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.3s;
    z-index: 1000;
}

.notification-success {
    border-left: 4px solid #28a745;
}

.notification-error {
    border-left: 4px solid #dc3545;
}

.notification-warning {
    border-left: 4px solid #ffc107;
}

.notification-info {
    border-left: 4px solid #17a2b8;
}

/* Loading spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header {
        flex-direction: column;
        text-align: center;
    }
    
    hgroup h1 {
        font-size: 1.5em;
        justify-content: center;
    }
    
    .admin-panel {
        max-width: 100%;
    }
    
    .admin-panel form {
        flex-direction: column;
    }
    
    .main-nav {
        flex-direction: column;
    }
    
    .nav-link {
        justify-content: center;
    }
    
    .schedule-header {
        grid-template-columns: 80px 1fr 80px;
        font-size: 12px;
    }
    
    .time-slot {
        grid-template-columns: 80px 1fr 80px;
        font-size: 12px;
    }
    
    .slot-time {
        padding: 10px;
    }
    
    .slot-subject {
        padding: 10px;
    }
    
    .slot-actions {
        padding: 10px;
        flex-direction: column;
    }
    
    .slot-actions button {
        width: 100%;
    }
    
    .date-navigation .nav-btn span {
        display: none;
    }
    
    .today-btn span {
        display: none;
    }
    
    .teacher-list-header {
        grid-template-columns: 1fr 1fr 80px;
        font-size: 12px;
    }
    
    .teacher-item {
        grid-template-columns: 1fr 1fr 80px;
        font-size: 12px;
    }
    
    .management-header {
        flex-direction: column;
        text-align: center;
    }
}


