/* linguagem-flutuante.css - Menu flutuante de idiomas otimizado */

/* Container principal do menu flutuante */
.floating-language-menu {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
}

/* Botão principal flutuante */
.floating-language-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4DA8DA 0%, #2d8cc0 100%);
    border: 3px solid white;
    box-shadow: 0 10px 30px rgba(77, 168, 218, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: floatBounce 3s ease-in-out infinite;
    z-index: 10000;
}

.floating-language-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 40px rgba(77, 168, 218, 0.6);
}

.floating-language-btn:active {
    transform: scale(0.95);
}

.floating-language-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.floating-language-btn:hover::before {
    opacity: 1;
}

.floating-language-flag {
    font-size: 28px;
    line-height: 1;
    margin-bottom: 2px;
    transition: transform 0.3s ease;
}

.floating-language-name {
    font-size: 12px;
    font-weight: 600;
    color: white;
    letter-spacing: 0.5px;
}

.floating-language-btn:hover .floating-language-flag {
    transform: scale(1.2);
}

/* Menu de opções */
.floating-language-options {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 15px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    bottom: 90px;
    right: 0;
    min-width: 200px;
    border: 1px solid #eaeaea;
    max-height: 0;
    overflow: hidden;
    z-index: 9998;
}

.floating-language-options.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    max-height: 400px;
}

/* Opções do menu */
.language-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    cursor: pointer;
    border-radius: 15px;
    transition: all 0.3s ease;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
}

.language-option:last-child {
    margin-bottom: 0;
}

.language-option:hover {
    background: #4DA8DA;
    color: white;
    transform: translateX(-5px);
    box-shadow: 0 5px 15px rgba(77, 168, 218, 0.3);
}

.language-option.active {
    background: linear-gradient(135deg, #4DA8DA 0%, #2d8cc0 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(77, 168, 218, 0.4);
}

.language-option .option-flag {
    font-size: 24px;
    transition: transform 0.3s ease;
    min-width: 30px;
    text-align: center;
}

.language-option:hover .option-flag {
    transform: scale(1.3);
}

.language-option .option-name {
    font-weight: 500;
    flex-grow: 1;
}

/* Seta do menu */
.floating-language-options::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 25px;
    width: 20px;
    height: 20px;
    background: white;
    transform: rotate(45deg);
    border-right: 1px solid #eaeaea;
    border-bottom: 1px solid #eaeaea;
    z-index: 9999;
}

/* Tooltip */
.floating-language-tooltip {
    position: absolute;
    top: -40px;
    right: 0;
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 10001;
}

.floating-language-tooltip::before {
    content: '';
    position: absolute;
    top: 100%;
    right: 20px;
    width: 10px;
    height: 10px;
    background: #333;
    transform: rotate(45deg);
}

.floating-language-btn:hover .floating-language-tooltip {
    opacity: 1;
    transform: translateY(0);
}

/* Animações */
@keyframes floatBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulseEffect {
    0%, 100% {
        box-shadow: 0 10px 30px rgba(77, 168, 218, 0.4);
    }
    50% {
        box-shadow: 0 10px 30px rgba(77, 168, 218, 0.8);
    }
}

.floating-language-btn.pulse {
    animation: pulseEffect 2s ease-in-out infinite;
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.floating-language-btn:active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: ripple 0.6s ease-out;
}

/* Animação de entrada das opções */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.language-option.animate-in {
    animation: slideInFromRight 0.3s ease forwards;
}

/* Indicador de idioma atual */
.language-option.active::after {
    content: '✓';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
    font-size: 16px;
}

/* Efeito de brilho no botão ativo */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 10px 30px rgba(77, 168, 218, 0.4);
    }
    50% {
        box-shadow: 0 10px 30px rgba(77, 168, 218, 0.8), 0 0 20px rgba(77, 168, 218, 0.6);
    }
}

.floating-language-btn.glow {
    animation: glow 2s ease-in-out infinite;
}

/* Modo escuro */
body.dark-mode .floating-language-options {
    background: #2d2d2d;
    border-color: #404040;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

body.dark-mode .floating-language-options::after {
    background: #2d2d2d;
    border-color: #404040;
}

body.dark-mode .language-option {
    background: #3d3d3d;
    color: rgba(255, 255, 255, 0.9);
}

body.dark-mode .language-option:hover {
    background: #4DA8DA;
    color: white;
}

body.dark-mode .language-option.active {
    background: linear-gradient(135deg, #4DA8DA 0%, #2d8cc0 100%);
}

body.dark-mode .floating-language-tooltip {
    background: #444;
}

body.dark-mode .floating-language-tooltip::before {
    background: #444;
}

/* Badge de notificação */
.language-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: badgePop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 2px solid white;
    z-index: 1;
}

@keyframes badgePop {
    0% {
        transform: scale(0);
    }
    70% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

/* Mensagem de confirmação */
.language-confirmation {
    position: absolute;
    top: -50px;
    right: 0;
    background: #2ed573;
    color: white;
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 10001;
    box-shadow: 0 5px 15px rgba(46, 213, 115, 0.3);
}

.language-confirmation.show {
    opacity: 1;
    transform: translateY(0);
}

.language-confirmation::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 20px;
    width: 10px;
    height: 10px;
    background: #2ed573;
    transform: rotate(45deg);
}

/* Efeito de loading */
.language-option.loading {
    position: relative;
    overflow: hidden;
}

.language-option.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Efeito de seleção suave */
.language-option.selected {
    animation: selectPulse 0.5s ease;
}

@keyframes selectPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Sombras dinâmicas */
.floating-language-btn.depth {
    box-shadow: 
        0 10px 30px rgba(77, 168, 218, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

/* Efeito de borda animada */
.floating-language-btn::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #4DA8DA, #2d8cc0, #4DA8DA);
    border-radius: 50%;
    z-index: -1;
    animation: rotateBorder 3s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.floating-language-btn:hover::before {
    opacity: 1;
}

@keyframes rotateBorder {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ============================================
   RESPONSIVIDADE OTIMIZADA PARA MOBILE
   ============================================ */

/* Tablet e Mobile Pequeno */
@media (max-width: 1024px) {
    .floating-language-menu {
        bottom: 25px;
        right: 25px;
    }
    
    .floating-language-btn {
        width: 65px;
        height: 65px;
    }
    
    .floating-language-flag {
        font-size: 26px;
    }
    
    .floating-language-name {
        font-size: 11px;
    }
}

/* Mobile Médio */
@media (max-width: 768px) {
    .floating-language-menu {
        bottom: 20px;
        right: 20px;
        z-index: 1000; /* Reduzido para não sobrepor menus */
    }
    
    .floating-language-btn {
        width: 60px;
        height: 60px;
        border-width: 2px;
        box-shadow: 0 8px 25px rgba(77, 168, 218, 0.4);
    }
    
    .floating-language-flag {
        font-size: 24px;
    }
    
    .floating-language-name {
        font-size: 10px;
    }
    
    .floating-language-options {
        min-width: 180px;
        padding: 12px;
        right: -5px;
    }
    
    .floating-language-options::after {
        right: 20px;
        width: 18px;
        height: 18px;
    }
    
    .language-option {
        padding: 10px 12px;
        font-size: 13px;
        margin-bottom: 6px;
        gap: 12px;
    }
    
    .language-option .option-flag {
        font-size: 22px;
        min-width: 28px;
    }
    
    .floating-language-tooltip {
        display: none; /* Esconde tooltip em mobile */
    }
    
    /* Remove animação de flutuação em mobile para performance */
    .floating-language-btn {
        animation: none;
    }
}

/* Mobile Pequeno (Celulares) */
@media (max-width: 480px) {
    .floating-language-menu {
        bottom: 15px;
        right: 15px;
    }
    
    .floating-language-btn {
        width: 55px;
        height: 55px;
        box-shadow: 0 6px 20px rgba(77, 168, 218, 0.4);
    }
    
    .floating-language-flag {
        font-size: 22px;
        margin-bottom: 1px;
    }
    
    .floating-language-name {
        font-size: 9px;
        letter-spacing: 0.3px;
    }
    
    .floating-language-options {
        min-width: 160px;
        padding: 10px;
        right: -8px;
        border-radius: 18px;
    }
    
    .floating-language-options::after {
        right: 18px;
        width: 16px;
        height: 16px;
    }
    
    .language-option {
        padding: 8px 10px;
        font-size: 12px;
        margin-bottom: 5px;
        gap: 10px;
        border-radius: 12px;
    }
    
    .language-option .option-flag {
        font-size: 20px;
        min-width: 25px;
    }
    
    /* Ajuste para telas muito pequenas */
    @media (max-height: 600px) {
        .floating-language-options {
            max-height: 300px;
            overflow-y: auto;
        }
        
        .language-option {
            padding: 6px 8px;
            font-size: 11px;
        }
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .floating-language-menu {
        bottom: 10px;
        right: 10px;
    }
    
    .floating-language-btn {
        width: 50px;
        height: 50px;
    }
    
    .floating-language-flag {
        font-size: 20px;
    }
    
    .floating-language-name {
        font-size: 8px;
    }
    
    .floating-language-options {
        bottom: 70px;
        max-height: 200px;
        overflow-y: auto;
    }
}

/* Dark mode mobile optimizations */
@media (max-width: 768px) {
    body.dark-mode .floating-language-options {
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    }
    
    body.dark-mode .floating-language-btn {
        box-shadow: 0 8px 25px rgba(77, 168, 218, 0.5);
    }
}

/* Ajuste para não sobrepor elementos específicos do seu site */
@media (max-width: 768px) {
    /* Garante que não sobreponha botões fixos */
    .floating-language-menu {
        z-index: 500; /* Ajustado para não sobrepor outros elementos */
    }
    
    /* Se você tiver algum botão fixo na parte inferior direita */
    .fixed-bottom-right-button {
        right: 90px !important; /* Espaço para o menu de idiomas */
    }
}

/* Performance optimizations */
@media (max-width: 768px) {
    /* Reduce animations for better performance */
    .floating-language-btn,
    .language-option,
    .floating-language-options {
        animation-duration: 0.3s;
    }
    
    /* Disable complex animations on low-end devices */
    @media (max-width: 360px) {
        .floating-language-btn::before {
            display: none;
        }
        
        .language-option:hover {
            transform: translateX(0);
        }
    }
}

/* Impedir scroll quando menu está aberto (opcional) */
.floating-language-options.active {
    position: fixed;
}

/* Garantir que o menu fique acima de outros elementos */
@media (max-width: 768px) {
    .floating-language-options.active {
        position: fixed;
        z-index: 9999;
        max-height: 80vh;
        overflow-y: auto;
    }
}

/* Ajuste para dispositivos com notches (iPhone X, etc) */
@media (max-width: 768px) {
    @supports (padding-top: env(safe-area-inset-top)) {
        .floating-language-menu {
            bottom: calc(15px + env(safe-area-inset-bottom));
            right: calc(15px + env(safe-area-inset-right));
        }
    }
}