/* =========================================
   Nexbu Translator – Language Switcher CSS
   ========================================= */

/* ── Container ── */
.nexbu-lang-switcher {
    display: inline-block;
    font-family: inherit;
    font-size: 14px;
    line-height: 1;
    position: relative;
    z-index: 9990;
}

/* ── Dropdown ── */
.nexbu-dropdown {
    position: relative;
    display: inline-block;
}

.nexbu-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #ffffff;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: border-color .2s, box-shadow .2s;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.nexbu-dropdown-toggle:hover {
    border-color: #aaa;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
}

.nexbu-chevron {
    width: 10px;
    height: 6px;
    transition: transform .2s;
    flex-shrink: 0;
}

.nexbu-dropdown.nexbu-open .nexbu-chevron {
    transform: rotate(180deg);
}

.nexbu-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 140px;
    background: #fff;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    list-style: none;
    margin: 0;
    padding: 4px 0;
    z-index: 9999;
    animation: nexbuFadeIn .15s ease;
}

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

.nexbu-dropdown.nexbu-open .nexbu-dropdown-menu {
    display: block;
}

.nexbu-dropdown-item a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    color: #333;
    text-decoration: none;
    transition: background .15s;
    white-space: nowrap;
}

.nexbu-dropdown-item a:hover {
    background: #f5f5f5;
    color: #111;
    text-decoration: none;
}

.nexbu-dropdown-item.nexbu-active a {
    font-weight: 600;
    background: #f0f7ff;
    color: #0073aa;
}

/* ── Flags style ── */
.nexbu-flags-list {
    display: flex;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nexbu-flag-item a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1.5px solid transparent;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    transition: border-color .2s, background .2s;
}

.nexbu-flag-item a:hover {
    border-color: #ddd;
    background: #f5f5f5;
    text-decoration: none;
}

.nexbu-flag-item.nexbu-active a {
    border-color: #0073aa;
    background: #f0f7ff;
    color: #0073aa;
    font-weight: 600;
}

/* ── Floating button ── */
.nexbu-floating {
    position: fixed;
    z-index: 99999;
}

.nexbu-pos-bottom-right {
    bottom: 24px;
    right:  24px;
}

.nexbu-pos-bottom-left {
    bottom: 24px;
    left:   24px;
}

.nexbu-pos-top-right {
    top:   24px;
    right: 24px;
}

.nexbu-pos-top-left {
    top:  24px;
    left: 24px;
}

/* Floating dropdown opens upward */
.nexbu-floating .nexbu-dropdown-menu {
    bottom: calc(100% + 4px);
    top: auto;
}

/* ── In menu ── */
.nexbu-menu-item {
    display: flex;
    align-items: center;
}

.nexbu-in-menu .nexbu-dropdown-toggle {
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 8px 0;
}

.nexbu-in-menu .nexbu-dropdown-toggle:hover {
    border: none;
    box-shadow: none;
}

/* ── Dark mode ── */
@media (prefers-color-scheme: dark) {
    .nexbu-dropdown-toggle {
        background: #2a2a2a;
        border-color: #444;
        color: #eee;
    }
    .nexbu-dropdown-menu {
        background: #2a2a2a;
        border-color: #444;
    }
    .nexbu-dropdown-item a {
        color: #ddd;
    }
    .nexbu-dropdown-item a:hover {
        background: #3a3a3a;
        color: #fff;
    }
    .nexbu-dropdown-item.nexbu-active a {
        background: #1a3a5c;
        color: #79c0ff;
    }
}
