/* Generic Multilang language switcher */
.ml-language-switcher {
    --ml-sw-bg: #fff;
    --ml-sw-border: #e2e8f0;
    --ml-sw-text: #0f172a;
    --ml-sw-muted: #64748b;
    --ml-sw-hover: rgba(99, 102, 241, 0.08);
    --ml-sw-active: rgba(58, 27, 96, 0.08);
    --ml-sw-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.ml-language-switcher__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 42px;
    height: 36px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid var(--ml-sw-border);
    background: var(--ml-sw-bg);
    color: var(--ml-sw-text);
    font-size: 12px;
    font-weight: 700;
    cursor: default;
    font-family: inherit;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.ml-language-switcher__flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 0;
}

.ml-language-switcher__flag-img {
    display: block;
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.ml-language-switcher__btn .ml-language-switcher__flag-img {
    width: 18px;
    height: 13px;
}

.ml-language-switcher__current {
    line-height: 1;
}

.ml-language-switcher:hover .ml-language-switcher__btn,
.ml-language-switcher:focus-within .ml-language-switcher__btn {
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.18);
}

.ml-language-switcher__menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 176px;
    padding: 6px;
    margin: 8px 0 0;
    list-style: none;
    background: var(--ml-sw-bg);
    border: 1px solid var(--ml-sw-border);
    border-radius: 12px;
    box-shadow: var(--ml-sw-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    z-index: 1200;
    pointer-events: none;
}

.ml-language-switcher__menu::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 10px;
}

.ml-language-switcher:hover .ml-language-switcher__menu,
.ml-language-switcher:focus-within .ml-language-switcher__menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.ml-language-switcher__menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--ml-sw-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.ml-language-switcher__menu .ml-language-switcher__flag-img {
    width: 22px;
    height: 16px;
}

.ml-language-switcher__label {
    flex: 1;
}

.ml-language-switcher__menu a:hover {
    background: var(--ml-sw-hover);
}

.ml-language-switcher__menu a.is-active {
    background: var(--ml-sw-active);
}

/* Backward-compatible: Doruk sites may still target .doruk-lang-switch */
.doruk-lang-switch { position: relative; display: inline-flex; flex-shrink: 0; }
.doruk-lang-switch__btn,
.doruk-lang-switch__menu,
.doruk-lang-switch__flag-img,
.doruk-lang-switch__current,
.doruk-lang-switch__label {
    /* inherit via shared selectors in JS; keep minimal alias */
}

/* Visual editor (TranslatePress-style) */
.ml-ve-editable {
    outline: 1px dashed rgba(99, 102, 241, 0.55);
    outline-offset: 2px;
    cursor: pointer;
    transition: outline-color 0.15s ease, background 0.15s ease;
}
.ml-ve-editable:hover,
.ml-ve-editable.is-active {
    outline-color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
}
.ml-ve-root {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 99999;
    width: min(360px, calc(100vw - 24px));
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
.ml-ve-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #0f172a;
    color: #f8fafc;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.28);
    font-size: 12px;
}
.ml-ve-bar strong { font-size: 13px; }
.ml-ve-bar span { opacity: 0.8; flex: 1; }
.ml-ve-close {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    padding: 2px 6px;
}
.ml-ve-panel {
    margin-top: 8px;
    padding: 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}
.ml-ve-panel label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    margin: 0 0 6px;
}
.ml-ve-panel textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
    margin-bottom: 10px;
    resize: vertical;
}
.ml-ve-actions { display: flex; gap: 8px; }
.ml-ve-save,
.ml-ve-cancel {
    border: 0;
    border-radius: 8px;
    padding: 8px 12px;
    font-weight: 700;
    cursor: pointer;
}
.ml-ve-save { background: #4f46e5; color: #fff; }
.ml-ve-cancel { background: #e2e8f0; color: #0f172a; }
.ml-ve-status { margin-top: 8px; font-size: 12px; color: #64748b; }

/* Admin panel — language chip toggles */
.ml-admin-lang-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ml-admin-lang-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    opacity: 0.72;
}

.ml-admin-lang-chip:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.ml-admin-lang-chip.is-active,
.ml-admin-lang-chip:has(input:checked) {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
    color: #312e81;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.15);
    opacity: 1;
}

.ml-admin-lang-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ml-admin-lang-chip__flag {
    display: block;
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.ml-admin-lang-chip__label {
    line-height: 1.2;
}

