/* Estilos generales */
:root {
    --primary-color: #1DA1F2;
    --secondary-color: #14171A;
    --text-color: #14171A;
    --light-gray: #E1E8ED;
    --border-color: #E1E8ED;
    --success-color: #17BF63;
    --danger-color: #E0245E;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background-color: #f8f9fa;
}

/* Navbar */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-dark.bg-primary {
    background-color: var(--primary-color) !important;
}

/* Botón de cerrar sesión */
.nav-item .nav-link i.fas.fa-sign-out-alt {
    font-size: 1.2rem;
    color: #fff;
    transition: all 0.3s ease;
}

.nav-item .nav-link:hover i.fas.fa-sign-out-alt {
    color: #f8f9fa;
    transform: translateX(2px);
}

/* Botones */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 50px;
    padding: .5rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #0d8ecf;
    border-color: #0d8ecf;
    box-shadow: 0 0 0 0.25rem rgba(29, 161, 242, 0.25);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 50px;
    padding: .5rem 1.5rem;
    font-weight: 600;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Cards */
.card {
    border-radius: 15px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    background-color: #fff;
    padding: 1rem 1.25rem;
}

/* Salas de chat y streaming */
.room-container {
    margin-bottom: 30px;
}

.room-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0;
}

#remoteVideo {
    min-height: 400px;
    background-color: #000;
    border-radius: 15px;
}

.stream-controls {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 100%);
    border-radius: 0 0 15px 15px;
}

.stream-controls .btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chat */
.chat-messages {
    height: 300px;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

/* Clase chat-message para los nuevos mensajes */
.chat-message {
    max-width: 85%;
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    background-color: #f1f1f1;
    align-self: flex-start;
}

.chat-message-own {
    background-color: #dcf8c6;
    align-self: flex-end;
}

.chat-message-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.chat-message-content {
    word-break: break-word;
}

/* Mantener compatibilidad con la clase message antigua */
.message {
    max-width: 85%;
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    background-color: #f1f1f1;
    align-self: flex-start;
}

.message-own {
    background-color: #dcf8c6;
    align-self: flex-end;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.message-header small {
    color: #6c757d;
}

.message-body {
    word-break: break-word;
}

.chat-form {
    padding: 10px;
    border-top: 1px solid #ddd;
}

/* Estilos para modo pantalla completa */
:fullscreen .video-container,
:-webkit-full-screen .video-container {
    background-color: black;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    max-width: 100vw;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

:fullscreen #localVideoContainer,
:-webkit-full-screen #localVideoContainer {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 180px;
    height: 120px;
    z-index: 100;
}

:fullscreen .remote-videos,
:-webkit-full-screen .remote-videos {
    width: 100%;
    height: 100%;
}

:fullscreen .remote-videos .video-item,
:-webkit-full-screen .remote-videos .video-item {
    width: 100%;
    height: 100%;
    max-height: 100vh;
}

:fullscreen .remote-videos video,
:-webkit-full-screen .remote-videos video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: black;
}

:fullscreen .row,
:fullscreen .card,
:fullscreen .card-body,
:-webkit-full-screen .row,
:-webkit-full-screen .card,
:-webkit-full-screen .card-body {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 100% !important;
    max-height: 100vh !important;
}

/* Control bar para pantalla completa */
.fullscreen-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 50px;
    display: flex;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1000;
}

.video-container:hover .fullscreen-controls {
    opacity: 1;
}

/* Botón de pantalla completa con tooltip */
#fullscreenToggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.5);
    position: relative;
    transition: all 0.2s ease;
}

#fullscreenToggle:hover {
    background-color: rgba(0, 0, 0, 0.9);
    border-color: white;
    transform: scale(1.1);
}

/* Estilo para cuando está en pantalla completa */
:fullscreen #fullscreenToggle i.fa-compress,
:-webkit-full-screen #fullscreenToggle i.fa-compress {
    color: #ff9800;
    /* Color naranja para indicar que se puede salir */
}

/* Mejorar la visibilidad de los controles de video/audio */
#toggleAudio,
#toggleVideo,
#toggleScreen {
    font-size: 1.1rem;
    padding: 10px 15px;
    border-radius: 50px;
}

/* Personalización del cursor para pantalla completa */
:fullscreen {
    cursor: none;
}

:fullscreen:hover {
    cursor: default;
}

/* Animación para indicar que se puede presionar F11 */
.f11-hint {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    z-index: 1000;
    animation: fadeInOut 5s forwards;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* Botón para maximizar video local */
.maximize-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.5);
    padding: 0;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 10;
}

.video-item:hover .maximize-btn,
:fullscreen .video-item:hover .maximize-btn,
:-webkit-full-screen .video-item:hover .maximize-btn {
    opacity: 1;
}

.maximize-btn:hover {
    background-color: rgba(0, 0, 0, 0.9);
    border-color: white;
    transform: scale(1.1);
}

/* Aplicar color diferente cuando está maximizado */
.video-item.maximized .maximize-btn i.fa-compress,
#localVideoContainer.maximized .maximize-btn i.fa-compress {
    color: #ff9800;
    /* Mismo color naranja que el botón de pantalla completa */
}

/* Estado maximizado para el video local */
#localVideoContainer.maximized {
    position: fixed;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 1000;
    background-color: black;
}

#localVideoContainer.maximized video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#localVideoContainer.maximized .video-label {
    font-size: 16px;
    padding: 12px;
}

#localVideoContainer.maximized .maximize-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    font-size: 18px;
    opacity: 1;
}

/* Añadir capa oscura cuando el video local está maximizado */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 999;
}

/* Mejoras para compartir pantalla */
.remote-video-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

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

.remote-video {
    background-color: #000;
    border-radius: 8px;
}

.status-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 8px;
    z-index: 5;
}

.status-indicator span {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 4px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.audio-indicator {
    color: rgb(255, 196, 0);
}

.video-indicator {
    color: rgb(0, 255, 115);
}

.screen-indicator {
    color: rgb(0, 183, 255);
}

.video-label {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 5;
}

/* Estilo para video local cuando se comparte pantalla */
#localVideoContainer.sharing-screen {
    border: 2px solid #1DA1F2;
    box-shadow: 0 0 10px rgba(29, 161, 242, 0.5);
}

#localVideoContainer.sharing-screen .video-label {
    display: none;
    /* Ocultar etiqueta cuando se comparte pantalla */
}

/* Mejoras para los controles de video */
.stream-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 100%);
    transition: opacity 0.3s ease;
    opacity: 0;
}

.video-container:hover .stream-controls {
    opacity: 1;
}

/* Mejoras para pantallas compartidas */
.remote-video-container.screen-sharing {
    border: 2px solid #000 !important; /* CAMBIO: Borde negro */
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5) !important; /* Sombra negra */
    background-color: #000;
    max-height: none !important;
    flex-basis: 100%;
    width: 100%;
    margin-bottom: 20px;
}

.remote-video-container.screen-sharing video {
    object-fit: contain !important;
    background-color: #000;
}

.remote-video-container.screen-sharing .video-label {
    display: none;
    /* Ocultar etiqueta cuando se comparte pantalla */
}

.remote-video-container.screen-sharing .screen-indicator {
    background-color: rgba(0, 183, 255, 0.8);
    color: white;
    border: 2px solid white;
}

/* Mejorar indicadores de estado */
.status-indicator span {
    width: 28px;
    height: 28px;
    transition: all 0.3s ease;
}

.status-indicator span:hover {
    transform: scale(1.2);
}

.audio-indicator {
    background-color: rgba(255, 196, 0, 0.7) !important;
}

.video-indicator {
    background-color: rgba(0, 255, 115, 0.7) !important;
}

.screen-indicator {
    background-color: rgba(0, 183, 255, 0.7) !important;
}

/* Mejoras para la visualización en pantalla completa */
:fullscreen .remote-video-container.screen-sharing,
:-webkit-full-screen .remote-video-container.screen-sharing {
    max-width: 100%;
    max-height: 100vh;
    width: 100%;
    height: 100%;
    margin: 0;
}

:fullscreen .remote-video-container.screen-sharing video,
:-webkit-full-screen .remote-video-container.screen-sharing video {
    width: 100%;
    height: 100%;
}

/* Mensaje para reproducir video */
.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    z-index: 5;
}

.play-overlay i {
    font-size: 48px;
    margin-bottom: 10px;
}

/* Maximizar video remoto */
.remote-video-container.maximized {
    position: fixed;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 1000;
    background-color: black;
    margin: 0;
    padding: 0;
}

.remote-video-container.maximized video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.remote-video-container.maximized .video-label {
    font-size: 16px;
    padding: 12px;
}

/* Disposición de videos en grid para mejorar visualización */
.remote-videos {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.remote-video-container:not(.screen-sharing) {
    flex: 1 1 300px;
    max-width: 400px;
    margin-bottom: 10px;
}

/* Mejoras para dispositivos móviles */
@media (max-width: 768px) {
    .remote-video-container.screen-sharing {
        height: auto;
        min-height: 250px;
    }

    .remote-video-container:not(.screen-sharing) {
        flex: 1 1 150px;
    }

    .status-indicator span {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
}

/* Notificación para compartir pantalla */
.screen-share-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(29, 161, 242, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    font-weight: bold;
    animation: fadeInOut 5s forwards;
}

/* Mejoras para la detección de pantalla compartida */
.remote-video-container.screen-sharing {
    border: 3px solid #000 !important; /* CAMBIO: Borde negro */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.6) !important; /* Sombra negra */
    order: -1;
    /* Siempre mostrar primero */
}

/* Aumentar la prioridad de estas reglas */
.remote-video-container.screen-sharing video {
    object-fit: contain !important;
    background-color: #000 !important;
    max-height: none !important;
}

/* Hacer que el video remoto sea más responsivo */
.remote-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

/* Destacar container cuando hay problemas */
.remote-video-container.connection-failed {
    border: 2px solid #ff3b30;
    box-shadow: 0 0 10px rgba(255, 59, 48, 0.5);
    position: relative;
}

.remote-video-container.connection-warning::before {
    content: "⚠️ Problemas de conexión";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    border-radius: 5px;
    z-index: 10;
}

/* Mejorar visibilidad de las etiquetas */
.video-label {
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
    font-weight: bold;
}

/* Organización del contenedor de videos */
.remote-videos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    width: 100%;
}

/* Si hay pantalla compartida, cambiar la disposición */
.remote-videos:has(.screen-sharing) {
    grid-template-columns: 1fr;
}

.remote-videos:has(.screen-sharing) .remote-video-container:not(.screen-sharing) {
    max-width: 300px;
    max-height: 200px;
}

@media (max-width: 768px) {
    .remote-videos {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

/* Estados de conexión */
.remote-video-container.connection-connected {
    border: 2px solid #34c759;
    box-shadow: 0 0 10px rgba(52, 199, 89, 0.5);
}

.remote-video-container.connection-warning {
    border: 2px solid #ffcc00;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

.remote-video-container.connection-failed {
    border: 2px solid #ff3b30;
    box-shadow: 0 0 10px rgba(255, 59, 48, 0.5);
    opacity: 0.8;
}

.remote-video-container.connection-failed::before,
.remote-video-container.connection-warning::before {
    content: attr(data-connection-status);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    z-index: 10;
    font-weight: bold;
    text-align: center;
    width: 80%;
    max-width: 300px;
}

.remote-video-container.connection-warning::before {
    content: "Conexión inestable";
    background-color: rgba(255, 204, 0, 0.7);
    color: #333;
}

/* Mejorar visualización de pantalla compartida */
.remote-video-container.screen-sharing {
    border: 3px solid #000000 !important;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.7) !important; /* CAMBIO: Sombra negra */
    order: -1 !important;
    z-index: 10;
    background-color: #000;
    grid-column: 1 / -1;
    max-height: none;
}

.remote-video-container.screen-sharing video {
    object-fit: contain !important;
    max-height: 100%;
    width: 100%;
    background-color: #000;
}

/* Mejorar cuadrícula de videos */
.remote-videos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    width: 100%;
}

/* Ajuste para cuando hay pantalla compartida */
.remote-videos:has(.screen-sharing) {
    grid-template-rows: auto auto;
}

/* Spinner de carga para videos */
.remote-video-container::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    z-index: 2;
}

.remote-video-container.loaded::before {
    display: none;
}

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

/* Mostrar controles de video siempre al compartir pantalla */
.remote-video-container.screen-sharing video::-webkit-media-controls {
    display: flex !important;
    opacity: 1 !important;
}

.remote-video-container.screen-sharing:hover video::-webkit-media-controls {
    opacity: 1 !important;
}

/* Adaptaciones para móviles */
@media (max-width: 768px) {
    .remote-video-container.screen-sharing {
        max-height: 50vh;
    }

    .remote-videos {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 8px;
    }
}

/* Estilos para estados de conexión */
.remote-video-container.connection-connected {
    border: 2px solid #34c759;
    box-shadow: 0 0 10px rgba(52, 199, 89, 0.5);
}

.remote-video-container.connection-warning {
    border: 2px solid #ffcc00;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

.remote-video-container.connection-failed {
    border: 2px solid #ff3b30;
    box-shadow: 0 0 10px rgba(255, 59, 48, 0.5);
    opacity: 0.8;
}

.remote-video-container.connection-failed::before,
.remote-video-container.connection-warning::before {
    content: attr(data-connection-status);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    z-index: 10;
    font-weight: bold;
    text-align: center;
    width: 80%;
    max-width: 300px;
}

/* Mejorar visibilidad de la pantalla compartida */
.screen-sharing video {
    background-color: #000 !important;
    object-fit: contain !important;
}

.remote-video-container.screen-sharing.connection-connected {
    border: 3px solid #34c759;
    box-shadow: 0 0 15px rgba(52, 199, 89, 0.6);
}

/* Notificación mejorada para compartir pantalla */
.screen-share-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(29, 161, 242, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    font-weight: bold;
    animation: fadeInOut 5s forwards;
    display: flex;
    align-items: center;
    gap: 10px;
}

.screen-share-notification::before {
    content: '\f108';
    /* Monitor icon */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 20px;
}

/* Mejorar diseño responsive */
@media (max-width: 768px) {

    .remote-video-container.connection-failed::before,
    .remote-video-container.connection-warning::before {
        font-size: 12px;
        padding: 5px 8px;
    }

    .screen-share-notification {
        font-size: 12px;
        padding: 8px 12px;
    }

    .screen-share-notification::before {
        font-size: 14px;
    }
}

/* Estilos para la integración con VDO.ninja */
.video-container {
    position: relative;
    width: 100%;
    min-height: 500px;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
}

#vdoNinjaContainer {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 500px;
}

#vdoNinjaFrame {
    width: 100%;
    height: 100%;
    min-height: 500px;
    border: none;
}

.fullscreen-controls {
    position: absolute;
    bottom: 15px;
    right: 15px;
    z-index: 100;
}

.fullscreen-controls button {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.fullscreen-controls button:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

/* Estilos para la lista de participantes */
.participants-list {
    max-height: 300px;
    overflow-y: auto;
}

/* Estilos para el chat */
.chat-messages {
    height: 300px;
    overflow-y: auto;
    padding: 10px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.chat-message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    background-color: #e9ecef;
    max-width: 80%;
}

.chat-message-own {
    margin-left: auto;
    background-color: #d1e7ff;
}

.chat-message-header {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.chat-form {
    padding: 10px;
}

/* Notificaciones toast */
.notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 250px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.3s, fadeOut 0.5s 4.5s forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Estilos para el botón de compartir pantalla con recordatorio */
#toggleScreen {
    position: relative;
}

#toggleScreen::after {
    content: "Recuerda marcar 'Compartir audio'";
    position: absolute;
    bottom: -28px;
    left: 0;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 100;
    pointer-events: none;
}

#toggleScreen:hover::after {
    opacity: 1;
}