/* SixStats language dropdown */

#mainheader,
.search-container {
    overflow: visible;
}

.search-container .language-dropdown {
    margin-left: 1vw
}

.language-dropdown {
    position: relative;
    z-index: 10000;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
}

.language-dropdown__toggle {
    box-sizing: border-box;
    width: 3.333vw;
    height: 1.979vw;
    padding: 0;
    border: 0.052vw solid #303746;
    border-radius: 52.031vw;
    background: #08090b;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.417vw;
    appearance: none;
    cursor: pointer;
    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        box-shadow 0.18s ease;
}

.language-dropdown__toggle:hover {
    border-color: #4a5365;
    background: #0d0f12;
}

.language-dropdown__toggle:focus-visible {
    outline: none;
    border-color: #5fa95a;
    box-shadow: 0 0 0 0.156vw rgba(95, 169, 90, 0.2);
}

.language-dropdown__selected-flag {
    display: block;
    width: 0.8vw;
    height: 0.8vw;
    flex: 0 0 1.406vw;
    border-radius: 0.104vw;
    object-fit: cover;
    box-shadow: 0 0 0 0.052vw rgba(255, 255, 255, 0.14);
}

.language-dropdown__chevron {
    width: 0.729vw;
    height: 0.729vw;
    fill: none;
    stroke: #f2f2f2;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.18s ease;
}

.language-dropdown--open .language-dropdown__chevron {
    transform: rotate(180deg);
}

.language-dropdown__menu {
    position: absolute;
    top: calc(100% + 0.521vw);
    right: 0;
    box-sizing: border-box;
    width: 10.938vw;
    padding: 0.365vw;
    border: 0.052vw solid #2b3140;
    border-radius: 0.521vw;
    background: #0c0e12;
    box-shadow: 0 0.833vw 2.188vw rgba(0, 0, 0, 0.48);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-0.313vw);
    transition:
        opacity 0.16s ease,
        visibility 0.16s ease,
        transform 0.16s ease;
}

.language-dropdown--open .language-dropdown__menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.language-dropdown__option {
    box-sizing: border-box;
    width: 100%;
    min-height: 2.188vw;
    padding: 0.417vw 0.521vw;
    border-radius: 0.365vw;
    display: flex;
    align-items: center;
    gap: 0.521vw;
    color: #e7e8eb;
    font-family: inherit;
    font-size: 0.729vw;
    font-weight: 400;
    line-height: 1.2;
    text-decoration: none;
    transition:
        color 0.15s ease,
        background-color 0.15s ease;
}

.language-dropdown__option:hover,
.language-dropdown__option:focus-visible {
    color: #ffffff;
    background: #191d24;
    outline: none;
}

.language-dropdown__option--active {
    color: #ffffff;
    background: #14181e;
}

.language-dropdown__flag {
    display: block;
    width: 1.406vw;
    height: 0.938vw;
    flex: 0 0 1.406vw;
    border-radius: 0.104vw;
    object-fit: cover;
    box-shadow: 0 0 0 0.052vw rgba(255, 255, 255, 0.12);
}

.language-dropdown__name {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
    white-space: nowrap;
}

.language-dropdown__check {
    width: 0.833vw;
    height: 0.833vw;
    flex: 0 0 0.833vw;
    fill: none;
    stroke: #61ae5c;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Tablet and mobile use fixed sizing so the control stays usable. */
@media (max-width: 900px) {
    .search-container .language-dropdown {
        margin-left: 8px;
    }

    .language-dropdown__toggle {
        width: 58px;
        height: 36px;
        border-width: 1px;
        border-radius: 999px;
        gap: 7px;
    }

    .language-dropdown__toggle:focus-visible {
        box-shadow: 0 0 0 3px rgba(95, 169, 90, 0.2);
    }

    .language-dropdown__selected-flag {
        width: 27px;
        height: 18px;
        flex-basis: 27px;
        border-radius: 2px;
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
    }

    .language-dropdown__chevron {
        width: 14px;
        height: 14px;
    }

    .language-dropdown__menu {
        top: calc(100% + 10px);
        width: 200px;
        padding: 7px;
        border-width: 1px;
        border-radius: 10px;
        box-shadow: 0 16px 42px rgba(0, 0, 0, 0.48);
        transform: translateY(-6px);
    }

    .language-dropdown__option {
        min-height: 42px;
        padding: 8px 10px;
        border-radius: 7px;
        gap: 10px;
        font-size: 14px;
    }

    .language-dropdown__flag {
        width: 27px;
        height: 18px;
        flex-basis: 27px;
        border-radius: 2px;
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
    }

    .language-dropdown__check {
        width: 16px;
        height: 16px;
        flex-basis: 16px;
    }
}

@media (max-width: 520px) {
    .language-dropdown__menu {
        position: fixed;
        top: auto;
        right: 12px;
        bottom: 12px;
        left: 12px;
        width: auto;
        max-height: calc(100vh - 24px);
        overflow-y: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .language-dropdown__toggle,
    .language-dropdown__chevron,
    .language-dropdown__menu,
    .language-dropdown__option {
        transition: none;
    }
}