/* LinguaFlow — Switcher (Modern) */
:root {
    --lf-primary: #6366f1;
    --lf-primary-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
    --lf-surface: rgba(255, 255, 255, 0.95);
    --lf-border: rgba(226, 232, 240, 0.8);
    --lf-text: #0f172a;
    --lf-shadow-md: 0 8px 24px rgba(15, 23, 42, 0.1);
    --lf-shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.15);
}

.lf-switcher {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    direction: ltr;
}
.lf-switcher[data-position="bottom-right"] { bottom: 24px; right: 24px; }
.lf-switcher[data-position="bottom-left"]  { bottom: 24px; left: 24px; }
.lf-switcher[data-position="top-right"]    { top: 24px; right: 24px; }
.lf-switcher[data-position="top-left"]     { top: 24px; left: 24px; }

.lf-switcher-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px 12px 16px;
    background: var(--lf-surface);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--lf-border);
    border-radius: 999px;
    box-shadow: var(--lf-shadow-md);
    font-size: 14px;
    font-weight: 600;
    color: var(--lf-text);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}
.lf-switcher-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--lf-primary-gradient);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}
.lf-switcher-btn:hover { transform: translateY(-2px); box-shadow: var(--lf-shadow-lg); color: #fff; }
.lf-switcher-btn:hover::before { opacity: 1; }
.lf-switcher-btn:focus-visible { outline: 2px solid var(--lf-primary); outline-offset: 3px; }

.lf-switcher-globe { font-size: 18px; line-height: 1; transition: transform 0.4s; }
.lf-switcher-btn:hover .lf-switcher-globe { transform: rotate(-15deg) scale(1.1); }

.lf-switcher-arrow { font-size: 10px; opacity: 0.7; transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.lf-switcher.open .lf-switcher-arrow { transform: rotate(180deg); }

.lf-switcher-list {
    position: absolute;
    bottom: calc(100% + 12px);
    right: 0;
    min-width: 200px;
    padding: 8px;
    margin: 0;
    list-style: none;
    background: var(--lf-surface);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--lf-border);
    border-radius: 16px;
    box-shadow: var(--lf-shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.96);
    transform-origin: bottom right;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.lf-switcher[data-position^="top"] .lf-switcher-list {
    bottom: auto; top: calc(100% + 12px);
    transform: translateY(-8px) scale(0.96);
    transform-origin: top right;
}
.lf-switcher[data-position$="left"] .lf-switcher-list { right: auto; left: 0; transform-origin: bottom left; }
.lf-switcher[data-position="top-left"] .lf-switcher-list { transform-origin: top left; }
.lf-switcher.open .lf-switcher-list { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

.lf-switcher-list li { margin: 0; padding: 0; list-style: none; }
.lf-switcher-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--lf-text);
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}
.lf-switcher-list a:hover,
.lf-switcher-list a:focus-visible {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.08));
    color: var(--lf-primary);
    outline: none;
}
.lf-switcher-list li.active a {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.12));
    color: var(--lf-primary);
    font-weight: 600;
}
.lf-switcher-list li.active a::before {
    content: "";
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 60%;
    background: var(--lf-primary-gradient);
    border-radius: 0 3px 3px 0;
}
.lf-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px; height: 18px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Browser detection banner */
.lf-auto-notice {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 20px);
    z-index: 999999;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #fff;
    border-radius: 16px;
    box-shadow: var(--lf-shadow-lg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: calc(100vw - 48px);
}
.lf-auto-notice.is-visible { opacity: 1; transform: translate(-50%, 0); }
.lf-auto-notice-btn {
    background: var(--lf-primary-gradient);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.lf-auto-notice-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4); }
.lf-auto-notice-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s;
}
.lf-auto-notice-close:hover { color: #fff; }

@media (max-width: 640px) {
    .lf-switcher[data-position] { bottom: 16px; right: 16px; left: auto; top: auto; }
    .lf-switcher-list { min-width: 180px; }
    .lf-auto-notice { flex-wrap: wrap; padding: 12px 16px; }
    .lf-auto-notice > span { flex-basis: 100%; }
}