/* Shared across login.html, index.html, admin.html (same precedent as
   ui-dialogs.css). Fixed-position, independent of each page's own header
   -- login.html has no header at all, so this guarantees pixel-identical
   placement on all 3 pages instead of two different layout code paths.
   Only uses CSS variables confirmed present with the SAME name in
   index.css, admin.css, AND login.css (--bg, --ink, --accent,
   --accent-ink) -- other variables (--panel/--card, --rule/--card-border)
   differ in name between login.css and the other two, so are avoided
   here. */

.lang-switcher {
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: 100;
    font-family: 'Manrope', -apple-system, "Segoe UI", sans-serif;
}

.lang-switcher-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.3rem;
    border-radius: 999px;
    border: 1.5px solid rgba(215, 255, 31, 0.4);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    backdrop-filter: blur(6px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.lang-switcher-btn:hover,
.lang-switcher-btn[aria-expanded="true"] {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--bg) 70%, transparent);
}

.lang-switcher-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.lang-switcher-current {
    pointer-events: none;
}

.lang-switcher-menu {
    position: absolute;
    /* Opens UPWARD, not downward -- the button now sits at the bottom of
       the viewport, so a menu opening below it would run off-screen. */
    bottom: calc(100% + 0.5rem);
    left: 0;
    min-width: 11rem;
    margin: 0;
    padding: 0.4rem;
    list-style: none;
    border-radius: 1rem;
    border: 1px solid rgba(215, 255, 31, 0.25);
    background: var(--bg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.lang-switcher-menu[hidden] {
    display: none;
}

.lang-switcher-menu li {
    padding: 0.65rem 0.85rem;
    border-radius: 0.65rem;
    font-size: 1rem;
    color: var(--ink);
    cursor: pointer;
    transition: background 0.12s ease;
}

.lang-switcher-menu li:hover {
    background: rgba(215, 255, 31, 0.12);
}

.lang-switcher-menu li[aria-selected="true"] {
    color: var(--accent-ink);
    background: var(--accent);
    font-weight: 700;
}

@media (max-width: 900px) {
    .lang-switcher {
        bottom: 0.85rem;
        left: 0.85rem;
    }
    .lang-switcher-btn {
        padding: 0.6rem 1rem;
        font-size: 0.92rem;
    }
}
