/* Simply Translator — Public / Frontend Styles
   Author: MXMEDIA
   ============================================= */

:root {
    --st-pub-primary:    #4f46e5;
    --st-pub-radius:     10px;
    --st-pub-shadow:     0 4px 24px rgba(0,0,0,.12), 0 1px 4px rgba(0,0,0,.06);
    --st-pub-border:     rgba(0,0,0,.09);
    --st-pub-bg:         #ffffff;
    --st-pub-text:       #1e293b;
    --st-pub-text2:      #64748b;
    --st-pub-transition: all .2s cubic-bezier(.4,0,.2,1);
}

/* ─── Switcher ───────────────────────────────────── */
.st-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.st-switcher__current {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: var(--st-pub-bg);
    border: 1px solid var(--st-pub-border);
    border-radius: var(--st-pub-radius);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--st-pub-text);
    transition: var(--st-pub-transition);
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.st-switcher__current:hover {
    border-color: var(--st-pub-primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}

.st-switcher__arrow {
    display: flex;
    align-items: center;
    color: var(--st-pub-text2);
    transition: transform .2s ease;
}
.st-switcher__arrow svg { width: 14px; height: 14px; }
.st-switcher--open .st-switcher__arrow { transform: rotate(180deg); }

/* ─── Dropdown ───────────────────────────────────── */
.st-switcher__dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 160px;
    background: var(--st-pub-bg);
    border: 1px solid var(--st-pub-border);
    border-radius: var(--st-pub-radius);
    box-shadow: var(--st-pub-shadow);
    list-style: none;
    margin: 0;
    padding: 6px;
    z-index: 99990;
    display: none;
    animation: st-dropdown-in .18s ease;
}

.st-switcher--open .st-switcher__dropdown { display: block; }

@keyframes st-dropdown-in {
    from { opacity: 0; transform: translateY(-6px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.st-switcher__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 13px;
    color: var(--st-pub-text);
    transition: var(--st-pub-transition);
}
.st-switcher__option:hover { background: #f1f5f9; }
.st-switcher__option.st-active { background: #eef2ff; color: var(--st-pub-primary); font-weight: 600; }

.st-switcher__check { display: flex; align-items: center; color: var(--st-pub-primary); flex-shrink: 0; }
.st-switcher__check svg { width: 14px; height: 14px; }

/* ─── Lang Label ─────────────────────────────────── */
.st-lang-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.st-flag { font-size: 16px; line-height: 1; }
.st-flag-img { width: 20px; height: 14px; object-fit: cover; border-radius: 2px; }
.st-lang-name { font-size: 13px; }
.st-lang-code { font-size: 12px; font-weight: 700; letter-spacing: .04em; }

/* ─── Fixed Switcher ─────────────────────────────── */
.st-fixed-switcher {
    position: fixed;
    z-index: 99980;
}
.st-fixed-bottom-right { bottom: 24px; right: 24px; }
.st-fixed-bottom-left  { bottom: 24px; left: 24px; }
.st-fixed-top-right    { top: 24px; right: 24px; }
.st-fixed-top-left     { top: 24px; left: 24px; }

/* Flip dropdown upward when near bottom */
.st-fixed-bottom-right .st-switcher__dropdown,
.st-fixed-bottom-left  .st-switcher__dropdown {
    top: auto;
    bottom: calc(100% + 6px);
}
.st-fixed-bottom-left  .st-switcher__dropdown,
.st-fixed-top-left     .st-switcher__dropdown {
    left: auto;
    right: 0;
}

.st-fixed-switcher .st-switcher__current {
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
    padding: 9px 14px;
    font-size: 14px;
    background: var(--st-pub-primary);
    color: white;
    border-color: transparent;
}
.st-fixed-switcher .st-switcher__current:hover {
    background: #4338ca;
    box-shadow: 0 6px 20px rgba(79,70,229,.35);
}
.st-fixed-switcher .st-switcher__arrow { color: rgba(255,255,255,.75); }

/* ─── Menu Item ──────────────────────────────────── */
.st-menu-switcher {
    display: flex !important;
    align-items: center;
}

/* ─── Admin Bar ──────────────────────────────────── */
#wp-admin-bar-st-translate-page > a {
    cursor: pointer !important;
}

/* ─── RTL Support ────────────────────────────────── */
body.st-rtl { direction: rtl; }
body.st-rtl .st-switcher__dropdown { left: auto; right: 0; }

/* ─── Page Translator (front-end modal) ──────────── */
.st-page-translator-front {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ─── Admin bar translate button style ───────────── */
.st-adminbar-btn { }

/* ─── SVG Flag Images in Switcher ────────────────────── */
.st-flag-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    border-radius: 3px;
    vertical-align: middle;
    display: inline-block;
}

.st-flag-code {
    font-size: 11px;
    font-weight: 700;
    background: rgba(0,0,0,.08);
    padding: 1px 4px;
    border-radius: 3px;
}
