/**
 * musai - Estilos del selector de idioma
 * Versión header (desktop) + banner móvil
 */

/* ===========================================
   SELECTOR DE IDIOMA - HEADER (DESKTOP)
   =========================================== */
.language-selector-header {
    position: relative;
    display: flex;
    align-items: center;
}

.language-btn-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.language-btn-header:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.language-btn-header svg {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

.language-btn-header:hover svg {
    opacity: 1;
}

.lang-code-header {
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Dropdown Header */
.language-dropdown-header {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(20, 20, 25, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px;
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 10000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.language-selector-header.open .language-dropdown-header {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option-header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    font-family: inherit;
}

.lang-option-header:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.lang-option-header.active {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

/* Ocultar en móvil */
@media (max-width: 768px) {
    .language-selector-header {
        display: none;
    }
}

/* ===========================================
   HEADER MÓVIL - DOS FILAS
   =========================================== */

.language-selector-mobile {
    display: none; /* Oculto en desktop */
}

@media (max-width: 768px) {
    /* Ocultar selector desktop en móvil */
    .language-selector-header {
        display: none !important;
    }
    
    /* Header móvil consistente - SOLO cuando tiene nav con nav-links */
    .header:has(.nav-links) {
        padding: 0 !important;
    }
    
    /* Nav con flex-wrap para dos filas */
    .header:has(.nav-links) .nav {
        flex-wrap: wrap;
        padding: 10px 16px !important;
        row-gap: 8px;
    }
    
    /* Logo a la izquierda */
    .header:has(.nav-links) .logo {
        flex-shrink: 0;
        gap: 10px;
    }
    
    .header:has(.nav-links) .logo-icon-wrapper {
        width: 44px !important;
        height: 44px !important;
    }
    
    .header:has(.nav-links) .logo-text {
        font-size: 1.5rem !important;
    }
    
    /* Selector móvil a la derecha de la primera fila */
    .language-selector-mobile {
        display: flex !important;
        position: relative;
        align-items: center;
        margin-left: auto;
        z-index: 10;
    }
    
    /* Nav-links en segunda fila, ancho completo */
    .nav-links {
        width: 100%;
        display: flex !important;
        gap: 10px;
    }
    
    /* Créditos empuja todo a la derecha cuando está visible */
    .credits-display:not(.hidden) {
        margin-left: auto !important;
    }
    
    /* Ocultar iconos, mostrar texto */
    .nav-link .nav-icon,
    .btn-signup .nav-icon {
        display: none !important;
    }
    
    .nav-link .nav-link-text,
    .btn-signup .btn-signup-text {
        display: inline !important;
    }
    
    .btn-signup .btn-signup-arrow {
        display: none !important;
    }
    
    /* RESET completo y estilos IDÉNTICOS para ambos botones */
    .nav-link#loginLink,
    .btn-signup#signupLink {
        all: unset !important;
        box-sizing: border-box !important;
        position: relative !important;
        flex: 1 1 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 8px 12px !important;
        border-radius: 8px !important;
        font-family: 'Inter', sans-serif !important;
        font-size: 0.8rem !important;
        font-weight: 600 !important;
        text-align: center !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        -webkit-tap-highlight-color: transparent !important;
        z-index: 1 !important;
    }
    
    /* Login: Estilo secundario/outline */
    .nav-link#loginLink {
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        color: rgba(255, 255, 255, 0.9) !important;
    }
    
    .nav-link#loginLink:active {
        background: rgba(255, 255, 255, 0.1) !important;
        transform: scale(0.98);
    }
    
    /* Signup: Estilo primario/CTA */
    .btn-signup#signupLink {
        background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%) !important;
        border: none !important;
        color: #fff !important;
        box-shadow: 0 2px 10px rgba(99, 102, 241, 0.25) !important;
    }
    
    .btn-signup#signupLink:active {
        transform: scale(0.98);
        box-shadow: 0 1px 5px rgba(99, 102, 241, 0.3) !important;
    }
    
    /* Ocultar botones cuando usuario está logueado */
    .nav-link#loginLink.hidden,
    .btn-signup#signupLink.hidden {
        display: none !important;
    }
}

.language-btn-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
}

.language-btn-mobile:active {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(0.98);
}

.language-btn-mobile svg {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

.lang-code-mobile {
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Dropdown Móvil - Se despliega hacia ABAJO */
.language-dropdown-mobile {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(20, 20, 25, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 8px;
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 10000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    max-height: 320px;
    overflow-y: auto;
}

.language-selector-mobile.open .language-dropdown-mobile {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.lang-option-mobile {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    font-family: inherit;
}

.lang-option-mobile:hover,
.lang-option-mobile:active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.lang-option-mobile.active {
    background: rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
}

/* ===========================================
   ICONOS DE NAVEGACIÓN - DESKTOP
   =========================================== */
@media (min-width: 769px) {
    /* En desktop: ocultar iconos, mostrar texto */
    .nav-link .nav-icon,
    .btn-signup .nav-icon {
        display: none;
    }
    
    .nav-link .nav-link-text,
    .btn-signup .btn-signup-text,
    .btn-signup .btn-signup-arrow {
        display: inline;
    }
}

/* ===========================================
   USUARIO - NOMBRE COMPLETO VS INICIAL
   =========================================== */
.user-name-short {
    display: none;
}

/* ===========================================
   USUARIO LOGUEADO - MÓVIL (SOLO INICIAL)
   =========================================== */
@media (max-width: 768px) {
    /* Mostrar solo inicial del usuario en móvil */
    .user-name-full {
        display: none !important;
    }
    
    .user-name-short {
        display: inline !important;
        font-size: 0.85rem;
    }
    
    /* Avatar más pequeño en móvil */
    .user-avatar {
        width: 28px;
        height: 28px;
    }
    
    /* Botón de usuario más compacto */
    .user-btn {
        padding: 4px 8px;
        gap: 6px;
    }
    
    /* Ocultar flecha del dropdown en móvil */
    .user-btn svg:last-child {
        display: none;
    }
    
    /* Créditos más compactos */
    .credits-display {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    
    .credits-label {
        display: none;
    }
}
