.auth-header {
    position: absolute;
    top: 20px;
    right: 20px;
    left: auto;
    z-index: 100;
}
.language-selector {
    position: relative;
    display: inline-block;
    margin-right: 7px;
    z-index: 1001;
}

.selected-language {
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.selected-language:hover {
    background: #323438;
}

.language-selector.disabled .selected-language {
    cursor: not-allowed;
    opacity: 0.5;
    pointer-events: none;
}

.language-selector.disabled .selected-language:hover {
    background: transparent;
}

.selected-language img {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.selected-language span {
    color: #fff;
    font-weight: 500;
    margin-left: 3px;
}

.language-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #252830;
    border-radius: 8px;
    padding: 8px 0;
    min-width: 100px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
}

.language-selector.active .language-dropdown {
    display: block !important;
    animation: dropdownFadeIn 0.3s ease;
    opacity: 1 !important;
    visibility: visible !important;
}

.language-dropdown li {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.language-dropdown li:hover {
    background: #3a3f47;
}

.language-dropdown img {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

.language-dropdown span {
    color: #d3d3d3;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.selected-language::after {
    content: '▼';
    font-size: 10px;
    margin-left: 2px;
    transition: transform 0.3s ease;
}

.language-selector.active .selected-language::after {
    transform: rotate(180deg);
}

@media (max-width: 768px) {
    .language-selector {
        position: relative !important;
        z-index: 9999 !important;
        margin-right: 10px !important;
    }

    .selected-language {
        padding: 6px 10px !important;
        border-radius: 6px !important;
        position: relative !important;
        z-index: 9999 !important;
    }

    .selected-language img {
        width: 20px !important;
        height: 20px !important;
    }

    .selected-language span {
        font-size: 13px !important;
        margin-left: 4px !important;
    }

    .language-selector.disabled .selected-language {
        cursor: not-allowed !important;
        opacity: 0.5 !important;
        pointer-events: none !important;
    }

    .language-selector.disabled .selected-language:hover {
        background: transparent !important;
    }

    .language-dropdown {
        position: absolute !important;
        top: 100% !important;
        right: 0 !important;
        left: auto !important;
        width: 180px !important;
        min-width: 180px !important;
        max-width: 180px !important;
        background: #2c3139 !important;
        border-radius: 8px !important;
        padding: 8px 0 !important;
        margin-top: 5px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        z-index: 10000 !important;
        max-height: 300px !important;
        overflow-y: auto !important;
        transform: translateZ(0) !important;
    }

    .language-selector.active {
        z-index: 10000 !important;
    }

    .language-selector.active .language-dropdown {
        display: block !important;
        animation: dropdownFadeIn 0.2s ease !important;
        z-index: 10000 !important;
    }

    .language-dropdown li {
        padding: 8px 12px !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .language-dropdown img {
        width: 20px !important;
        height: 20px !important;
        flex-shrink: 0 !important;
    }

    .language-dropdown span {
        font-size: 13px !important;
        color: #ffffff !important;
        flex: 1 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    @keyframes dropdownFadeIn {
        from {
            opacity: 0;
            transform: translateY(-5px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

@media (max-width: 380px) {
    .language-dropdown {
        width: 160px !important;
        min-width: 160px !important;
        max-width: 160px !important;
    }

    .selected-language {
        padding: 5px 8px !important;
    }

    .selected-language img,
    .language-dropdown img {
        width: 18px !important;
        height: 18px !important;
    }

    .selected-language span,
    .language-dropdown span {
        font-size: 12px !important;
    }

    .language-selector.disabled .selected-language {
        cursor: not-allowed !important;
        opacity: 0.5 !important;
        pointer-events: none !important;
    }

    .language-selector.disabled .selected-language:hover {
        background: transparent !important;
    }
}
