
/* ===== VARIABLES Y RESET ===== */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --info-color: #0891b2;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== LAYOUT PRINCIPAL ===== */
.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: var(--surface);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ===== PANTALLA DE BIENVENIDA ===== */
.welcome-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
    color: white;
    min-height: calc(100vh - 120px);
}

.welcome-screen h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease;
}

.welcome-screen p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.powered {
    position: absolute;
    bottom: 2rem;
    font-size: 0.875rem;
    opacity: 0.7;
    animation: fadeInUp 0.8s ease 0.4s both;
}

/* ===== SECCIÓN DE ACCESO ===== */
.join-section {
    flex: 1;
    padding: 3rem 2rem;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

.join-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.join-form {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--surface);
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ===== BOTONES ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    margin: 0.25rem;
    min-height: 44px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #047857;
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #b45309;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-info:hover {
    background: #0e7490;
    transform: translateY(-1px);
}

.join-form .btn {
    width: 100%;
    margin: 0.5rem 0;
}

/* ===== PANELES Y ESTADOS ===== */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    margin-top: 1.5rem;
    box-shadow: var(--shadow);
}

.panel h3 {
    background: var(--background);
    padding: 1rem 1.5rem;
    margin: 0;
    border-bottom: 1px solid var(--border);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    font-size: 1rem;
    font-weight: 600;
}

.panel-content {
    padding: 1.5rem;
}

.status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius);
    font-weight: 500;
}

.status.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.status.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.status.warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.tips {
    margin-top: 1rem;
    padding: 1rem;
    background: #f1f5f9;
    border-radius: var(--border-radius);
}

.tips h4 {
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.tips ul {
    list-style: none;
    padding-left: 0;
}

.tips li {
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    position: relative;
}

.tips li::before {
    content: "💡";
    position: absolute;
    left: 0;
}

/* ===== SECCIÓN DE VIDEO ===== */
.video-container {
    flex: 1;
    display: grid;
    grid-template-columns: 320px 1fr;
    height: calc(100vh - 120px);
    background: var(--text-primary);
}

.meeting-side {
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.meeting-info {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.meeting-info h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.meeting-info div {
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.meeting-link {
    background: var(--background);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    word-break: break-all;
    font-size: 0.75rem;
}

.controls {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.controls .btn {
    width: 100%;
    font-size: 0.75rem;
    padding: 0.625rem;
}

.meeting-main {
    display: flex;
    flex-direction: column;
}

.video-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    padding: 1rem;
    overflow-y: auto;
}

.video-item {
    position: relative;
    background: #000;
    border-radius: var(--border-radius);
    overflow: hidden;
    aspect-ratio: 16/9;
    box-shadow: var(--shadow);
}

.video-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-label {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.meeting-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 300px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.participants {
    padding: 1.5rem;
    border-right: 1px solid var(--border);
    overflow-y: auto;
}

.participants h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.participant-list {
    list-style: none;
}

.participant-list li {
    padding: 0.75rem;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    background: var(--background);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.participant-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color);
}

.participant-status.muted {
    background: var(--danger-color);
}

/* ===== CHAT ===== */
#chatContainer {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

#chatBox {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 1rem;
    background: var(--background);
    border-radius: var(--border-radius);
    padding: 1rem;
}

.chat-message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-message .sender {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.chat-message .time {
    font-size: 0.625rem;
    color: var(--text-secondary);
    float: right;
}

.chat-input-row {
    display: flex;
    gap: 0.5rem;
}

#chatInput {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

#chatSendBtn {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

#chatSendBtn:hover {
    background: var(--primary-hover);
}

/* ===== INDICADORES Y TOAST ===== */
.sharing-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--danger-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--border-radius-lg);
    font-weight: 600;
    font-size: 1.25rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: pulse 2s infinite;
}

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--text-primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* ===== UTILIDADES ===== */
.hidden {
    display: none !important;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ===== ANIMACIONES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .video-container {
        grid-template-columns: 280px 1fr;
    }
    
    .meeting-bottom {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .participants {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}

@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .welcome-screen h1 {
        font-size: 2rem;
    }
    
    .welcome-screen p {
        font-size: 1rem;
    }
    
    .join-section {
        padding: 2rem 1rem;
    }
    
    .join-form {
        padding: 1.5rem;
    }
    
    .video-container {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .meeting-side {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .controls {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .controls .btn {
        flex: 1;
        min-width: calc(50% - 0.25rem);
    }
    
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .meeting-bottom {
        height: 400px;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.75rem;
    }
    
    .controls .btn {
        min-width: 100%;
    }
    
    .meeting-info {
        padding: 1rem;
    }
    
    .participants,
    #chatContainer {
        padding: 1rem;
    }
}

/* ===== ESTILOS ADICIONALES PARA FUNCIONALIDADES AVANZADAS ===== */

/* ===== RESULTADOS DE DIAGNÓSTICO ===== */
.diagnostic-results-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.test-result {
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: var(--transition);
}

.test-result.success {
    border-left: 4px solid var(--success-color);
    background: #f0fdf4;
}

.test-result.warning {
    border-left: 4px solid var(--warning-color);
    background: #fffbeb;
}

.test-result.error {
    border-left: 4px solid var(--danger-color);
    background: #fef2f2;
}

.test-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.test-icon {
    font-size: 1.25rem;
}

.test-status {
    margin-left: auto;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-success {
    background: #d1fae5;
    color: #065f46;
}

.status-warning {
    background: #fef3c7;
    color: #92400e;
}

.status-error {
    background: #fee2e2;
    color: #991b1b;
}

.test-details {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.diagnostic-summary {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--background);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border);
}

.summary-stats {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.stat {
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 600;
}

.stat.success {
    background: #d1fae5;
    color: #065f46;
}

.stat.warning {
    background: #fef3c7;
    color: #92400e;
}

.stat.error {
    background: #fee2e2;
    color: #991b1b;
}

/* ===== CONECTIVIDAD ===== */
.connectivity-results-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

/* ===== CHAT MEJORADO ===== */
.chat-message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(20px);
    animation: slideInMessage 0.3s ease forwards;
}

.chat-message.local {
    background: #eff6ff;
    border-left: 3px solid var(--primary-color);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.sender {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--primary-color);
}

.time {
    font-size: 0.625rem;
    color: var(--text-secondary);
}

.message-content {
    font-size: 0.875rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.typing-indicator {
    padding: 0.5rem;
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.75rem;
    opacity: 0.8;
    animation: pulse 1.5s infinite;
}

@keyframes slideInMessage {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== MODALES ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.modal-content p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* ===== TOOLTIPS ===== */
.tooltip {
    position: absolute;
    background: var(--text-primary);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    animation: fadeIn 0.2s ease forwards;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--text-primary);
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* ===== ESTADOS DE CARGA ===== */
.loading-spinner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.spinner-circle {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 0.5rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

/* ===== INDICADORES DE ESTADO ===== */
.participant-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color);
    display: inline-block;
    margin-right: 0.5rem;
}

.participant-status.local {
    background: var(--primary-color);
}

.participant-status.muted {
    background: var(--danger-color);
}

.participant-status.disconnected {
    background: var(--text-secondary);
}

/* ===== BREADCRUMBS ===== */
.breadcrumb-container {
    padding: 1rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 600;
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: var(--text-secondary);
}

/* ===== ERRORES DE FORMULARIO ===== */
.input-group input.error,
.input-group select.error {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.input-group input.error:focus,
.input-group select.error:focus {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* ===== TEMA OSCURO ===== */
[data-theme="dark"] {
    --background: #0f172a;
    --surface: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
}

[data-theme="dark"] .welcome-screen {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
}

[data-theme="dark"] .test-result.success {
    background: #0c1e1a;
    border-left-color: #10b981;
}

[data-theme="dark"] .test-result.warning {
    background: #1e1a0c;
    border-left-color: #f59e0b;
}

[data-theme="dark"] .test-result.error {
    background: #1e0c0c;
    border-left-color: #ef4444;
}

[data-theme="dark"] .chat-message {
    background: #334155;
    color: var(--text-primary);
}

[data-theme="dark"] .chat-message.local {
    background: #1e3a8a;
}

/* ===== ANIMACIONES AVANZADAS ===== */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.bounce-in {
    animation: bounceIn 0.6s ease;
}

.slide-in {
    animation: slideIn 0.5s ease;
}

/* ===== MEJORIAS RESPONSIVAS ===== */
@media (max-width: 640px) {
    .diagnostic-results-grid,
    .connectivity-results-grid {
        grid-template-columns: 1fr;
    }
    
    .test-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .test-status {
        margin-left: 0;
        align-self: flex-start;
    }
    
    .summary-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .modal-buttons {
        flex-direction: column-reverse;
    }
    
    .modal-buttons .btn {
        width: 100%;
    }
}

/* ===== ACCESIBILIDAD ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== FOCUS STATES MEJORADOS ===== */
.btn:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== HOVER EFFECTS AVANZADOS ===== */
.test-result:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.chat-message:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* ===== PRINT STYLES ===== */
@media print {
    .btn,
    .controls,
    .video-grid,
    .modal-overlay {
        display: none !important;
    }
    
    .diagnostic-results-grid,
    .connectivity-results-grid {
        break-inside: avoid;
    }
    
    .test-result {
        border: 1px solid #333;
        margin-bottom: 1rem;
    }
}

/* ===== PANTALLA COMPLETA ===== */
.fullscreen-mode {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: black;
}

.fullscreen-mode .video-grid {
    height: 100vh;
    padding: 0;
}

.fullscreen-mode .meeting-side {
    display: none;
}

/* ===== INDICADORES DE CONECTIVIDAD ===== */
.connection-indicator {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 1000;
}

.connection-indicator.excellent {
    background: #d1fae5;
    color: #065f46;
}

.connection-indicator.good {
    background: #dbeafe;
    color: #1e40af;
}

.connection-indicator.fair {
    background: #fef3c7;
    color: #92400e;
}

.connection-indicator.poor {
    background: #fee2e2;
    color: #991b1b;
}

/* ===== MEJORAS DE PERFORMANCE ===== */
.video-grid {
    will-change: auto;
}

.video-item video {
    will-change: transform;
}

.toast,
.modal-overlay {
    will-change: transform, opacity;
}

/* ===== UTILIDADES ADICIONALES ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.backdrop-blur {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}