
/* Transición suave para cambio de tema claro/oscuro */
body {
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

/* Estilos de precisión en anotaciones de pronunciación */
.correct {
    color: #059669;
    font-weight: 700;
}
.dark .correct {
    color: #34d399;
}

.incorrect {
    color: #e11d48;
    text-decoration: underline;
    font-weight: 700;
    cursor: pointer;
}
.dark .incorrect {
    color: #fb7185;
}

/* Canvas de onda de audio para grabación */
canvas#waveform,
canvas#rp-waveform {
    display: block;
    border-radius: 0.75rem;
    transition: background-color 0.2s ease;
}

/* Scrollbar personalizado accesible para chat y paneles */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}
.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
.dark ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Overlay de login: centrado robusto en toda la pantalla,
               incluso en moviles (100dvh evita el salto por la barra de URL) */
#auth-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 1rem;
}
#auth-modal.hidden {
    display: none !important;
}
#auth-modal > div {
    margin: auto;
}

/* Mientras el modal de login esta visible, oculta por completo
               el resto de la app (no solo taparla con el fondo difuminado) */
#auth-modal:not(.hidden) ~ header,
#auth-modal:not(.hidden) ~ main {
    visibility: hidden;
}

/* El menu desplegable (#main-menu) usa position:absolute; sin un
               ancestro posicionado se alinea respecto al documento completo
               en vez de respecto al header. Esto lo corrige. */
header {
    position: relative;
    z-index: 50;
}

/* --- REGULACIÓN Y ESTILOS COMPACTOS DEL BADGE DE PERFIL --- */
#user-profile-badge {
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    height: 32px; /* Altura fija contenida idéntica a los botones de control */
}

#user-profile-badge:hover {
    background-color: rgba(67, 56, 202, 0.75);
    border-color: rgba(255, 255, 255, 0.4);
}

.dark #user-profile-badge:hover {
    background-color: rgba(30, 27, 75, 0.9);
}

#nav-user-avatar {
    width: 22px;
    height: 22px;
}

#nav-username {
    font-size: 0.7rem; /* ~11px */
    line-height: 1.1;
}

#nav-user-level-badge {
    font-size: 0.58rem; /* ~9px */
    line-height: 1;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
    font-size: 1.1em;
    vertical-align: middle;
}