/**
 * A Culpa é das Ovelhas - Estilos do Seletor de Idioma
 * Componente de internacionalização (i18n)
 */

/* ========================================
   LANGUAGE SELECTOR COMPONENT
   ======================================== */

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

/* Botão principal do seletor */
.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.lang-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent, #c46849);
}

/* Light mode */
body.light-mode .lang-btn {
    border-color: rgba(0, 0, 0, 0.15);
    color: #334155;
}

body.light-mode .lang-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.25);
}

/* Elementos do botão */
.lang-flag {
    font-size: 16px;
    line-height: 1;
}

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

.lang-arrow {
    transition: transform 0.2s ease;
    opacity: 0.7;
}

.lang-btn[aria-expanded='true'] .lang-arrow {
    transform: rotate(180deg);
}

/* ========================================
   DROPDOWN MENU
   ======================================== */

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 1000;
}

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

/* Light mode dropdown */
body.light-mode .lang-dropdown {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* ========================================
   LANGUAGE OPTIONS
   ======================================== */

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #e5e7eb;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}

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

.lang-option.active {
    background: rgba(196, 104, 73, 0.15);
    color: #c46849;
}

.lang-option.active:hover {
    background: rgba(196, 104, 73, 0.25);
}

/* Light mode options */
body.light-mode .lang-option {
    color: #334155;
}

body.light-mode .lang-option:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.light-mode .lang-option.active {
    background: rgba(196, 104, 73, 0.1);
    color: #b35a3d;
}

/* Elementos da opção */
.lang-option .lang-flag {
    font-size: 20px;
}

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

.lang-check {
    color: var(--accent, #c46849);
    font-weight: 700;
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */

@media (max-width: 768px) {
    .lang-selector {
        order: -1; /* Aparece antes do theme toggle em mobile */
    }

    .lang-btn {
        padding: 8px;
    }

    .lang-short {
        display: none; /* Esconde texto em mobile, só mostra flag */
    }

    .lang-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        min-width: 100%;
        border-radius: 16px 16px 0 0;
        padding: 16px;
        transform: translateY(100%);
    }

    .lang-dropdown.open {
        transform: translateY(0);
    }

    .lang-option {
        padding: 14px 16px;
        font-size: 16px;
    }

    .lang-option .lang-flag {
        font-size: 24px;
    }
}

/* ========================================
   HEADER INTEGRATION
   ======================================== */

/* Espaçamento no header-actions */
.header-actions .lang-selector,
#languageSelector {
    margin-right: 8px;
}

/* Inline com outros botões */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ========================================
   ANIMATION EFFECTS
   ======================================== */

@keyframes langDropdownEnter {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.lang-dropdown.open {
    animation: langDropdownEnter 0.2s ease forwards;
}

/* ========================================
   FOCUS STATES - ACCESSIBILITY
   ======================================== */

.lang-option:focus {
    outline: none;
    background: rgba(196, 104, 73, 0.2);
}

.lang-option:focus-visible {
    box-shadow: inset 0 0 0 2px var(--accent, #c46849);
}

/* ========================================
   RTL SUPPORT (futuro)
   ======================================== */

[dir='rtl'] .lang-dropdown {
    right: auto;
    left: 0;
}

[dir='rtl'] .lang-option {
    text-align: right;
}

[dir='rtl'] .lang-check {
    order: -1;
}
