/* Smart MultiLang - Public Styles */

/* ── Reset & Base ─────────────────────────────────────────────── */
.sml-switcher {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
    display: inline-block;
    z-index: 99999;
    font-size: 14px;
    line-height: 1;
}

/* ── Float Mode ──────────────────────────────────────────────── */
.sml-switcher.sml-float {
    position: fixed;
    bottom: 24px;
}
.sml-switcher.sml-bottom-right { right: 24px; }
.sml-switcher.sml-bottom-left  { left: 24px; }

/* ── Current Button ──────────────────────────────────────────── */
.sml-current {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #fff;
    border: 1.5px solid #e0e0e0;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0,0,0,.12);
    transition: box-shadow .2s, border-color .2s;
    white-space: nowrap;
    color: #333;
    font-size: 14px;
    font-weight: 500;
}
.sml-current:hover,
.sml-current:focus {
    box-shadow: 0 4px 20px rgba(0,0,0,.18);
    border-color: #aaa;
    outline: none;
}
.sml-current:focus-visible {
    box-shadow: 0 0 0 3px rgba(66,133,244,.35);
}
.sml-flag { font-size: 20px; line-height: 1; }
.sml-label { font-size: 13px; }
.sml-arrow { font-size: 11px; opacity: .6; transition: transform .2s; }
.sml-switcher.sml-open .sml-arrow { transform: rotate(180deg); }

/* ── Dropdown ────────────────────────────────────────────────── */
.sml-dropdown {
    list-style: none;
    margin: 0;
    padding: 6px;
    background: #fff;
    border: 1.5px solid #e8e8e8;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,.14);
    display: none;
    position: absolute;
    min-width: 160px;
    overflow: hidden;
}

/* Float - dropdown opens upward */
.sml-float.sml-bottom-right .sml-dropdown,
.sml-float.sml-bottom-left  .sml-dropdown {
    bottom: calc(100% + 8px);
    top: auto;
}
.sml-float.sml-bottom-right .sml-dropdown { right: 0; }
.sml-float.sml-bottom-left  .sml-dropdown { left: 0; }

/* Inline - opens downward */
.sml-inline .sml-dropdown {
    top: calc(100% + 6px);
    left: 0;
}

.sml-switcher.sml-open .sml-dropdown {
    display: block;
    animation: sml-slide-in .18s ease;
}

@keyframes sml-slide-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sml-dropdown li { margin: 0; padding: 0; }

.sml-lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    text-decoration: none;
    color: #333;
    border-radius: 8px;
    transition: background .15s;
    cursor: pointer;
}
.sml-lang-option:hover { background: #f5f5f5; text-decoration: none; color: #333; }
.sml-lang-option.sml-active {
    background: #f0f7ff;
    color: #1967d2;
    font-weight: 600;
}
.sml-lang-option .sml-flag  { font-size: 18px; }
.sml-lang-option .sml-native { font-size: 13px; }

/* ── Header Switcher ─────────────────────────────────────────── */
.sml-header-switcher {
    display: flex;
    align-items: center;
}
.sml-header-switcher .sml-current {
    box-shadow: none;
    border-color: rgba(255,255,255,.3);
    background: rgba(255,255,255,.15);
    color: inherit;
}

/* ── Dark Mode ──────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    .sml-current {
        background: #2a2a2a;
        border-color: #444;
        color: #eee;
        box-shadow: 0 2px 12px rgba(0,0,0,.4);
    }
    .sml-dropdown {
        background: #2a2a2a;
        border-color: #444;
        box-shadow: 0 8px 32px rgba(0,0,0,.4);
    }
    .sml-lang-option { color: #ddd; }
    .sml-lang-option:hover { background: #363636; color: #fff; }
    .sml-lang-option.sml-active { background: #1a3a5c; color: #7db8f7; }
}

/* ── RTL Support ─────────────────────────────────────────────── */
[dir="rtl"] .sml-float.sml-bottom-right { right: auto; left: 24px; }
[dir="rtl"] .sml-float.sml-bottom-left  { left: auto; right: 24px; }

/* ── Accessibility ───────────────────────────────────────────── */
.sml-switcher *:focus { outline: 2px solid #4285f4; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    .sml-switcher.sml-open .sml-dropdown { animation: none; }
    .sml-arrow { transition: none; }
}

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .sml-float.sml-bottom-right,
    .sml-float.sml-bottom-left {
        bottom: 16px;
        right: 16px;
        left: auto;
    }
    .sml-current {
        padding: 10px 12px;
    }
    .sml-label { display: none; }
}

/* ── Inline in nav menus ─────────────────────────────────────── */
.sml-menu-item { list-style: none; }
.sml-menu-item .sml-current {
    box-shadow: none;
    border: 1px solid transparent;
    background: transparent;
    color: inherit;
    padding: 6px 10px;
}
