/* Theme/language switcher, replicated 1:1 from adminforge.de's own
   bottom-right widget (.bottom-widget / .lang-dropdown there). The pill
   itself deliberately stays dark even in light mode, exactly like the
   original; only the dropdown gets light-mode styling. */

.af-switcher {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 200;
    display: flex;
    align-items: center;
    background: #232828;
    border: 1px solid #2e3636;
    border-radius: 100px;
    padding: 4px;
    gap: 2px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.af-widget-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: none;
    border-radius: 100px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8c9b9d;
    transition: background 0.25s ease, color 0.25s ease;
    padding: 0;
}
.af-widget-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.af-widget-btn:focus-visible {
    outline: 2px solid #e67e22;
    outline-offset: 2px;
}
.af-widget-btn svg {
    width: 16px;
    height: 16px;
}

.af-divider {
    width: 1px;
    height: 20px;
    background: #2e3636;
    margin: 0 2px;
    flex-shrink: 0;
}

.af-lang {
    position: relative;
}
.af-lang-btn {
    font-size: 17px;
    line-height: 1;
}

.af-lang-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: #232828;
    border: 1px solid #2e3636;
    border-radius: 10px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 90px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 300;
    opacity: 0;
    transform: translateY(6px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.15s, transform 0.15s;
}
.af-lang-dropdown.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.af-lang-opt {
    background: none;
    border: none;
    color: #8c9b9d;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.12s, color 0.12s;
    width: 100%;
}
.af-lang-opt:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.af-lang-opt:focus-visible {
    outline: 2px solid #e67e22;
    outline-offset: 2px;
}
.af-lang-opt.active {
    color: #fff;
    font-weight: 600;
}

/* Light-mode dropdown, same as the original site. Covers both the explicit
   light choice (data-theme="light") and auto-light (no data-theme attribute,
   OS prefers light). */
[data-theme="light"] .af-lang-dropdown {
    background: #f5f7f5;
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
[data-theme="light"] .af-lang-opt { color: #555; }
[data-theme="light"] .af-lang-opt.active { color: #222; font-weight: 600; }
[data-theme="light"] .af-lang-opt:hover { background: rgba(0, 0, 0, 0.06); color: #222; }

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .af-lang-dropdown {
        background: #f5f7f5;
        border-color: rgba(0, 0, 0, 0.12);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }
    :root:not([data-theme="dark"]) .af-lang-opt { color: #555; }
    :root:not([data-theme="dark"]) .af-lang-opt.active { color: #222; font-weight: 600; }
    :root:not([data-theme="dark"]) .af-lang-opt:hover { background: rgba(0, 0, 0, 0.06); color: #222; }
}

@media (prefers-reduced-motion: reduce) {
    .af-widget-btn,
    .af-lang-dropdown,
    .af-lang-opt {
        transition: none;
    }
}

@media (max-width: 480px) {
    .af-switcher {
        bottom: 1rem;
        right: 1rem;
    }
}
