﻿/* =========================================================
   Language Selector Dropdown
   ========================================================= */

/* ── Hide Bootstrap default caret ── */
#languages-dropdown::before,
#languages-dropdown::after {
    display: none !important;
}

/* ── Trigger button ── */
#languages-dropdown {
    width: 40px;
    height: 40px;
    border-radius: 10px !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease;
}

    #languages-dropdown:hover,
    #languages-dropdown[aria-expanded="true"] {
        background: rgba(0, 0, 0, 0.07) !important;
    }

    #languages-dropdown img {
        width: 22px;
        height: 22px;
        border: none;
        border-radius: 50%;
        object-fit: cover;
        display: block;
    }

/* ── Dropdown panel ── */
#languages .dropdown-menu {
    min-width: 150px;
    padding: 6px;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.13), 0 0 0 1px rgba(0, 0, 0, 0.06);
    transform-origin: top right;
    animation: langDrop 0.18s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    background: #fff;
}

@keyframes langDrop {
    from {
        opacity: 0;
        transform: scale(0.93) translateY(-6px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ── Individual item ── */
#languages .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px !important;
    border-radius: 8px !important;
    font-size: 13px;
    font-weight: 500;
    color: #1a202c !important;
    text-decoration: none !important;
    transition: background 0.13s ease;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.04);
}

    #languages .dropdown-item:hover,
    #languages .dropdown-item:active {
        background: #f5f7fb !important;
        color: #1a202c !important;
    }

    #languages .dropdown-item.active-lang {
        background: #f0f3f8 !important;
        font-weight: 700;
        color: #111 !important;
    }

    #languages .dropdown-item img {
        width: 20px;
        height: 20px;
        border: none;
        border-radius: 50%;
        object-fit: cover;
        flex-shrink: 0;
    }

    /* ── Active checkmark ── */
    #languages .dropdown-item .lang-check {
        margin-left: auto;
        font-size: 11px;
        color: #2563eb;
        opacity: 0;
    }

    #languages .dropdown-item.active-lang .lang-check {
        opacity: 1;
    }

/* ── Mobile: full-width bottom sheet (up to 480px) ── */
@media (max-width: 480px) {
    #languages .dropdown-menu {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        min-width: 100vw;
        max-width: 100vw;
        padding-top: 2rem !important;
        border-radius: 18px 18px 0 0 !important;
        animation: languageSlideUp 0.22s cubic-bezier(0.34, 1.4, 0.64, 1) both;
        box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.06) !important;
    }

    @keyframes languageSlideUp {
        from {
            opacity: 0;
            transform: translateY(24px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

        /* Drag handle */
    #languages .dropdown-menu::before {
        content: '';
        display: block;
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        border-radius: 2px;
        background: rgba(0, 0, 0, 0.12);
    }

    #languages .dropdown-menu .dropdown-item {
        min-height: 48px;
        padding: 10px !important;
    }
}