/* Reset y estilos básicos */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Contenedor principal */
.container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 40px;
    max-width: 500px;
    width: 100%;
}

.container.full-width {
    max-width: 95vw;
    width: 95vw;
}

/* Tipografía */
h1 { color: #333; margin-bottom: 10px; font-size: 28px; text-align: center; }
h2 { color: #333; margin-bottom: 20px; font-size: 22px; }
.subtitle { color: #666; margin-bottom: 30px; font-size: 14px; text-align: center; }

/* Login view - centrado */
#login-view {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Formularios */
.form-group { margin-bottom: 20px; width: 100%; }

label { 
    display: block; 
    margin-bottom: 8px; 
    color: #555; 
    font-weight: 500; 
    font-size: 14px; 
}

input, select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
}

input:focus, select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Botones */
button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

button:hover { transform: translateY(-2px); }
button:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Botón de conexión móvil */
.mobile-connect-btn {
    width: 100%;
    max-width: 300px;
    padding: 20px 30px;
    font-size: 24px;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 20px;
}

.mobile-connect-btn:active {
    transform: scale(0.95);
}

.mobile-room-info {
    margin-top: 15px;
    color: #666;
    font-size: 14px;
    text-align: center;
}

/* Ocultar formulario en vista móvil */
#join-form.hidden {
    display: none;
}

/* Estados y mensajes */
.status { 
    margin-top: 20px; 
    padding: 12px; 
    border-radius: 8px; 
    font-size: 14px; 
    display: none; 
}

.status.success { 
    background: #d4edda; 
    color: #155724; 
    border: 1px solid #c3e6cb; 
}

.status.error { 
    background: #f8d7da; 
    color: #721c24; 
    border: 1px solid #f5c6cb; 
}

.status.warning { 
    background: #fff3cd; 
    color: #856404; 
    border: 1px solid #ffeeba; 
}

.status.info { 
    background: #d1ecf1; 
    color: #0c5460; 
    border: 1px solid #bee5eb; 
}

.status.show { display: block; }

#room-view { display: none; }

/* NUEVA ESTRUCTURA PARA AGRUPACIÓN */
.students-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(500px, 100%), 1fr));
    gap: 20px;
    margin-top: 20px;
}

.student-card {
    max-width: 700px;
}

.student-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
    cursor: pointer;
}

.student-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.student-card.has-alert {
    border-color: #ff6b6b;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3); }
    50% { box-shadow: 0 4px 20px rgba(255, 107, 107, 0.6); }
}

.student-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #dee2e6;
}

.student-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.connection-status {
    display: flex;
    gap: 8px;
    font-size: 12px;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    background: #e9ecef;
    color: #495057;
}

.status-badge.online {
    background: #d4edda;
    color: #155724;
}

.status-badge.offline {
    background: #f8d7da;
    color: #721c24;
}

/* Videos de estudiantes */
.student-videos {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 10px;
}

.video-main-wrapper {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.student-cameras {
    grid-column: 1;
    grid-row: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.camera-wrapper {
    display: flex;
    flex-direction: column;
}

.video-container {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio (Safari compatible) */
    transition: transform 0.2s;
}

/* Hover interactivo solo para vista del profesor */
@media (hover: hover) and (pointer: fine) {
    .students-grid .video-container:hover {
        transform: scale(1.02);
        cursor: pointer;
    }
}

.video-container.empty {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 14px;
    /* Mantener aspect ratio incluso cuando está vacío */
    padding-bottom: 56.25%;
}

.video-container.empty::before {
    content: attr(data-label);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: block;
    will-change: transform; /* Aísla el video en su propia capa de composición */
    transform: translateZ(0); /* Fuerza aceleración de hardware */
}

/* 📱 Ocultar controles nativos del navegador en todos los elementos video */
video {
    /* Forzar que no se muestren controles bajo ninguna circunstancia */
    -webkit-user-select: none;
    user-select: none;
}

video::-webkit-media-controls {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

video::-webkit-media-controls-enclosure {
    display: none !important;
    opacity: 0 !important;
}

video::-webkit-media-controls-panel {
    display: none !important;
    opacity: 0 !important;
}

video::-webkit-media-controls-play-button {
    display: none !important;
    opacity: 0 !important;
}

video::-webkit-media-controls-start-playback-button {
    display: none !important;
    opacity: 0 !important;
}

video::-webkit-media-controls-overlay-play-button {
    display: none !important;
    opacity: 0 !important;
}

/* Ocultar el overlay oscuro que Safari pone sobre el video */
video::-webkit-media-controls-overlay-enclosure {
    display: none !important;
    opacity: 0 !important;
}

/* Cámaras: cover para llenar el espacio */
/* Cámaras (webcam + móvil): contain para respetar aspect ratio completo con letterboxing */
.student-cameras .video-container video {
    object-fit: contain;
}

/* Pantalla compartida: contain para ver todo el contenido */
.video-main .video-container video {
    object-fit: contain;
}

.video-label {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* Vista móvil y estudiante */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.video-grid .video-container {
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.participant-name {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
}

#qr-container {
    display: none;
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
}

/* VISTA AMPLIADA / FOCUS MODE */
.focus-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 15px;
    backdrop-filter: blur(10px);
}

.focus-overlay.active {
    display: flex;
}

.focus-container {
    width: 100%;
    max-width: 2400px;
    height: 95vh;
    background: #1a1a1a;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.focus-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #333;
}

.focus-student-name {
    color: white;
    font-size: 24px;
    font-weight: 600;
}

.focus-control-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: auto;
}

.focus-control-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    transform: scale(1.05);
}

.focus-close-btn {
    background: #ff4757;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: auto;
}

.focus-close-btn:hover {
    background: #ff3838;
    transform: scale(1.05);
}

.focus-content {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 15px;
    flex: 1;
    min-height: 0;
}

.focus-main-screen {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

.focus-main-screen.empty {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #95a5a6;
    font-size: 18px;
}

.focus-main-screen video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.focus-cameras {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.focus-camera-item {
    flex: 1;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.focus-camera-item:hover {
    border-color: #667eea;
    transform: scale(1.03);
}

.focus-camera-item.empty {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #95a5a6;
    font-size: 12px;
    cursor: not-allowed;
}

.focus-camera-item.empty:hover {
    border-color: transparent;
    transform: none;
}

.focus-camera-item video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.focus-video-label {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    pointer-events: none;
}

.focus-hint {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.focus-camera-item:hover .focus-hint {
    opacity: 1;
}

/* Ajustes para pantallas muy grandes (4K y superiores) */
@media (min-width: 2560px) {
    .focus-content {
        grid-template-columns: 1fr 280px;
    }
    
    .focus-camera-item {
        min-height: 220px;
    }
    
    .focus-video-label {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .focus-student-name {
        font-size: 28px;
    }
}

/* Ajustes para pantallas ultra-wide */
@media (min-width: 3440px) {
    .focus-container {
        max-width: 3200px;
    }
    
    .focus-content {
        grid-template-columns: 1fr 320px;
    }
    
    .focus-camera-item {
        min-height: 250px;
    }
}

/* BOTÓN DE MICRÓFONO DEL PROFESOR */
#mic-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    font-size: 28px;
    cursor: pointer;
    z-index: 10001;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
    display: none;
}

#mic-toggle-btn.muted {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

#mic-toggle-btn.unmuted {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
}

#mic-toggle-btn:hover {
    transform: scale(1.1);
}

#mic-toggle-btn.show {
    display: block;
}

/* Botón flotante de activación de audio (Safari iOS autoplay policy) */
.audio-playback-btn {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 25px;
    font-size: 18px;
    font-weight: bold;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
    z-index: 9998;
    animation: pulse-audio 2s ease-in-out infinite;
    transition: transform 0.2s;
}

.audio-playback-btn:hover {
    transform: translateX(-50%) scale(1.05);
}

.audio-playback-btn:active {
    transform: translateX(-50%) scale(0.95);
}

@keyframes pulse-audio {
    0%, 100% { box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4); }
    50% { box-shadow: 0 4px 25px rgba(245, 87, 108, 0.7); }
}

/* VISTA OPTIMIZADA PARA MÓVIL */
@media (max-width: 768px) {
    body {
        padding: 0;
        background: #000;
        overflow: hidden;
    }
    
    .container {
        padding: 0;
        border-radius: 0;
        box-shadow: none;
        max-width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
    }
    
    #room-view {
        position: relative;
        min-height: 100vh;
        min-height: 100dvh;
        background: #000;
    }
    
    #room-view h2 {
        display: none;
    }
    
    /* Badge de calidad flotante para móviles (visible aunque h2 esté oculto) */
    #own-quality-badge {
        display: inline-block !important;
        position: fixed;
        top: 15px;
        left: 15px;
        font-size: 24px;
        z-index: 1001;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(10px);
        padding: 8px 12px;
        border-radius: 12px;
        border: 2px solid rgba(255, 255, 255, 0.3);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    }
    
    #qr-container {
        display: none !important;
    }
    
    #disconnect-btn {
        position: fixed;
        top: 15px;
        right: 15px;
        width: auto;
        padding: 12px 24px;
        background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
        backdrop-filter: blur(10px);
        z-index: 1000;
        border-radius: 12px;
        font-size: 14px;
        box-shadow: 0 4px 16px rgba(251, 191, 36, 0.6),
                    0 2px 4px rgba(0, 0, 0, 0.5);
        border: 2px solid rgba(255, 255, 255, 0.4);
        color: #1f2937;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.3s;
    }
    
    #disconnect-btn:hover {
        background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%);
        box-shadow: 0 6px 24px rgba(251, 191, 36, 0.8),
                    0 3px 8px rgba(0, 0, 0, 0.6);
    }
    
    .video-grid {
        margin: 0;
        padding: 0;
        gap: 0;
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        min-height: 100dvh;
    }
    
    .video-grid .video-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        aspect-ratio: auto;
        min-height: unset;
        max-width: unset;
        background: #000;
    }
    
    .video-grid .video-container video {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    
    .participant-name {
        bottom: 20px;
        left: 20px;
        font-size: 14px;
        padding: 8px 16px;
        border-radius: 25px;
        backdrop-filter: blur(10px);
    }
}

/* MÓVIL EN HORIZONTAL (LANDSCAPE) */
@media (max-height: 768px) and (orientation: landscape) {
    body {
        padding: 0;
        background: #000;
        overflow: hidden;
    }
    
    .container {
        padding: 0;
        border-radius: 0;
        box-shadow: none;
        max-width: 100%;
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
    }
    
    #room-view {
        position: relative;
        min-height: 100vh;
        min-height: 100dvh;
        background: #000;
    }
    
    #room-view h2 {
        display: none;
    }
    
    #qr-container {
        display: none !important;
    }
    
    #disconnect-btn {
        position: fixed;
        top: 15px;
        right: 15px;
        width: auto;
        padding: 10px 18px;
        background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
        backdrop-filter: blur(10px);
        z-index: 1000;
        border-radius: 12px;
        font-size: 13px;
        box-shadow: 0 4px 16px rgba(251, 191, 36, 0.6),
                    0 2px 4px rgba(0, 0, 0, 0.5);
        border: 2px solid rgba(255, 255, 255, 0.4);
        color: #1f2937;
        font-weight: 700;
    }
    
    #disconnect-btn:hover {
        background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%);
        box-shadow: 0 6px 24px rgba(251, 191, 36, 0.8),
                    0 3px 8px rgba(0, 0, 0, 0.6);
    }
    
    .video-grid {
        margin: 0;
        padding: 0;
        gap: 0;
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        min-height: 100dvh;
    }
    
    .video-grid .video-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        aspect-ratio: auto;
        min-height: unset;
        max-width: unset;
        background: #000;
    }
    
    .video-grid .video-container video {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    
    .participant-name {
        bottom: 15px;
        left: 15px;
        font-size: 13px;
        padding: 6px 14px;
        border-radius: 25px;
        backdrop-filter: blur(10px);
    }
}

/* Para dispositivos muy pequeños */
@media (max-width: 480px) {
    #disconnect-btn {
        padding: 10px 16px;
        font-size: 13px;
        top: 15px;
        right: 15px;
    }
    
    .participant-name {
        font-size: 12px;
        padding: 6px 12px;
        bottom: 15px;
        left: 15px;
    }
}

/* === QR Code Styles === */
.qr-url-display {
    margin: 10px auto 0 auto;
    padding: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    word-break: break-all;
    font-size: 12px;
    color: #333;
    max-width: 400px;
    text-align: left;
}

/* === Top Buttons Container === */
.top-buttons-container {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 20px;
    justify-content: flex-end;
}

/* Top buttons flotantes en galería del profesor (alineados con stats) */
.top-buttons-container.floating {
    position: fixed;
    top: 10px;
    right: 20px;
    margin: 0;
    z-index: 1001;
    flex-direction: row-reverse; /* Stats a la izquierda, Desconectar a la derecha */
}

.top-buttons-container button {
    width: auto;
    padding: 12px 16px; /* Mismo padding que stats para alineación vertical */
    height: auto;
}

/* Botón Desconectar cuando está flotante (en galería del profesor) */
.top-buttons-container.floating #disconnect-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(238, 90, 36, 0.4);
}

.top-buttons-container.floating #disconnect-btn:hover {
    background: linear-gradient(135deg, #ee5a24 0%, #ff6b6b 100%);
    box-shadow: 0 4px 12px rgba(238, 90, 36, 0.5);
}

/* === Overlays de Reconexión y Errores === */

/* Overlay de reconexión */
#reconnecting-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

/* Contenido del overlay de reconexión */
.reconnecting-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.reconnecting-content .icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.reconnecting-content h2 {
    margin: 0 0 10px 0;
    color: #333;
}

.reconnecting-content h2.error {
    color: #e74c3c;
}

.reconnecting-content p {
    color: #666;
    margin: 0 0 20px 0;
    line-height: 1.6;
}

/* Spinner de carga */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Bloque de instrucciones */
.instructions-block {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: left;
}

.instructions-block strong {
    color: #333;
    display: block;
    margin-bottom: 10px;
}

.instructions-block li strong {
    display: inline;
    margin: 0;
}

.instructions-block ol {
    margin: 0;
    padding-left: 20px;
    color: #555;
}

.instructions-block li {
    margin: 8px 0;
    text-align: left;
    line-height: 1.6;
}

/* Botones de overlay */
.overlay-button {
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    flex: 1;
    min-width: 150px;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.overlay-button:hover {
    opacity: 0.9;
}

.overlay-button.primary {
    background: #3498db;
    color: white;
}

.overlay-button.secondary {
    background: #95a5a6;
    color: white;
}

/* Modal de error de dispositivos multimedia */
#media-error-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.media-error-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.media-error-content h2 {
    margin: 0 0 15px 0;
    color: #e74c3c;
}

.media-error-content p {
    color: #555;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

/* Badge de calidad de conexión */
.connection-quality-badge {
    font-size: 20px;
    margin-right: 10px; /* Espacio después del badge (antes del texto) */
}
