/* ============================================
   DATALEVEL - Tradutor Automático v2
   Seletor de idioma customizado na navbar
   ============================================ */

/* ============================================
   SELETOR DE IDIOMA CUSTOMIZADO
   ============================================ */

.dl-lang-selector {
    position: relative;
    display: flex;
    align-items: center;
}

.dl-lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 9999px;
    border: 1px solid #e5e7eb;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

.dl-lang-btn:hover {
    border-color: #6366f1;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.dl-lang-btn .dl-flag {
    font-size: 18px;
    line-height: 1;
}

.dl-lang-btn .dl-chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.dl-lang-selector.open .dl-lang-btn .dl-chevron {
    transform: rotate(180deg);
}

/* Dropdown de idiomas */
.dl-lang-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 9999;
    overflow: hidden;
}

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

.dl-lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
}

.dl-lang-option:last-child {
    border-bottom: none;
}

.dl-lang-option:hover {
    background: #f0f0ff;
    color: #6366f1;
}

.dl-lang-option.active {
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 600;
}

.dl-lang-option .dl-flag {
    font-size: 20px;
    line-height: 1;
}

.dl-lang-option .dl-lang-name {
    flex: 1;
}

.dl-lang-option .dl-check {
    width: 16px;
    height: 16px;
    color: #4f46e5;
    display: none;
}

.dl-lang-option.active .dl-check {
    display: block;
}

/* ============================================
   LANDING PAGE - Tema escuro para navbar 
   ============================================ */

.dl-lang-btn.dark {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.dl-lang-btn.dark:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   LOADING INDICATOR 
   ============================================ */

.dl-translating {
    position: fixed;
    bottom: 24px;
    left: 24px;
    background: white;
    border-radius: 12px;
    padding: 12px 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 99999;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    animation: slideInLeft 0.3s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.dl-translating .dl-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   RESPONSIVO
   ============================================ */

@media (max-width: 768px) {
    .dl-lang-btn span:not(.dl-flag) {
        display: none;
    }
    
    .dl-lang-btn {
        padding: 6px 8px;
        gap: 4px;
    }

    .dl-lang-dropdown {
        right: -10px;
    }
}
