/*
 * Flow AI Hub - gemeinsames Design-System.
 * Alle Module teilen sich denselben Akzent (Cyan/Lila) statt individueller
 * Modul-Farben, damit die Seiten wie aus einem Guss wirken. Bewusst knappe
 * Radien und eine neutrale, technische Schrift - kein "Bubble/SaaS"-Look,
 * das Ganze soll nach ernsthaftem Tooling aussehen.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
    --bg: #010204;
    --card-bg: rgba(255, 255, 255, 0.015);
    --card-bg-hover: rgba(255, 255, 255, 0.035);
    --border: rgba(255, 255, 255, 0.06);
    --text: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.55);
    --meta-bg: rgba(255, 255, 255, 0.04);
    --danger: #f43f5e;
    --success: #22c55e;
    --accent: #00f2ff;
    --purple: #a855f7;
    --radius: 8px;
    --radius-sm: 5px;
    --content-width: 1100px;
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

.container { max-width: var(--content-width); margin: 0 auto; }

/* Generischer Hell-Modus (Fallback fuer Seiten ohne eigenen [data-theme] Block).
   Seiten mit eigenem Block (z.B. Hub-Startseite) ueberschreiben das gezielt,
   da ihr <style> nach dieser Datei geladen wird. */
:root[data-theme="light"] {
    --bg: #f8f9fa;
    --card-bg: rgba(0, 0, 0, 0.03);
    --card-bg-hover: rgba(0, 0, 0, 0.05);
    --border: rgba(0, 0, 0, 0.1);
    --text: #1a1a1a;
    --text-muted: rgba(0, 0, 0, 0.55);
    --meta-bg: rgba(0, 0, 0, 0.05);
    --accent: #0d6efd;
    --purple: #8432b0;
}

* { box-sizing: border-box; }

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    margin: 0;
    transition: background 0.3s, color 0.3s;
}

.theme-switch {
    position: fixed; top: 20px; right: 20px; z-index: 100;
    background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
    padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer;
    color: var(--text-muted); font-family: var(--font-mono); font-size: 0.7rem;
    letter-spacing: 0.05em; text-transform: uppercase;
    transition: color 0.2s, border-color 0.2s;
}
.theme-switch:hover { color: var(--text); border-color: var(--accent); }

code, pre, .mono, .stat, .job-id, .timestamp {
    font-family: var(--font-mono);
}

/* --- Atmender Ambient-Hintergrund ---
   Drei weiche, langsam wandernde Glow-Flecken in Modul-Akzentfarbe/Lila,
   unterschiedlich gross/schnell fuer Tiefe. Bewusst sehr langsam (14-24s)
   und dezent (max. 0.16 Deckkraft), lebt im Hintergrund ohne abzulenken. */
#ambient-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
    background: var(--bg);
}
#ambient-bg::before,
#ambient-bg::after {
    content: '';
    position: absolute;
    width: 55vmax;
    height: 55vmax;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    opacity: 0.13;
    filter: blur(70px);
    animation: ambient-breathe 18s ease-in-out infinite;
}
#ambient-bg::before {
    top: -18vmax;
    left: -12vmax;
    animation-delay: 0s;
}
#ambient-bg::after {
    bottom: -22vmax;
    right: -14vmax;
    width: 45vmax;
    height: 45vmax;
    background: radial-gradient(circle, var(--purple, #a855f7) 0%, transparent 70%);
    opacity: 0.09;
    animation-duration: 24s;
    animation-delay: -9s;
}
.ambient-blob-3 {
    content: '';
    position: absolute;
    top: 40%;
    left: 60%;
    width: 30vmax;
    height: 30vmax;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    opacity: 0.06;
    filter: blur(70px);
    animation: ambient-breathe 14s ease-in-out infinite;
    animation-delay: -4s;
}
@keyframes ambient-breathe {
    0%, 100% { transform: scale(1) translate(0, 0); opacity: 0.09; }
    50%      { transform: scale(1.2) translate(3%, 2%); opacity: 0.16; }
}
@media (prefers-reduced-motion: reduce) {
    #ambient-bg::before, #ambient-bg::after, .ambient-blob-3 { animation: none; }
}

/* --- Gemeinsame Bausteine --- */
.card, .panel, .service-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: border-color 0.2s, background 0.2s;
}
.card:hover, .panel:hover, .service-card:hover {
    border-color: rgba(255, 255, 255, 0.16);
}

/* Technische Ecken-Markierung (HUD-artig) statt runder Ecken ueberall -
   .card-tech auf eine Karte setzen fuer den betonten Look. */
.card-tech { position: relative; border-radius: var(--radius-sm); }
.card-tech::before, .card-tech::after {
    content: ''; position: absolute; width: 10px; height: 10px;
    border: 1.5px solid var(--accent); opacity: 0.7;
}
.card-tech::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.card-tech::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.btn, button, input[type="submit"] {
    background: var(--accent);
    color: #010204;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: filter 0.15s, transform 0.1s;
}
.btn:hover, button:hover, input[type="submit"]:hover { filter: brightness(1.12); }
.btn:active, button:active, input[type="submit"]:active { transform: scale(0.98); }
.btn.danger, button.danger { background: var(--danger); color: #fff; }
.btn.ghost, button.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }

/* Mehrere Module haengen noch an Bootstraps eigenen Button-Klassen - auf
   unsere Tokens ummappen, sonst blitzt Bootstraps Blau/Grau/Cyan durch und
   jede Seite hat wieder andere Buttonfarben. */
.btn-primary, .btn-info {
    background-color: var(--accent) !important; border-color: var(--accent) !important;
    color: #010204 !important;
}
.btn-primary:hover, .btn-info:hover { filter: brightness(1.12); }
.btn-outline-info {
    color: var(--accent) !important; border-color: var(--accent) !important; background: transparent !important;
}
.btn-outline-info:hover { background: var(--accent) !important; color: #010204 !important; }
.btn-outline-secondary, .btn-outline-light {
    color: var(--text) !important; border-color: var(--border) !important; background: transparent !important;
}
.btn-outline-secondary:hover, .btn-outline-light:hover { background: rgba(255,255,255,0.08) !important; color: var(--text) !important; }
.btn-danger { background-color: var(--danger) !important; border-color: var(--danger) !important; color: #fff !important; }
.btn-success { background-color: var(--success) !important; border-color: var(--success) !important; color: #04140c !important; }
.btn.rounded-pill, a.rounded-pill { border-radius: var(--radius-sm) !important; }

input[type="text"], input[type="password"], input[type="number"], input[type="file"],
select, textarea {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    font-family: inherit;
    font-size: 0.9rem;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

a { color: var(--accent); }

.badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--meta-bg);
    border: 1px solid var(--border);
    text-transform: uppercase;
}

/* Kleiner pulsierender Status-Punkt - fuer "live"/aktive Zustaende */
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent); animation: status-pulse 2s infinite; }
@keyframes status-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Rundes Fortschritts-/Statuselement (statt Balken) - Kreis, der sich fuellt.
   Nutzung: <div class="ring" style="--pct: 62"><span>62%</span></div> */
.ring {
    --pct: 0;
    width: 56px; height: 56px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700;
    background: conic-gradient(var(--accent) calc(var(--pct) * 1%), rgba(255,255,255,0.08) 0);
    position: relative;
}
.ring::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--bg); }
.ring span { position: relative; z-index: 1; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-sm); }
