/* ═══════════════════════════════════════════════════════════
   mangold-it.de — Global Design System v2
   Dark Luxury / Glassmorphism
   ═══════════════════════════════════════════════════════════ */

/* ─ Design Tokens — Dark (default) ────────────────────────── */
:root {
    /* Backgrounds */
    --bg-primary:    #08080f;
    --bg-card:       rgba(255,255,255,0.04);
    --bg-card-hover: rgba(255,255,255,0.07);
    --bg-secondary:  rgba(255,255,255,0.03);
    --bg-hover:      rgba(255,255,255,0.06);

    /* Text */
    --text-primary:  #ececec;
    --text-secondary:rgba(236,236,236,0.5);
    --text-tertiary: rgba(236,236,236,0.22);

    /* Borders */
    --border:        rgba(255,255,255,0.08);
    --border-strong: rgba(255,255,255,0.16);
    --border-bright: rgba(255,255,255,0.12);

    /* Accent — overridden via JS from localStorage */
    --accent:        #3ecf8e;
    --accent-dim:    rgba(62,207,142,0.15);
    --accent2:       #5b8ef5;

    /* Semantic */
    --success:       #3ecf8e;
    --error:         #f87171;
    --warning:       #fbbf24;
    --advisory:      #fbbf24;
    --incident:      #f87171;
    --healthy:       #3ecf8e;

    /* Status backgrounds */
    --incident-bg:     rgba(248,113,113,0.08);
    --incident-border: rgba(248,113,113,0.2);
    --advisory-bg:     rgba(251,191,36,0.08);
    --advisory-border: rgba(251,191,36,0.2);
    --healthy-bg:      rgba(62,207,142,0.06);
    --healthy-border:  rgba(62,207,142,0.2);

    /* Glass */
    --blur: 24px;
    --glass-bg:     rgba(255,255,255,0.055);
    --glass-border: rgba(255,255,255,0.11);
    --glass-shadow: 0 2px 1px rgba(255,255,255,0.04) inset,
                    0 8px 32px rgba(0,0,0,0.55),
                    0 1px 0 rgba(255,255,255,0.07) inset;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;

    /* Shape */
    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 14px;

    /* Layout */
    --container: 800px;
    --gap: 1rem;
}

/* ─ Design Tokens — Light ──────────────────────────────────── */
[data-theme="light"] {
    --bg-primary:    #f4f4f2;
    --bg-card:       rgba(255,255,255,0.85);
    --bg-card-hover: rgba(255,255,255,0.95);
    --bg-secondary:  rgba(0,0,0,0.03);
    --bg-hover:      rgba(0,0,0,0.05);
    --text-primary:  #0f0f0f;
    --text-secondary:rgba(15,15,15,0.5);
    --text-tertiary: rgba(15,15,15,0.25);
    --border:        rgba(0,0,0,0.08);
    --border-strong: rgba(0,0,0,0.15);
    --border-bright: rgba(0,0,0,0.10);
    --accent-dim:    rgba(62,207,142,0.12);
    --glass-bg: rgba(255,255,255,0.75);
    --glass-border: rgba(0,0,0,0.07);
    --glass-shadow: 0 4px 24px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.9);
}

/* ─ Reset ─────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ─ Base ──────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Ambient background gradients */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 50% at 15% 5%, rgba(62,207,142,0.06) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 85% 90%, rgba(91,142,245,0.05) 0%, transparent 55%);
    pointer-events: none;
    z-index: 0;
}
[data-theme="light"] body::before { opacity: 0.5; }

a { color: inherit; text-decoration: none; }

/* ─ Container ─────────────────────────────────────────────── */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.25rem;
    position: relative;
    z-index: 1;
}

/* ─ Glass Card ────────────────────────────────────────────── */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur)) saturate(160%);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--glass-shadow);
}

/* ─ Header (subpages) ─────────────────────────────────────── */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(8,8,15,0.75);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid var(--border);
    padding: 0 1.25rem;
    height: 52px;
    display: flex;
    align-items: center;
}
[data-theme="light"] header {
    background: rgba(244,244,242,0.85);
}

.header-inner {
    max-width: var(--container);
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* ─ Logo ──────────────────────────────────────────────────── */
.logo {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}
.logo .name   { color: var(--text-primary); }
.logo .domain { color: var(--text-tertiary); font-weight: 400; }

.logo-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
    flex-shrink: 0;
}

/* ─ Header Nav ────────────────────────────────────────────── */
.header-nav {
    display: flex;
    gap: 1.25rem;
    list-style: none;
    align-items: center;
}
.header-nav a {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.header-nav a svg { width: 13px; height: 13px; }
.header-nav a:hover,
.header-nav a.active { color: var(--text-primary); }

.header-right {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-left: auto;
}

/* ─ Buttons ───────────────────────────────────────────────── */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}
.icon-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
    background: var(--bg-hover);
}
.icon-btn svg { width: 14px; height: 14px; stroke-width: 1.75; }

.text-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.58rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    backdrop-filter: blur(8px);
}
.text-btn:hover { color: var(--text-primary); border-color: var(--border-strong); }
.text-btn svg { width: 11px; height: 11px; stroke-width: 1.75; flex-shrink: 0; }
.text-btn.danger:hover { color: var(--error); border-color: var(--error); }

.btn-accent {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #000;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}
.btn-accent:hover { opacity: 0.85; }

/* ─ Lucide ────────────────────────────────────────────────── */
svg.lucide {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    stroke-width: 1.75;
}

/* ─ Footer ────────────────────────────────────────────────── */
footer {
    border-top: 1px solid var(--border);
    padding: 0.875rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: auto;
    font-family: var(--font-mono);
    font-size: 0.58rem;
    color: var(--text-tertiary);
    letter-spacing: 0.06em;
    position: relative;
    z-index: 1;
}

.footer-inner {
    max-width: var(--container);
    margin: 0 auto;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.footer-actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* ─ Mobile Nav ────────────────────────────────────────────── */
.mobile-nav { display: none; }

@media (max-width: 600px) {
    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 200;
        background: rgba(8,8,15,0.85);
        backdrop-filter: blur(20px) saturate(160%);
        -webkit-backdrop-filter: blur(20px) saturate(160%);
        border-top: 1px solid var(--border);
        padding: 0.4rem 0 calc(0.4rem + env(safe-area-inset-bottom));
    }
    [data-theme="light"] .mobile-nav {
        background: rgba(244,244,242,0.9);
    }

    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.2rem;
        padding: 0.3rem 0;
        color: var(--text-tertiary);
        text-decoration: none;
        font-family: var(--font-mono);
        font-size: 0.5rem;
        font-weight: 500;
        letter-spacing: 0.07em;
        text-transform: uppercase;
        transition: color 0.15s;
    }
    .mobile-nav-item.active,
    .mobile-nav-item:hover { color: var(--accent); }

    .mobile-nav-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 20px;
        height: 20px;
    }
    .mobile-nav-icon svg.lucide { width: 17px; height: 17px; stroke-width: 1.75; }
    .header-nav { display: none !important; }
}

/* ─ Settings Overlay ──────────────────────────────────────── */
.settings-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.settings-overlay.open { display: flex; }

.settings-panel {
    background: rgba(14,14,22,0.92);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    width: min(360px, 100%);
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
[data-theme="light"] .settings-panel {
    background: rgba(250,250,248,0.95);
}

.settings-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
}

.settings-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.02em;
}
.settings-title svg.lucide { width: 14px; height: 14px; color: var(--text-tertiary); }

.settings-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.15s;
}
.settings-close-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.settings-close-btn svg.lucide { width: 13px; height: 13px; }

.settings-body { padding: 1rem; display: flex; flex-direction: column; gap: 1.25rem; }
.settings-section { display: flex; flex-direction: column; gap: 0.5rem; }

.settings-label {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.color-presets { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, outline 0.1s;
    outline: 2px solid transparent;
    outline-offset: 2px;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.active { outline-color: var(--text-primary); }

.color-custom-wrap { display: flex; align-items: center; gap: 0.5rem; }
.color-custom-wrap input[type="color"] {
    width: 28px; height: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    cursor: pointer; padding: 2px;
}

.settings-input {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 0.45rem 0.65rem;
    transition: border-color 0.15s;
    outline: none;
}
.settings-input:focus { border-color: var(--accent); }
.settings-input::placeholder { color: var(--text-tertiary); }

.settings-row { display: flex; gap: 0.5rem; align-items: center; }

.settings-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #000;
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
    white-space: nowrap; flex-shrink: 0;
}
.settings-save-btn:hover { opacity: 0.85; }

.settings-status { font-size: 0.62rem; color: var(--accent); font-family: var(--font-mono); }
.settings-divider { height: 1px; background: var(--border); }

/* ─ Animations ────────────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--accent); }
    50%       { opacity: 0.6; box-shadow: 0 0 12px var(--accent); }
}

.animate-in { animation: fadeInUp 0.35s ease forwards; opacity: 0; }
.delay-1  { animation-delay: 0.05s; }
.delay-2  { animation-delay: 0.10s; }
.delay-3  { animation-delay: 0.15s; }
.delay-4  { animation-delay: 0.20s; }
.delay-5  { animation-delay: 0.25s; }
.delay-6  { animation-delay: 0.30s; }
.delay-7  { animation-delay: 0.35s; }
.delay-8  { animation-delay: 0.40s; }
.delay-9  { animation-delay: 0.45s; }
.delay-10 { animation-delay: 0.50s; }

/* ─ Utility ───────────────────────────────────────────────── */
.mono { font-family: var(--font-mono); }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
