/* ── Naibabiji AIDT Language Switcher ────────────────────────────────── */

.nbb-lang-switcher {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    z-index: 9999;
}

/* ── Floating variant ── */
.nbb-lang-switcher--floating {
    position: fixed;
}
.nbb-lang-switcher--bottom-right { bottom: 20px; right: 20px; }
.nbb-lang-switcher--bottom-left  { bottom: 20px; left: 20px; }
.nbb-lang-switcher--top-right    { top: 20px; right: 20px; }
.nbb-lang-switcher--top-left     { top: 20px; left: 20px; }

/* Toggle button */
.nbb-lang-switcher__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: box-shadow .2s;
    user-select: none;
}
.nbb-lang-switcher__toggle:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
.nbb-lang-switcher__arrow {
    font-size: 10px;
    color: #888;
    transition: transform .2s;
}
.nbb-lang-switcher--open .nbb-lang-switcher__arrow {
    transform: rotate(180deg);
}

/* Dropdown */
.nbb-lang-switcher__dropdown {
    display: none;
    position: absolute;
    list-style: none;
    margin: 4px 0 0 0;
    padding: 4px 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.14);
    min-width: 140px;
}

/* Position dropdown above/below toggle depending on corner */
.nbb-lang-switcher--bottom-right .nbb-lang-switcher__dropdown,
.nbb-lang-switcher--bottom-left  .nbb-lang-switcher__dropdown {
    bottom: 100%;
    margin-bottom: 4px;
    margin-top: 0;
}
.nbb-lang-switcher--bottom-right .nbb-lang-switcher__dropdown { right: 0; }
.nbb-lang-switcher--bottom-left  .nbb-lang-switcher__dropdown { left: 0; }
.nbb-lang-switcher--top-right    .nbb-lang-switcher__dropdown { right: 0; top: 100%; }
.nbb-lang-switcher--top-left     .nbb-lang-switcher__dropdown { left: 0;  top: 100%; }

.nbb-lang-switcher--open .nbb-lang-switcher__dropdown {
    display: block;
}

/* Items */
.nbb-lang-switcher__item a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s;
}
.nbb-lang-switcher__item a:hover {
    background: #f5f5f5;
}
.nbb-lang-switcher__item--active a {
    font-weight: 600;
    background: #f0f7ff;
}

/* ── Inline / shortcode variant ── */
.nbb-lang-switcher--inline .nbb-lang-switcher__list,
.nbb-lang-switcher--dropdown .nbb-lang-switcher__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.nbb-lang-switcher--inline .nbb-lang-switcher__item a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
}
.nbb-lang-switcher--inline .nbb-lang-switcher__item--active a {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

/* ── Flag image ── */
.nbb-flag {
    display: inline-block;
    vertical-align: middle;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── Nav-menu items ── */
.nbb-nav-lang a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.nbb-nav-lang .nbb-nav-lang-inner {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.nbb-nav-lang .nbb-flag {
    width: 18px;
    height: 13px;
}
.nbb-nav-lang.current-menu-item > a,
.nbb-nav-lang.nbb-nav-lang--active > a {
    font-weight: 600;
}

/* ── RTL support ── */
[dir="rtl"] .nbb-lang-switcher--bottom-right { right: auto; left: 20px; }
[dir="rtl"] .nbb-lang-switcher--bottom-left  { left: auto;  right: 20px; }

/* ── Language Detection Modal ──────────────────────────────────── */

/* Backdrop overlay */
#nbb-lang-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999998;
    opacity: 0;
    transition: opacity .3s ease;
}
#nbb-lang-modal-backdrop.nbb-lang-modal--visible {
    opacity: 1;
}

/* Modal dialog */
#nbb-lang-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 999999;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    padding: 28px 32px 24px;
    max-width: 420px;
    width: calc(100% - 32px);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    color: #1d2327;
    line-height: 1.5;
    opacity: 0;
    transition: opacity .3s ease, transform .3s ease;
    text-align: center;
}
#nbb-lang-modal.nbb-lang-modal--visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Modal content */
#nbb-lang-modal .nbb-lang-modal__text {
    margin: 0 0 20px 0;
    color: #50575e;
    font-size: 14px;
}
#nbb-lang-modal .nbb-lang-modal__lang-name {
    font-weight: 600;
    color: #1d2327;
}

/* Modal buttons */
#nbb-lang-modal .nbb-lang-modal__actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
#nbb-lang-modal .nbb-lang-modal__btn-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s;
    line-height: 1.4;
}
#nbb-lang-modal .nbb-lang-modal__btn-switch:hover {
    background: #135e96;
}
#nbb-lang-modal .nbb-lang-modal__btn-switch:visited {
    color: #fff;
}
#nbb-lang-modal .nbb-lang-modal__btn-dismiss {
    display: inline-flex;
    align-items: center;
    background: none;
    border: 1px solid #ccc;
    color: #646970;
    padding: 7px 18px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: border-color .2s, color .2s;
    line-height: 1.4;
}
#nbb-lang-modal .nbb-lang-modal__btn-dismiss:hover {
    border-color: #999;
    color: #1d2327;
}
