/* Estilos para el widget flotante de clases en vivo */
.clases-vivo-widget {
    position: fixed;
    z-index: 1000; /* Reducido para estar debajo de modales (que suelen usar 1050+) */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    width: 200px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: white;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 11px;
}

/* Widget expandido */
.clases-vivo-widget.expanded {
    width: 280px;
    font-size: 12px;
}

/* Widget minimizado */
.clases-vivo-widget.minimized {
    width: auto;
    min-width: 80px;
}

/* Posiciones del widget */
.clases-vivo-widget.center-right {
    right: 15px;
    bottom: 90px; /* Arriba del chat "Hablar al docente" */
}

.clases-vivo-widget.center-left {
    left: 15px;
    bottom: 90px;
}

.clases-vivo-widget.top-right {
    right: 15px;
    top: 15px;
}

.clases-vivo-widget.top-left {
    left: 15px;
    top: 15px;
}

.clases-vivo-widget.bottom-right {
    right: 15px;
    bottom: 90px;
}

.clases-vivo-widget.bottom-left {
    left: 15px;
    bottom: 90px;
}

/* Header del widget */
.clases-vivo-widget .widget-header {
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.clases-vivo-widget .widget-header h4 {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    color: white;
}

.clases-vivo-widget .toggle-btn {
    background: none;
    border: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.clases-vivo-widget .toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Contenido del widget */
.clases-vivo-widget .widget-content {
    padding: 10px;
    max-height: 250px;
    overflow-y: auto;
}

/* Contenido expandido */
.clases-vivo-widget.expanded .widget-content {
    padding: 15px;
    max-height: 400px;
}

.clases-vivo-widget.minimized .widget-content {
    display: none;
}

/* Loading state */
.clases-vivo-widget .loading {
    text-align: center;
    padding: 10px;
    font-size: 10px;
    opacity: 0.8;
}

.clases-vivo-widget.expanded .loading {
    padding: 15px;
    font-size: 11px;
}

/* Información del curso */
.curso-info {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 6px;
    margin-bottom: 8px;
}

.curso-info h4 {
    background: rgba(255, 215, 0, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    font-size: 9px !important;
    text-align: center;
}

.clases-vivo-widget.expanded .curso-info {
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.clases-vivo-widget.expanded .curso-info h4 {
    font-size: 12px !important;
    padding: 6px 12px;
}

/* Clase individual */
.clase-item {
    margin-bottom: 8px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    border-left: 3px solid #ffd700;
}

.clases-vivo-widget.expanded .clase-item {
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 6px;
    border-left: 4px solid #ffd700;
}

.clase-item:last-child {
    margin-bottom: 0;
}

.clase-item.pasada {
    border-left-color: #ff6b6b;
    opacity: 0.7;
}

.clase-item.proxima {
    border-left-color: #4ecdc4;
}

.clase-item.hoy {
    border-left-color: #ffd700;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.01); }
    100% { transform: scale(1); }
}

/* Información de la clase */
.clase-nombre {
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 3px;
    color: white;
    line-height: 1.2;
}

.clases-vivo-widget.expanded .clase-nombre {
    font-size: 12px;
    margin-bottom: 5px;
}

.clase-fecha {
    font-size: 8px;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.2;
}

.clases-vivo-widget.expanded .clase-fecha {
    font-size: 10px;
    margin-bottom: 6px;
}

.clase-estado {
    font-size: 8px;
    font-weight: 500;
    margin-bottom: 4px;
    padding: 1px 4px;
    border-radius: 8px;
    display: inline-block;
    line-height: 1.2;
}

.clases-vivo-widget.expanded .clase-estado {
    font-size: 9px;
    margin-bottom: 6px;
    padding: 2px 6px;
    border-radius: 10px;
}

.clase-estado.pasada {
    background: #ff6b6b;
    color: white;
}

.clase-estado.proxima {
    background: #4ecdc4;
    color: white;
}

.clase-estado.hoy {
    background: #ffd700;
    color: #333;
}

/* Countdown */
.countdown {
    font-size: 8px;
    font-weight: 600;
    color: #ffd700;
    margin-bottom: 4px;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 4px;
    border-radius: 8px;
    line-height: 1.2;
}

.clases-vivo-widget.expanded .countdown {
    font-size: 10px;
    margin-bottom: 6px;
    padding: 4px 8px;
    border-radius: 12px;
}

/* Botón de acceso */
.btn-acceso {
    background: #ffd700;
    color: #333;
    border: none;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    width: 100%;
    text-align: center;
    transition: all 0.2s ease;
    line-height: 1.2;
}

.clases-vivo-widget.expanded .btn-acceso {
    padding: 6px 10px;
    font-size: 10px;
    border-radius: 5px;
}

.btn-acceso:hover {
    background: #ffed4e;
    transform: translateY(-1px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.btn-acceso:disabled {
    background: #999;
    color: #666;
    cursor: not-allowed;
    transform: none;
}

/* Mensaje cuando no hay clases */
.no-clases {
    text-align: center;
    padding: 10px;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.8);
}

.clases-vivo-widget.expanded .no-clases {
    padding: 15px;
    font-size: 11px;
}

/* Responsive */
@media (max-width: 768px) {
    .clases-vivo-widget {
        width: 100px;
        font-size: 9px;
        right: 10px !important;
        left: auto !important;
        bottom: 120px !important; /* Más arriba para no chocar con "Hablar al docente" */
    }
    
    .clases-vivo-widget.expanded {
        width: 250px;
        font-size: 11px;
        right: 10px !important;
        bottom: 120px !important;
    }
    
    .clases-vivo-widget .widget-header h4 {
        font-size: 9px;
    }
    
    .clases-vivo-widget .widget-content {
        padding: 6px;
        max-height: 200px;
    }
    
    .clases-vivo-widget.expanded .widget-content {
        padding: 12px;
        max-height: 350px;
    }
    
    .clase-item {
        padding: 4px;
        margin-bottom: 4px;
    }
    
    .clases-vivo-widget.expanded .clase-item {
        padding: 8px;
        margin-bottom: 8px;
    }
    
    .clase-nombre {
        font-size: 8px;
    }
    
    .clases-vivo-widget.expanded .clase-nombre {
        font-size: 11px;
    }
    
    .clase-fecha {
        font-size: 7px;
    }
    
    .clases-vivo-widget.expanded .clase-fecha {
        font-size: 9px;
    }
    
    .clase-estado {
        font-size: 7px;
    }
    
    .clases-vivo-widget.expanded .clase-estado {
        font-size: 8px;
    }
    
    .countdown {
        font-size: 7px;
    }
    
    .clases-vivo-widget.expanded .countdown {
        font-size: 9px;
    }
    
    .btn-acceso {
        padding: 3px 4px;
        font-size: 7px;
    }
    
    .clases-vivo-widget.expanded .btn-acceso {
        padding: 5px 8px;
        font-size: 9px;
    }
    
    .curso-info h4 {
        font-size: 8px !important;
        padding: 3px 6px;
    }
    
    .clases-vivo-widget.expanded .curso-info h4 {
        font-size: 10px !important;
        padding: 5px 10px;
    }
}

/* Mobile muy pequeño */
@media (max-width: 480px) {
    .clases-vivo-widget {
        width: 80px;
        font-size: 8px;
        bottom: 110px !important;
    }
    
    .clases-vivo-widget.expanded {
        width: 220px;
        font-size: 10px;
        bottom: 110px !important;
    }
    
    .clases-vivo-widget .widget-header h4 {
        font-size: 8px;
    }
    
    .clases-vivo-widget.minimized {
        min-width: 60px;
    }
}

/* Animación de entrada */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.clases-vivo-widget {
    animation: slideIn 0.5s ease-out;
}

/* Scrollbar personalizada */
.clases-vivo-widget .widget-content::-webkit-scrollbar {
    width: 4px;
}

.clases-vivo-widget .widget-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.clases-vivo-widget .widget-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.clases-vivo-widget .widget-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}