/* STranslate — Widget Styles */

/* ── Protect flag emojis from Google Translate font override ─────────────── */
.wgtp-flag, .wgtp-flag-btn {
    font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji","Twemoji Mozilla",sans-serif !important;
    font-style: normal !important;
    visibility: visible !important;
    display: inline-block !important;
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
.wgtp-switcher *,
.wgtp-switcher *::before,
.wgtp-switcher *::after { box-sizing: border-box; }

.wgtp-switcher {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    display: inline-block;
    position: relative;
    z-index: 9999;
}

/* ── Floating positions ───────────────────────────────────────────────────── */
.wgtp-float { position: fixed; z-index: 99999; }
.wgtp-pos-bottom_right { bottom: 20px; right: 20px; }
.wgtp-pos-bottom_left  { bottom: 20px; left:  20px; }
.wgtp-pos-top_right    { top:    20px; right: 20px; }
.wgtp-pos-top_left     { top:    20px; left:  20px; }

/* ── Dropdown toggle button ───────────────────────────────────────────────── */
.wgtp-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    background: #1d2327;
    color: #fff;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 3px 12px rgba(0,0,0,.25);
    transition: background .2s, transform .1s;
    white-space: nowrap;
    user-select: none;
}
.wgtp-toggle:hover  { background: #2271b1; }
.wgtp-toggle:active { transform: scale(.97); }

.wgtp-caret {
    font-size: 9px;
    opacity: .7;
    transition: transform .2s;
}
.wgtp-dropdown.open .wgtp-caret { transform: rotate(180deg); }

/* ── Dropdown menu ────────────────────────────────────────────────────────── */
.wgtp-menu-wrap {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    z-index: 99999;
}

/* Position menu below for top-positioned floats */
.wgtp-pos-top_right .wgtp-menu-wrap,
.wgtp-pos-top_left  .wgtp-menu-wrap,
.wgtp-switcher:not(.wgtp-float) .wgtp-menu-wrap {
    bottom: auto;
    top: calc(100% + 6px);
}

.wgtp-dropdown.open .wgtp-menu-wrap { display: block; }

.wgtp-menu {
    max-height: 320px;
    overflow-y: auto;
    background: var(--wgtp-menu-bg, #fff);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,.15);
    list-style: none;
    margin: 0;
    padding: 6px 0;
    scroll-behavior: smooth;
}

.wgtp-menu-search {
    padding: 8px 10px 4px;
    border-bottom: 1px solid #f0f0f0;
}

.wgtp-search-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}
.wgtp-search-input:focus { border-color: #2271b1; }

.wgtp-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: #1d2327;
    text-decoration: none;
    transition: background .1s;
    white-space: nowrap;
}
.wgtp-menu li a:hover       { background: #f0f6fc; }
.wgtp-menu li.wgtp-active a { background: #f0f6fc; font-weight: 700; color: #2271b1; }

.wgtp-flag, .wgtp-flag-btn  { line-height: 1; flex-shrink: 0; }
.wgtp-name  { flex: 1; }

/* ── Flags-only row ───────────────────────────────────────────────────────── */
.wgtp-flags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    background: #1d2327;
    padding: 8px 12px;
    border-radius: 30px;
    box-shadow: 0 3px 12px rgba(0,0,0,.25);
}

.wgtp-flag-btn {
    text-decoration: none;
    line-height: 1;
    border-radius: 4px;
    padding: 2px;
    transition: transform .15s, opacity .15s;
    opacity: .75;
}
.wgtp-flag-btn:hover,
.wgtp-flag-btn.wgtp-active { opacity: 1; transform: scale(1.2); }

/* ── Inline (shortcode / widget area) ────────────────────────────────────── */
.wgtp-widget-area .wgtp-toggle,
.wgtp-switcher:not(.wgtp-float) .wgtp-toggle {
    background: #f6f7f7;
    color: #1d2327;
    border: 1px solid #dcdcde;
    box-shadow: none;
}
.wgtp-switcher:not(.wgtp-float) .wgtp-toggle:hover { background: #e0e0e0; }

.wgtp-switcher:not(.wgtp-float) .wgtp-menu {
    bottom: auto;
    top: calc(100% + 4px);
}

/* ── Admin info box ───────────────────────────────────────────────────────── */
.wgtp-info-box {
    background: #f0f6fc;
    border-left: 4px solid #2271b1;
    padding: 12px 16px;
    border-radius: 4px;
    margin-top: 16px;
    font-size: 13px;
    line-height: 1.6;
}

/* ── Scrollbar in menu ────────────────────────────────────────────────────── */
.wgtp-menu::-webkit-scrollbar { width: 5px; }
.wgtp-menu::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
.wgtp-menu::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 10px; }

/* ── Check mark for active item ─────────────────────────────────────────── */
.wgtp-check {
    margin-left: auto;
    color: #2271b1;
    font-size: 13px;
    font-weight: 700;
}

/* ── Horizontal list style ───────────────────────────────────────────────── */
.wgtp-lang-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.wgtp-lang-list li a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    color: inherit;
    text-decoration: none;
    font-size: 13px;
    transition: background .15s, border-color .15s;
}
.wgtp-lang-list li a:hover,
.wgtp-lang-list li.wgtp-active a {
    background: #f0f6fc;
    border-color: #2271b1;
    color: #2271b1;
    font-weight: 600;
}

/* ── Light theme ─────────────────────────────────────────────────────────── */
.wgtp-theme-light .wgtp-toggle {
    background: #f6f7f7;
    color: #1d2327;
    border: 1px solid #dcdcde;
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.wgtp-theme-light .wgtp-toggle:hover { background: #e8e8e8; }

/* ── Custom theme via CSS vars ───────────────────────────────────────────── */
.wgtp-theme-custom .wgtp-toggle {
    background: var(--wgtp-bg, #1d2327);
    color: var(--wgtp-text, #fff);
    border-radius: var(--wgtp-radius, 30px);
}
.wgtp-theme-custom .wgtp-toggle:hover {
    background: var(--wgtp-hover, #2271b1);
}

/* ── RTL support ─────────────────────────────────────────────────────────── */
.wgtp-rtl .wgtp-menu-wrap { right: auto; left: 0; }
.wgtp-rtl .wgtp-menu li a { flex-direction: row-reverse; }
