/* ========================================
   LANGUAGE SELECTOR - Seletor de Idiomas
   Desktop: 3 bandeiras lado a lado
   Mobile: 3 bandeiras dentro do menu hambúrguer
   ======================================== */

/* ========================================
   DESKTOP - 3 BANDEIRAS LADO A LADO
   ======================================== */

.language-selector {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    z-index: 1000;
    gap: 6px;
}

/* Cada bandeira desktop */
.lang-flag-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50%;
    opacity: 0.5;
}

.lang-flag-btn:hover {
    transform: scale(1.15);
    opacity: 0.8;
}

.lang-flag-btn.active {
    opacity: 1;
    box-shadow: 0 0 0 2px #a58546;
    border-radius: 50%;
}

.lang-flag-btn img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
}

/* Oculta elementos do dropdown antigo caso existam */
.lang-dropdown-toggle,
.lang-dropdown-arrow,
.lang-dropdown-menu,
.lang-dropdown-item {
    display: none !important;
}

/* ========================================
   MOBILE - ESCONDE DESKTOP
   ======================================== */

@media screen and (max-width: 991px) {
    .language-selector {
        display: none !important;
    }
}

/* ========================================
   MOBILE - BANDEIRAS NO MENU HAMBÚRGUER
   ======================================== */

/* Esconde completamente no desktop */
.language-selector-mobile {
    display: none !important;
    list-style: none !important;
}

/* Mostra apenas no mobile */
@media screen and (max-width: 991px) {
    .language-selector-mobile {
        display: block !important;
        width: 100%;
        padding: 15px 20px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        margin: 0 0 10px 0 !important;
    }

    .lang-mobile-container {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        gap: 5px;
    }

    .lang-btn-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        background: transparent;
        border: none;
        cursor: pointer;
        transition: all 0.3s ease;
        border-radius: 50%;
    }

    .lang-btn-mobile:hover,
    .lang-btn-mobile:focus {
        transform: scale(1.1);
    }

    .lang-btn-mobile.active {
        box-shadow: 0 0 0 2px #fedb6b;
        border-radius: 50%;
    }

    .lang-btn-mobile img {
        width: 38px;
        height: 38px;
        border-radius: 50%;
        object-fit: cover;
    }
}

/* Mobile pequeno */
@media screen and (max-width: 479px) {
    .language-selector-mobile {
        padding: 12px 15px !important;
    }

    .lang-btn-mobile img {
        width: 34px;
        height: 34px;
    }
}

/* ========================================
   ANIMAÇÃO DE CARREGAMENTO
   ======================================== */

.lang-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lang-loading.active {
    opacity: 1;
    visibility: visible;
}

.lang-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(254, 219, 107, 0.3);
    border-top-color: #fedb6b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ========================================
   ELEMENTOS TRADUZÍVEIS
   ======================================== */

[data-i18n] {
    transition: opacity 0.2s ease;
}

.translating [data-i18n] {
    opacity: 0.5;
}
