   /* Estilos simples para horario estudiante */

/* Contenedor principal */
.schedule-grid-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: 1rem;
    /* Scroll horizontal suave en móviles */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #4361ee #f1f3f4;
    /* Mejorar el scroll en touch devices */
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
}

/* Scroll suave para celdas en móviles */
.schedule-cell {
    scroll-snap-align: start;
}

/* Estilos del scrollbar para webkit */
.schedule-grid-container::-webkit-scrollbar {
    height: 6px;
}

.schedule-grid-container::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 3px;
}

.schedule-grid-container::-webkit-scrollbar-thumb {
    background: #4361ee;
    border-radius: 3px;
}

.schedule-grid-container::-webkit-scrollbar-thumb:hover {
    background: #3651d4;
}

/* Indicador visual de scroll en móviles */
@media (hover: none) and (pointer: coarse) {
    .schedule-grid-container {
        position: relative;
    }
    
}

/* Header info */
.schedule-header {
    padding: clamp(0.75rem, 2vw, 1rem);
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    font-weight: 500;
}

/* Grid principal - Responsive con mínimo ancho para móviles */
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(130px, 1fr));
    gap: 0;
    min-width: 910px; /* 130px * 7 columnas */
    width: 100%;
}

/* Headers de días */
.schedule-header-row {
    display: contents;
}

.schedule-header-cell {
    background: #343a40;
    color: white;
    padding: clamp(0.5rem, 1.5vw, 0.75rem) clamp(0.25rem, 1vw, 0.5rem);
    text-align: center;
    font-weight: 600;
    font-size: clamp(0.7rem, 2vw, 0.85rem);
    border: 1px solid #495057;
    min-width: 130px;
}

/* Filas de turnos */
.schedule-turn-row {
    display: contents;
}

/* DESHABILITADO - Ya no se usa columna de turnos en vista de estudiante
.schedule-turn-header {
    background: #f1f3f4;
    border: 1px solid #e0e0e0;
    padding: 0.5rem 0.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 0.75rem;
    color: #333;
    min-height: 60px;
}
*/

/* DESHABILITADO - Estilos de turnos ya no se usan en vista de estudiante
.turn-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.1;
}

.turn-hours {
    font-size: 0.7rem;
    color: #666;
    line-height: 1;
}
*/

/* Filas de horarios */
.schedule-row {
    display: contents;
}

/* Celdas */
.schedule-cell {
    border: 1px solid #e0e0e0;
    min-height: clamp(45px, 8vw, 60px);
    padding: clamp(2px, 0.5vw, 4px);
    background: white;
    position: relative;
    min-width: 130px;
}

/* Celdas de solo lectura - estilos específicos para estudiantes */
.readonly-cell {
    background: #fafbfc !important;
    cursor: default;
}

.readonly-cell:hover {
    background-color: #f1f3f4 !important;
}

.schedule-cell:hover {
    background-color: #f8f9fa;
}

/* Sesiones - Estilo igual al admin pero optimizado para solo lectura */
.session-card {
    width: 100%;
    height: 100%;
    min-height: clamp(55px, 10vw, 70px);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.session-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Sesiones de solo lectura */
.readonly-session {
    cursor: pointer;
    border: 2px solid transparent;
}

.readonly-session:hover {
    border-color: #4361ee;
    transform: translateY(-1px);
}

.readonly-session .session-header {
    position: relative;
}

.readonly-session .session-header::after {
    content: "👁";
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    opacity: 0.7;
}

.session-header {
    background: #4361ee;
    color: white;
    padding: clamp(0.25rem, 1vw, 0.5rem);
    font-weight: 600;
    font-size: clamp(0.7rem, 2vw, 0.85rem);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: clamp(28px, 6vw, 36px);
}

.session-title {
    font-weight: 500;
    font-size: clamp(0.7rem, 2vw, 0.85rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-body {
    padding: clamp(0.25rem, 1vw, 0.5rem);
    background: white;
}

.session-time {
    font-size: clamp(0.75rem, 4vw, 1rem);
    color: #4361ee;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.session-time i {
    margin-right: 0.25rem;
}

.session-teachers {
    font-size: clamp(0.6rem, 1.5vw, 0.7rem);
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.15rem;
}

.session-teachers i {
    margin-right: clamp(0.15rem, 0.5vw, 0.25rem);
}

.session-classroom {
    font-size: clamp(0.55rem, 1.3vw, 0.65rem);
    color: #28a745;
    font-weight: 600;
    text-align: center;
    background: rgba(40, 167, 69, 0.1);
    padding: clamp(0.15rem, 0.4vw, 0.2rem);
    border-radius: 3px;
}

.session-classroom i {
    margin-right: clamp(0.15rem, 0.5vw, 0.25rem);
}

.sesion-item .especialidad {
    font-weight: 600;
    margin-bottom: 2px;
    font-size: clamp(0.7rem, 2vw, 0.85rem);
}

.sesion-item .horario {
    font-size: clamp(0.55rem, 1.5vw, 0.65rem);
    opacity: 0.9;
    margin-bottom: 2px;
}

.sesion-item .profesor {
    font-size: clamp(0.5rem, 1.3vw, 0.6rem);
    opacity: 0.8;
}

/* Colores por especialidad */
.sesion-item.esp-1 { background: #dc3545; }
.sesion-item.esp-2 { background: #28a745; }
.sesion-item.esp-3 { background: #ffc107; color: #000; }
.sesion-item.esp-4 { background: #17a2b8; }
.sesion-item.esp-5 { background: #6f42c1; }
.sesion-item.esp-6 { background: #fd7e14; }

/* Estados */
#loadingMessage {
    padding: 2rem;
    text-align: center;
    color: #6c757d;
}

#noScheduleMessage {
    margin: 1rem 0;
    padding: 1.5rem;
    text-align: center;
}

/* Header del horario */
.schedule-info-header {
    background: white;
    border-radius: 8px 8px 0 0;
    padding: 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

/* Banner de solo lectura para estudiantes */
.readonly-banner {
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    border: 1px solid #b39ddb;
    border-radius: 8px;
    padding: clamp(0.5rem, 1.5vw, 0.75rem) clamp(0.75rem, 2vw, 1rem);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: clamp(0.25rem, 1vw, 0.5rem);
}

.readonly-banner i {
    color: #673ab7;
    font-size: clamp(1rem, 2.5vw, 1.1rem);
}

.readonly-banner span {
    color: #4a148c;
    font-weight: 500;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
}

.schedule-info-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    font-weight: 600;
}

.schedule-info-header h4 i {
    color: #4361ee;
    margin-right: clamp(0.25rem, 1vw, 0.5rem);
}

.schedule-details {
    margin-top: 0.5rem;
    font-size: clamp(0.8rem, 2.5vw, 0.95rem);
}

.schedule-details i {
    color: #6c757d;
    margin-right: clamp(0.15rem, 0.5vw, 0.25rem);
}

/* Estadísticas del horario */
.schedule-stats {
    padding: clamp(0.9rem, 3vw, 1.2rem);
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: clamp(1rem, 2.5vw, 1.25rem);
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 2vw, 1rem);
    transition: all 0.2s;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-icon {
    width: clamp(40px, 8vw, 48px);
    height: clamp(40px, 8vw, 48px);
    border-radius: 50%;
    background: linear-gradient(135deg, #4361ee, #7209b7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: clamp(1.2rem, 3.5vw, 1.5rem);
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
}

.stat-label {
    font-size: clamp(0.7rem, 2vw, 0.85rem);
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Leyenda */
.legend-container {
    background: white;
    border-radius: 8px;
    padding: clamp(0.75rem, 2vw, 1rem);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.legend-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: clamp(0.75rem, 2vw, 1rem);
    margin-top: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: clamp(0.25rem, 1vw, 0.5rem);
    font-size: clamp(0.7rem, 2vw, 0.85rem);
}

.legend-color {
    width: clamp(14px, 3vw, 16px);
    height: clamp(14px, 3vw, 16px);
    border-radius: 3px;
    border: 1px solid #ccc;
    flex-shrink: 0;
}

/* Dashboard compacto */
.dashboard-schedule-compact {
    min-height: 200px;
}

.dashboard-schedule-loading {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.dashboard-schedule-loading i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.dashboard-schedule-error {
    text-align: center;
    padding: 2rem;
    color: #dc3545;
}
.schedule-title{
   font-size: clamp(1.2rem, 4vw, 1.5rem);
}
.dashboard-schedule-error i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.day-column {
    margin-bottom: 1rem;
}

.day-header {
    background: #f8f9fa;
    padding: 0.5rem;
    font-weight: 600;
    text-align: center;
    border-radius: 4px 4px 0 0;
    border-bottom: 2px solid #dee2e6;
}

.schedule-session {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.5rem;
    margin: 0.25rem 0;
    cursor: pointer;
    transition: all 0.2s;
}

.schedule-session:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.session-subject {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.session-time {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.session-teacher {
    font-size: 0.75rem;
    color: #6c757d;
}

/* WhatsApp button */
.btn-whatsapp {
    background-color: #25d366;
    border-color: #25d366;
}

.btn-whatsapp:hover {
    background-color: #128c7e;
    border-color: #128c7e;
}

/* Responsive */
@media (max-width: 768px) {
    .schedule-grid {
        grid-template-columns: repeat(7, minmax(120px, 1fr));
        min-width: 840px; /* 120px * 7 columnas */
    }
    
    .schedule-header-cell {
        min-width: 120px;
    }
    
    .schedule-cell {
        min-width: 120px;
    }
    
    .legend-items {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
}

@media (max-width: 576px) {
    .schedule-grid {
        grid-template-columns: repeat(7, minmax(110px, 1fr));
        min-width: 770px; /* 110px * 7 columnas */
    }
    
    .schedule-header-cell {
        min-width: 110px;
    }
    
    .schedule-cell {
        min-width: 110px;
    }
    
    .legend-items {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }
    
    .stat-card {
        padding: clamp(0.75rem, 2vw, 1rem);
    }
}

@media (max-width: 480px) {
    .schedule-grid {
        grid-template-columns: repeat(7, minmax(105px, 1fr));
        min-width: 735px; /* 105px * 7 columnas */
    }
    
    .schedule-header-cell {
        min-width: 105px;
    }
    
    .schedule-cell {
        min-width: 105px;
    }
    
    .readonly-banner {
        flex-direction: column;
        text-align: center;
    }
}

/* Mejoras adicionales para pantallas muy pequeñas */
@media (max-width: 360px) {
    .schedule-grid {
        grid-template-columns: repeat(7, minmax(95px, 1fr));
        min-width: 665px; /* 95px * 7 columnas */
    }
    
    .schedule-header-cell {
        min-width: 95px;
        padding: clamp(0.3rem, 1vw, 0.5rem) clamp(0.1rem, 0.5vw, 0.25rem);
    }
    
    .schedule-cell {
        min-width: 95px;
        min-height: clamp(40px, 6vw, 50px);
    }
    
    .session-card {
        min-height: clamp(45px, 8vw, 55px);
    }
    
    .session-header {
        min-height: clamp(24px, 5vw, 32px);
    }
}

/* Estilos específicos para orientación landscape en móviles */
@media (max-height: 500px) and (orientation: landscape) {
    .schedule-header {
        padding: clamp(0.5rem, 1vw, 0.75rem);
    }
    
    .schedule-stats {
        padding: clamp(0.75rem, 2vw, 1rem);
    }
    
    .stat-card {
        padding: clamp(0.75rem, 1.5vw, 1rem);
        flex-direction: row;
        gap: clamp(0.5rem, 1.5vw, 0.75rem);
    }
}

/* Optimización para touch targets */
@media (hover: none) and (pointer: coarse) {
    .session-card {
        min-height: clamp(60px, 12vw, 80px);
    }
    
    .session-header {
        min-height: clamp(32px, 8vw, 44px);
        padding: clamp(0.5rem, 1.5vw, 0.75rem);
    }
    
    .readonly-session:hover {
        transform: none;
        border-color: transparent;
    }
    
    .readonly-session:active {
        transform: scale(0.98);
        border-color: #4361ee;
    }
}