/* Update-/Versions-Pill + Sicherheits-Badge – gemeinsam nutzbar.
   Auf Seiten ohne style.css (z.B. chat.html) eingebunden. Nutzt Theme-Variablen
   aus theme.css; fuer evtl. fehlende Vars sind Fallbacks gesetzt. */

/* ── Sicherheits-Badge (Schild) ───────────────────────────────────── */
.security-badge { width:24px;height:24px;border-radius:50%;display:flex;align-items:center;justify-content:center;
    background:rgba(239,68,68,0.10);color:#ef4444;border:1px solid rgba(239,68,68,0.2);cursor:pointer;transition:all .3s;flex-shrink:0; }
.security-badge.warning { background:rgba(245,158,11,0.10);color:#f59e0b;border-color:rgba(245,158,11,0.2); }
.security-badge.secure  { background:rgba(16,185,129,0.10);color:#10b981;border-color:rgba(16,185,129,0.2); }
.security-badge:hover { transform:scale(1.1);filter:brightness(1.2); }

/* ── Versions-/Update-Pill ────────────────────────────────────────── */
.update-widget-wrap { position:relative;display:flex;align-items:center; }
.header-version-pill { font-size:0.7rem;font-weight:500;padding:0.2rem 0.55rem;border-radius:999px;
    background:rgba(var(--accent-rgb),0.06);color:var(--text-muted,#94a3b8);border:1px solid var(--border,rgba(255,255,255,.12));
    cursor:default;user-select:none; }
.upd-pill-clickable { cursor:pointer;display:inline-flex;align-items:center;gap:4px;transition:background .15s,border-color .15s,color .15s; }
.upd-pill-clickable:hover { background:rgba(var(--accent-rgb),0.15);border-color:rgba(var(--accent-rgb),0.5);color:var(--accent,#6366f1); }
/* Ampel-Logik: gruen = System aktuell, rot = Updates stehen bereit */
.upd-pill-clickable.up-to-date { background:rgba(46,204,113,0.10);border-color:rgba(46,204,113,0.4);color:#2ecc71; }
.upd-pill-clickable.has-update { background:rgba(239,68,68,0.10);border-color:rgba(239,68,68,0.4);color:#ef4444; }
.upd-pill-ver { font-family:monospace;letter-spacing:0.02em; }
.update-badge { font-size:0.55rem;color:#f39c12;animation:upd-pulse 2s infinite;line-height:1; }
.update-badge.has-update { color:#ef4444; }
@keyframes upd-pulse { 0%,100%{opacity:1;} 50%{opacity:0.35;} }

/* ── Dropdown ─────────────────────────────────────────────────────── */
/* Der Aufbau ist Flex-SPALTE mit fester Kopf- und Fusszeile: nur die Mitte
   (Commit-Liste) scrollt. Vorher lagen Knopf und Auto-Update-Zeile HINTER der
   Liste im selben Scrollbereich – bei mehreren Commits war der Knopf
   ausserhalb des Sichtfensters, also unerreichbar, ohne dass etwas darauf
   hinwies (gemeldet 2026-08-23, "der Button im Popup wieder abgeschnitten").
   Die Hoehe haengt am SICHTFENSTER, nicht an einer festen Zahl: 440 px passten
   auf einem kleinen Fenster ebenfalls nicht. */
.update-dropdown { position:absolute;top:calc(100% + 10px);left:0;right:auto;width:360px;max-width:90vw;
    background:var(--bg-secondary,#111827);border:1px solid var(--border,rgba(255,255,255,.12));border-radius:var(--radius,12px);
    box-shadow:0 8px 32px rgba(0,0,0,0.6);z-index:9999;overflow:hidden;
    display:flex;flex-direction:column;max-height:calc(100vh - 84px); }
.update-dropdown.hidden { display:none; }
.update-dropdown-header { display:flex;align-items:center;justify-content:space-between;padding:10px 14px;
    border-bottom:1px solid var(--border,rgba(255,255,255,.12));font-size:0.85rem;font-weight:600;color:var(--text-primary,#f8fafc); }
.update-close-btn { background:none;border:none;color:var(--text-secondary,#94a3b8);cursor:pointer;font-size:0.85rem;padding:2px 5px;border-radius:4px;transition:background .15s; }
.update-close-btn:hover { background:rgba(127,127,127,0.15); }
/* `min-height:0` ist Pflicht: ein Flex-Kind schrumpft sonst nicht unter seine
   Inhaltshoehe, `overflow-y` bleibt wirkungslos und die Fusszeile wird aus dem
   Popup gedrueckt. */
.update-dropdown-body { padding:12px 14px;display:flex;flex-direction:column;gap:10px;
    flex:1 1 auto;min-height:0;overflow-y:auto; }
/* Fusszeile: Aktion und Einstellung, immer sichtbar. */
.update-dropdown-foot { flex:0 0 auto;padding:10px 14px;display:flex;flex-direction:column;gap:8px;
    border-top:1px solid var(--border,rgba(255,255,255,.12));background:var(--bg-secondary,#111827); }
.update-dropdown-foot:empty { display:none; }
.update-dropdown-foot .upd-auto-row { border-top:none;padding:0; }

.upd-status-row { display:flex;align-items:center;gap:8px;font-size:0.82rem; }
.upd-dot { width:8px;height:8px;border-radius:50%;flex-shrink:0; }
.upd-dot.ok{background:#2ecc71;} .upd-dot.pending{background:#f39c12;} .upd-dot.error{background:#e74c3c;}
.upd-commit-list { display:flex;flex-direction:column;gap:4px;background:rgba(127,127,127,0.08);border-radius:6px;padding:8px 10px; }
.upd-commit { display:flex;gap:8px;align-items:flex-start;font-size:0.77rem; }
.upd-commit-hash { font-family:monospace;color:var(--accent,#6366f1);flex-shrink:0; }
.upd-commit-msg { color:var(--text-primary,#f8fafc); }
.upd-commit-date { color:var(--text-secondary,#94a3b8);font-size:0.71rem;flex-shrink:0; }
.upd-auto-row { display:flex;align-items:center;justify-content:space-between;padding:6px 0;border-top:1px solid var(--border,rgba(255,255,255,.12)); }
.upd-auto-label { font-size:0.8rem;color:var(--text-secondary,#94a3b8); }
.upd-schedule-select { background:var(--bg-secondary,#111827);border:1px solid var(--border,rgba(255,255,255,.15));border-radius:6px;
    color:var(--text-primary,#f8fafc);font-size:0.78rem;padding:4px 8px;cursor:pointer;outline:none;font-family:inherit; }
.upd-schedule-select option { background:var(--bg-secondary,#111827);color:var(--text-primary,#f8fafc); }
.upd-schedule-select:focus { border-color:var(--accent,#6366f1); }

/* Buttons/Hinweise im Dropdown (Fallback-Styles fuer Seiten ohne style.css) */
.update-dropdown .kb-btn-action { width:100%;background:var(--accent,#6366f1);color:#fff;border:none;border-radius:8px;padding:8px 12px;cursor:pointer;font-size:0.85rem;font-family:inherit; }
.update-dropdown .kb-btn-action:hover { background:var(--accent-hover,#818cf8); }
.update-dropdown .kb-btn-secondary { width:100%;background:transparent;color:var(--text-secondary,#94a3b8);border:1px solid var(--border,rgba(255,255,255,.2));border-radius:8px;padding:7px 12px;cursor:pointer;font-family:inherit; }
.update-dropdown .kb-hint { font-size:0.8rem;color:var(--text-secondary,#94a3b8); }
