/* ============================================================
   TeamCaptain Help Center – Frontend Styles (Light/Dark)
   Farb-System basiert auf der TeamCaptain-App (theme.js)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
    /* TC Primary */
    --primary:       #3172ac;
    --primary-hover: #255a8a;
    --primary-soft:  rgba(49, 114, 172, 0.12);
    --primary-soft-strong: rgba(49, 114, 172, 0.22);

    /* Backgrounds & Text */
    --bg:          #F5F7FA;
    --bg-alt:      #FFFFFF;
    --bg-card:     #FFFFFF;
    --bg-elevated: #FFFFFF;
    --border:        #E2E6EA;
    --border-strong: #CCD3DA;

    --text:       #1A1D21;
    --text-soft:  #555B61;
    --text-muted: #7A8087;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);

    --radius-sm: 6px;
    --radius:    8px;
    --radius-lg: 12px;

    /* Status (aus theme.js notificationColors) */
    --success: #2E8B57;
    --warning: #D68A0D;
    --danger:  #D9534F;
    --info:    #3172ac;

    --header-h: 64px;
    --font: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

[data-theme="dark"] {
    --bg:          #131417;
    --bg-alt:      #1D1F24;
    --bg-card:     #1D1F24;
    --bg-elevated: #25282E;
    --border:        #2c2c2c;
    --border-strong: #3d3d3d;

    --text:       #e1e1e1;
    --text-soft:  #b8b8b8;
    --text-muted: #828282;

    --primary:       #3172ac;
    --primary-hover: #4084c0;
    --primary-soft:  rgba(49, 114, 172, 0.18);
    --primary-soft-strong: rgba(49, 114, 172, 0.3);

    --success: #226e39;
    --warning: #a96905;
    --danger:  #b64141;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.40);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.55);
}

@media (prefers-color-scheme: dark) {
    [data-theme="auto"] {
        --bg: #131417; --bg-alt: #1D1F24; --bg-card: #1D1F24; --bg-elevated: #25282E;
        --border: #2c2c2c; --border-strong: #3d3d3d;
        --text: #e1e1e1; --text-soft: #b8b8b8; --text-muted: #828282;
        --primary: #3172ac; --primary-hover: #4084c0;
        --primary-soft: rgba(49, 114, 172, 0.18);
        --primary-soft-strong: rgba(49, 114, 172, 0.3);
        --success: #226e39; --warning: #a96905; --danger: #b64141;
        --shadow-sm: 0 1px 2px rgba(0,0,0,.35);
        --shadow-md: 0 2px 8px rgba(0,0,0,.40);
        --shadow-lg: 0 8px 32px rgba(0,0,0,.55);
    }
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

img { max-width: 100%; height: auto; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 760px; }

.muted { color: var(--text-muted); }
.small { font-size: 13px; }

/* Header */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
    height: var(--header-h);
    display: flex; align-items: center;
}
.header-inner { display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand-name { font-size: 16px; }
.brand-logo { color: var(--primary); display: inline-flex; }

.site-nav { display: flex; gap: 18px; margin-left: 12px; }
.site-nav a { color: var(--text-soft); font-weight: 500; font-size: 14px; }
.site-nav a:hover { color: var(--text); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.header-search {
    position: relative; display: flex; align-items: center;
    background: var(--bg-alt); border: 1px solid var(--border);
    border-radius: 999px; padding: 0 6px 0 14px;
    transition: border-color .15s ease;
}
.header-search:focus-within { border-color: var(--primary); }
.header-search input {
    border: 0; background: transparent; outline: 0;
    height: 36px; min-width: 220px; color: var(--text); font: inherit;
}
.header-search input::placeholder { color: var(--text-muted); }
.header-search button {
    background: var(--primary); color: white; border: 0;
    width: 30px; height: 30px; border-radius: 999px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}

/* Language Switcher */
.lang-switch { position: relative; }
.lang-current {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--bg-alt); border: 1px solid var(--border);
    color: var(--text); padding: 6px 10px; border-radius: 8px;
    font: 600 13px var(--font); cursor: pointer;
}
.lang-current:hover { border-color: var(--border-strong); }
.lang-menu {
    position: absolute; right: 0; top: calc(100% + 6px);
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: var(--shadow-md);
    min-width: 180px; padding: 6px; display: none; z-index: 100;
}
.lang-menu.is-open { display: block; }
.lang-menu a {
    display: flex; gap: 8px; padding: 8px 10px; border-radius: 8px;
    color: var(--text); font-size: 14px;
}
.lang-menu a:hover { background: var(--bg-alt); }
.lang-menu a[aria-current="true"] { background: var(--primary-soft); color: var(--primary); }
.lang-menu .lang-code { font-weight: 700; width: 26px; color: var(--text-muted); }

/* Theme toggle */
.theme-toggle {
    background: var(--bg-alt); border: 1px solid var(--border);
    color: var(--text); width: 36px; height: 36px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.theme-toggle:hover { border-color: var(--border-strong); }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: inline; }
@media (prefers-color-scheme: dark) {
    [data-theme="auto"] .theme-toggle .icon-sun { display: none; }
    [data-theme="auto"] .theme-toggle .icon-moon { display: inline; }
}

/* Hero */
.hero {
    background:
        radial-gradient(circle at 20% 0%, var(--primary-soft) 0%, transparent 55%),
        radial-gradient(circle at 80% 0%, var(--primary-soft-strong) 0%, transparent 60%);
    padding: 72px 0 60px;
    text-align: center;
}
.hero-title { font-size: 40px; line-height: 1.15; margin: 0 0 12px; letter-spacing: -.02em; }
.hero-subtitle { color: var(--text-soft); font-size: 18px; margin: 0 0 32px; }
.hero-search {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: 999px; padding: 8px 8px 8px 18px;
    max-width: 600px; margin: 0 auto;
    box-shadow: var(--shadow-md);
}
.hero-search input {
    flex: 1; border: 0; background: transparent; outline: 0;
    color: var(--text); font-size: 16px; height: 40px;
}
.hero-search .search-icon { color: var(--text-muted); }
.hero-search button {
    background: var(--primary); color: white; border: 0;
    height: 40px; padding: 0 22px; border-radius: 999px;
    font-weight: 600; cursor: pointer;
}
.hero-search button:hover { background: var(--primary-hover); }

/* Sections */
.section-title { font-size: 22px; margin: 48px 0 20px; }

/* Category grid */
.category-grid {
    display: grid; gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.category-card {
    display: flex; gap: 14px; padding: 18px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.category-card:hover {
    transform: translateY(-2px); box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}
.category-icon {
    width: 44px; height: 44px; flex: 0 0 44px;
    border-radius: 12px; background: var(--primary-soft); color: var(--primary);
    display: inline-flex; align-items: center; justify-content: center; font-size: 22px;
}
.category-body { display: flex; flex-direction: column; gap: 4px; }
.category-body strong { font-size: 15px; }
.category-desc { color: var(--text-soft); font-size: 13px; }
.category-meta { color: var(--text-muted); font-size: 12px; margin-top: 4px; }

/* Popular list */
.popular-list {
    list-style: none; padding: 0; margin: 0;
    display: grid; gap: 8px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.popular-list a {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: 10px;
    color: var(--text); font-size: 14px;
}
.popular-list a:hover { border-color: var(--primary); color: var(--primary); }
.popular-icon { color: var(--success); display: inline-flex; }

/* CTA card */
.cta-card {
    display: flex; gap: 24px; align-items: center; justify-content: space-between;
    background: linear-gradient(135deg, #3172ac 0%, #1d72a0 60%, #255a8a 100%);
    color: white; padding: 28px; border-radius: var(--radius-lg);
    margin: 48px 0 64px;
    box-shadow: var(--shadow-md);
}
.cta-card h3 { margin: 0 0 4px; }
.cta-card p { margin: 0; opacity: .9; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
    font: 600 14px var(--font); cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); color: white; }
.btn-ghost { background: var(--bg-alt); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-elevated); border-color: var(--border-strong); }

/* Breadcrumb */
.breadcrumb { font-size: 13px; color: var(--text-muted); margin: 24px 0; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { margin: 0 8px; }

/* Page head */
.page-head h1 { font-size: 32px; margin: 0 0 8px; letter-spacing: -.01em; }
.page-lead { color: var(--text-soft); font-size: 17px; margin: 0 0 24px; }
.page-search {
    display: flex; gap: 8px; margin: 16px 0 20px;
    background: var(--bg-alt); border: 1px solid var(--border);
    border-radius: 12px; padding: 6px 6px 6px 14px; max-width: 600px;
}
.page-search input { flex: 1; border: 0; background: transparent; outline: 0; color: var(--text); height: 36px; font: inherit; }
.page-search button { background: var(--primary); color: white; border: 0; padding: 0 18px; border-radius: 8px; cursor: pointer; }

/* Article list */
.article-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.article-list a {
    display: flex; flex-direction: column; gap: 4px;
    padding: 16px 18px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius); color: var(--text);
    transition: border-color .15s ease;
}
.article-list a:hover { border-color: var(--primary); }
.article-link-title { font-weight: 600; font-size: 16px; }
.article-link-excerpt { color: var(--text-soft); font-size: 14px; }
.article-link-meta { color: var(--text-muted); font-size: 12px; margin-top: 4px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--bg-alt); color: var(--text-muted); border: 1px solid var(--border); }
.badge-featured { background: rgba(255, 215, 0, 0.18); color: #a07505; border-color: rgba(255, 215, 0, 0.4); }
[data-theme="dark"] .badge-featured { background: rgba(255, 215, 0, 0.12); color: #FFD700; border-color: rgba(255, 215, 0, 0.25); }

.empty-state { padding: 48px 24px; text-align: center; color: var(--text-muted); }

/* Article body */
.article-head h1 { font-size: 36px; margin: 0 0 10px; letter-spacing: -.01em; }
.article-lead { color: var(--text-soft); font-size: 18px; margin: 0 0 12px; }
.article-meta { color: var(--text-muted); font-size: 13px; }
.article-meta .dot { margin: 0 8px; }

.article-body { margin-top: 32px; }
.md-content { font-size: 16px; color: var(--text-soft); }
.md-content h2 { font-size: 24px; margin: 32px 0 12px; color: var(--text); letter-spacing: -.01em; }
.md-content h3 { font-size: 19px; margin: 24px 0 8px; color: var(--text); }
.md-content h4 { font-size: 16px; margin: 20px 0 6px; color: var(--text); }
.md-content p { margin: 0 0 14px; }
.md-content ul, .md-content ol { padding-left: 22px; margin: 0 0 16px; }
.md-content li { margin: 4px 0; }
.md-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.md-content code {
    background: var(--bg-alt); padding: 2px 6px; border-radius: 4px;
    font-family: var(--mono); font-size: 14px; color: var(--primary);
}
.md-content pre {
    background: var(--bg-alt); border: 1px solid var(--border);
    padding: 16px; border-radius: 10px; overflow-x: auto; margin: 16px 0;
}
.md-content pre code { background: transparent; padding: 0; color: var(--text); }
.md-content blockquote {
    border-left: 3px solid var(--primary); padding: 8px 16px;
    margin: 16px 0; background: var(--bg-alt); border-radius: 0 8px 8px 0;
    color: var(--text-soft);
}
.md-content img,
.md-content video {
    border-radius: 10px; border: 1px solid var(--border);
    margin: 12px 0; max-width: 100%; height: auto;
    display: block;
    background: var(--bg-alt);
}
.md-content video { width: auto; max-height: 70vh; }
.md-content img { cursor: zoom-in; transition: opacity .15s ease; }
.md-content img:hover { opacity: .92; }

/* Größen-Klassen für Medien */
.md-media.size-small  { max-width: 200px; }
.md-media.size-medium { max-width: 420px; }
.md-media.size-large  { max-width: 720px; }
.md-media.size-full   { max-width: 100%;  width: 100%; }

/* Bilder/Videos als „Karte" zentrieren wenn nicht voll */
.md-content > p > .md-media,
.md-content > .md-media {
    margin-left: auto; margin-right: auto;
}

/* Lightbox */
.lightbox {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
}
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox img,
.lightbox video {
    max-width: 100%; max-height: 100%;
    border-radius: 10px; box-shadow: 0 8px 40px rgba(0,0,0,.4);
    background: #000;
}
.lightbox-close {
    position: fixed; top: 16px; right: 18px;
    background: rgba(255,255,255,.15); color: #fff;
    border: 0; border-radius: 999px;
    width: 40px; height: 40px;
    font-size: 20px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.lightbox-close:hover { background: rgba(255,255,255,.28); }
.md-content hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }

.md-table-wrap { overflow-x: auto; margin: 16px 0; }
.md-table {
    width: 100%; border-collapse: collapse;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.md-table th, .md-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.md-table th { background: var(--bg-alt); font-weight: 600; }
.md-table tr:last-child td { border-bottom: 0; }

/* Callouts */
.md-callout {
    display: flex; gap: 12px; padding: 14px 16px;
    border: 1px solid var(--border); border-left-width: 4px;
    border-radius: 10px; margin: 16px 0;
    background: var(--bg-alt);
}
.md-callout-icon { font-size: 20px; line-height: 1; }
.md-callout-body { flex: 1; }
.md-callout-body > *:first-child { margin-top: 0; }
.md-callout-body > *:last-child { margin-bottom: 0; }
.md-callout-info    { border-left-color: var(--info); }
.md-callout-warning { border-left-color: var(--warning); }
.md-callout-tip     { border-left-color: var(--success); }
.md-callout-danger  { border-left-color: var(--danger); }
.md-callout-note    { border-left-color: var(--text-muted); }

/* Platform tabs */
.platform-tabs { margin: 24px 0; }
.tab-nav { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: transparent; border: 0; padding: 10px 16px; cursor: pointer;
    color: var(--text-soft); font: 600 14px var(--font);
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* Platform hint */
.platform-hint {
    display: flex; gap: 10px; align-items: center;
    padding: 10px 14px; border-radius: 10px;
    background: var(--bg-alt); border: 1px solid var(--border);
    color: var(--text-soft); margin-bottom: 16px; font-size: 14px;
}

/* FAQ */
.article-faq { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }

/* Feedback */
.article-feedback {
    margin-top: 48px; padding: 24px; background: var(--bg-alt);
    border-radius: var(--radius); display: flex; flex-wrap: wrap;
    justify-content: space-between; gap: 16px; align-items: center;
}
.feedback-form { display: flex; gap: 8px; }
.feedback-thanks { font-weight: 600; color: var(--success); margin: 0; }
.contact-support-link { color: var(--primary); font-weight: 500; }

/* Related */
.article-related { margin-top: 40px; }
.article-related h2 { font-size: 18px; }
.article-related ul { list-style: none; padding: 0; }
.article-related li { margin: 6px 0; }
.article-related a { color: var(--text); }
.article-related a:hover { color: var(--primary); }

/* Footer */
.site-footer { margin-top: 80px; padding: 24px 0; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-left strong { color: var(--text); margin-right: 8px; }

/* Responsive */
@media (max-width: 768px) {
    .hero { padding: 40px 0 32px; }
    .hero-title { font-size: 30px; }
    .hero-subtitle { font-size: 15px; }
    .header-search { display: none; }
    .site-nav { display: none; }
    .article-head h1 { font-size: 26px; }
    .cta-card { flex-direction: column; align-items: flex-start; }
}
