/* ==========================================================================
   KC26 – Zentrale Definition für Top-Bar Werkzeuge (Tools)
   Gültig für Hauptseite, Programmseite und Bildungsportal.
   Hier können Farben, Typografie, Abstände und Rundungen zentral angepasst werden.
   ========================================================================== */

:root {
    /* Zentrale Farb- und Design-Variablen für alle Top-Bar Tools */
    --top-bar-tool-bg: #1B2A3A;
    --top-bar-tool-border: rgba(223, 193, 123, 0.4);
    --top-bar-tool-color: #DFC17B;
    --top-bar-tool-hover-bg: #DFC17B;
    --top-bar-tool-hover-color: #121c27;
    --top-bar-tool-hover-border: #DFC17B;
    --top-bar-tool-active-bg: #1B2A3A;
    --top-bar-tool-active-border: rgba(223, 193, 123, 0.4);
    --top-bar-tool-active-color: #DFC17B;
    --top-bar-tool-inactive-color: #8A99A8;
    --top-bar-tool-inactive-border: rgba(255, 255, 255, 0.18);
    --top-bar-tool-font-size: 0.78rem;
    --top-bar-tool-font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --top-bar-tool-font-weight: 600;
    --top-bar-tool-radius: 20px;
    --top-bar-tool-padding: 4px 10px;
    --top-bar-tool-line-height: 1.2;
}

/* Container für Top-Bar Tools */
.top-bar-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: nowrap;
    white-space: nowrap;
}

/* Einheitliche Typografie & Optik für alle Top-Bar Tools (Buttons & Dropdowns) */
.top-bar-controls .ctrl-btn,
.top-bar-controls .lang-trigger,
.top-bar-controls .glossar-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: var(--top-bar-tool-bg) !important;
    border: 1px solid var(--top-bar-tool-border) !important;
    color: var(--top-bar-tool-color) !important;
    padding: var(--top-bar-tool-padding) !important;
    border-radius: var(--top-bar-tool-radius) !important;
    font-family: var(--top-bar-tool-font-family) !important;
    font-size: var(--top-bar-tool-font-size) !important;
    font-weight: var(--top-bar-tool-font-weight) !important;
    line-height: var(--top-bar-tool-line-height) !important;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    box-sizing: border-box;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Hover- & Fokus-Zustände */
.top-bar-controls .ctrl-btn:hover,
.top-bar-controls .ctrl-btn:focus-visible,
.top-bar-controls .lang-trigger:hover,
.top-bar-controls .lang-trigger:focus-visible,
.top-bar-controls .glossar-toggle-btn:hover,
.top-bar-controls .glossar-toggle-btn:focus-visible {
    background: var(--top-bar-tool-hover-bg) !important;
    color: var(--top-bar-tool-hover-color) !important;
    border-color: var(--top-bar-tool-hover-border) !important;
    outline: none;
}

/* Sprachwähler geöffnet */
.top-bar-controls .lang-trigger[aria-expanded="true"] {
    background: var(--top-bar-tool-hover-bg) !important;
    color: var(--top-bar-tool-hover-color) !important;
    border-color: var(--top-bar-tool-hover-border) !important;
}

/* Begriffshilfen Aktiv (Standard: AN) */
.top-bar-controls .glossar-toggle-btn.active {
    background: var(--top-bar-tool-active-bg) !important;
    color: var(--top-bar-tool-active-color) !important;
    border-color: var(--top-bar-tool-active-border) !important;
}

/* Begriffshilfen Inaktiv (AUS) */
.top-bar-controls .glossar-toggle-btn:not(.active) {
    background: var(--top-bar-tool-bg) !important;
    color: var(--top-bar-tool-inactive-color) !important;
    border-color: var(--top-bar-tool-inactive-border) !important;
}

.top-bar-controls .glossar-toggle-btn:not(.active):hover {
    background: var(--top-bar-tool-hover-bg) !important;
    color: var(--top-bar-tool-hover-color) !important;
    border-color: var(--top-bar-tool-hover-border) !important;
}

/* ==========================================================================
   Sprachauswahl-Dropdown (Zentrales Menü-Design)
   ========================================================================== */
.top-bar-controls .lang-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.top-bar-controls .lang-chevron {
    transition: transform 0.2s ease;
    flex-shrink: 0;
    opacity: 0.9;
}

.top-bar-controls .lang-trigger[aria-expanded="true"] .lang-chevron {
    transform: rotate(180deg);
}

.top-bar-controls .lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 170px;
    background: #121c27;
    border: 1px solid rgba(223, 193, 123, 0.35);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
    padding: 6px 0;
    list-style: none;
    margin: 0;
    z-index: 9999;
}

.top-bar-controls .lang-dropdown--open {
    display: block;
    animation: langDropIn 0.18s ease forwards;
}

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

.top-bar-controls .lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    color: #cbd5e1;
    font-family: var(--top-bar-tool-font-family);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.top-bar-controls .lang-option:hover,
.top-bar-controls .lang-option:focus-visible {
    background: rgba(223, 193, 123, 0.15);
    color: #DFC17B;
    outline: none;
}

.top-bar-controls .lang-option--active {
    color: #DFC17B;
    font-weight: 700;
    background: rgba(223, 193, 123, 0.12);
}

.top-bar-controls .lang-flag,
.top-bar-controls .lang-option-flag {
    display: none !important;
}

@media (max-width: 768px) {
    .top-bar-controls {
        gap: 6px;
    }
    .top-bar-controls .glossar-toggle-btn,
    .glossar-toggle-btn {
        display: none !important;
    }
}
