/* --- Core Variables & Global Styles --- */
:root {
    --bg-color: #121212;
    --content-bg-color: #1e1e1e;
    --sidebar-bg-color: #181818;
    --border-color: #3a3a3a;
    --text-color: #e0e0e0;
    --text-color-muted: #9e9e9e;
    --accent-color: #6595ED; 
    --accent-color-hover: #82aaff; 
    --highlight-bg: #b3a10d;
    --highlight-text: #000000;
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
}

body.menu-open { overflow: hidden; }

a { color: var(--accent-color); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--accent-color-hover); text-decoration: underline; }

h1, h2, h3, h4, h5, h6 { margin-bottom: 0.8em; line-height: 1.3; color: var(--text-color); }
h1 { font-size: 2.5rem; margin-top: 0.5em; }

/* Anchor Link Fix: Damit Überschriften nicht hinter dem Header verschwinden */
h2, h3, .content-section { scroll-margin-top: 90px; }

h2 { 
    font-size: 1.8rem; 
    border-bottom: 1px solid var(--border-color); 
    padding-bottom: 0.4em; 
    margin-top: 2.5em; 
}

h3 { font-size: 1.3rem; margin-top: 1.5em; }
p { margin-bottom: 1.2em; }
strong { color: var(--accent-color-hover); font-weight: 600; }
.subtitle { font-size: 1.2rem; color: var(--text-color-muted); margin-top: -0.5em; display: block; margin-bottom: 2rem; }

/* --- Site Header --- */
.site-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0 1.5rem;
    height: 60px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--sidebar-bg-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px); /* Glas-Effekt */
}

.logo { font-size: 1.3rem; font-weight: 700; color: var(--text-color); white-space: nowrap; }
.logo span { color: var(--accent-color); }
.logo:hover { text-decoration: none; }

.header-search-desktop { flex-grow: 1; }
.header-search-desktop input {
    width: 100%;
    max-width: 400px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}
.header-search-desktop input:focus { outline: none; border-color: var(--accent-color); }

.header-nav-desktop { display: flex; align-items: center; gap: 1rem; }
.header-nav-desktop a { font-size: 0.9rem; color: var(--text-color-muted); }
.header-nav-desktop a:hover { color: var(--accent-color); text-decoration: none; }

.support-button {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color-muted);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s ease;
}
.support-button:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background-color: rgba(101, 149, 237, 0.1);
}

/* --- Main Layout Wrapper --- */
.page-wrapper {
    display: grid;
    grid-template-columns: 240px 1fr 240px;
    gap: 2rem;
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* --- Left Sidebar Navigation --- */
.sidebar-nav { position: sticky; top: 76px; height: calc(100vh - 92px); overflow-y: auto; }
.sidebar-nav nav a {
    display: block;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    color: var(--text-color-muted);
    margin-bottom: 0.2rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}
.sidebar-nav nav a:hover { background-color: var(--content-bg-color); text-decoration: none; color: var(--text-color); }
.sidebar-nav nav a.active { background-color: var(--accent-color); color: #000; font-weight: 600;}

/* Main Content & Right Sidebar */
.main-content { min-width: 0; }
.content-body { max-width: 800px; }
.content-section { margin-bottom: 3rem; }

/* --- Element Styles --- */

/* Images inside Content */
.content-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

/* Keyboard keys */
kbd {
    background-color: #2d2d2d;
    border: 1px solid #454545;
    border-bottom-color: #202020;
    border-radius: 5px;
    box-shadow: 0 2px 0 #202020;
    color: var(--text-color);
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    padding: 0.2em 0.5em;
    font-size: 0.85em;
    font-weight: 600;
    white-space: nowrap;
}

/* Highlights */
mark { background-color: var(--highlight-bg); color: var(--highlight-text); border-radius: 3px; padding: 0 2px; }

/* Feature Items (Cards) */
.feature-item, .faq-item { border: 1px solid var(--border-color); border-radius: 8px; margin-bottom: 1rem; transition: border-color 0.2s; }
.feature-item { background-color: var(--content-bg-color); padding: 1.2rem 1.5rem; }
.feature-item:hover { border-color: #555; }
.feature-item h3 { margin: 0 0 0.5rem 0; font-size: 1.1rem; color: var(--accent-color); }
.feature-item p { margin: 0; font-size: 0.95rem; color: #d1d1d1; }

/* List Styling */
.content-body ul, .content-body ol {
    margin: 0.5rem 0 1rem 1.25rem;
    padding-left: 1rem;
    list-style-position: outside;
}
.feature-item ul, .feature-item ol,
.faq-answer ul, .faq-answer ol {
    margin-left: 0;
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}
.feature-item li, .faq-answer li { 
    margin: 0.35rem 0; 
    color: #d1d1d1;
    font-size: 0.95rem;
}

/* --- Tier Comparison Table (Feature Page) --- */
.table-container {
    width: 100%;
    overflow-x: auto; /* Erlaubt horizontales Scrollen auf Mobile */
    margin: 2rem 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--content-bg-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.tier-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Erzwingt Mindestbreite, damit Tabelle nicht gequetscht wird */
}

.tier-table th, .tier-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    vertical-align: middle;
    color: #d1d1d1;
}

/* Tabellen-Kopf */
.tier-table th {
    background-color: var(--sidebar-bg-color);
    color: var(--accent-color);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0; /* Optional: Header bleibt beim Scrollen innerhalb der Box sichtbar */
}

/* Erste Spalte (Feature Name) linksbündig */
.tier-table th:first-child, .tier-table td:first-child {
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-right: 1px solid var(--border-color);
    min-width: 180px;
}

/* Zeilen Hover-Effekt */
.tier-table tbody tr:hover {
    background-color: rgba(101, 149, 237, 0.05);
}

/* Letzte Zeile ohne unteren Rand */
.tier-table tr:last-child td { border-bottom: none; }


/* --- FAQ Section Divider (New) --- */
.section-divider {
    border: 0;
    height: 1px;
    background-color: var(--border-color);
    /* Verlauf: Transparent -> Grau -> Transparent */
    background-image: linear-gradient(to right, transparent, var(--border-color), transparent);
    margin: 3rem 0; /* Großer Abstand zwischen den Themen */
    opacity: 0.6;
}

/* --- FAQ Accordion Styles --- */
.faq-question { 
    width: 100%; 
    background: transparent; 
    border: none; 
    padding: 1rem 1.5rem; 
    font-size: 1.1rem; 
    font-weight: 600; 
    text-align: left; 
    cursor: pointer; 
    color: var(--text-color); 
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.2s;
}
.faq-question:hover { color: var(--accent-color); }

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--text-color-muted);
    line-height: 1;
    font-weight: 400;
}
.faq-item.active .faq-question::after { content: '−'; color: var(--accent-color); }

.faq-answer { 
    max-height: 0; 
    overflow: hidden; 
    transition: max-height 0.3s cubic-bezier(0, 1, 0, 1); 
    padding: 0 1.5rem; 
    opacity: 0;
}
.faq-item.active .faq-answer { 
    max-height: 500px; 
    padding-bottom: 1.5rem; 
    opacity: 1;
    transition: opacity 0.3s ease, max-height 0.5s ease;
}


/* --- On-page Navigation (TOC) --- */
.on-page-nav { position: sticky; top: 80px; font-size: 0.9rem; align-self: start; }
.on-page-nav h3 { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-color-muted); margin-bottom: 0.8rem; }
.on-page-nav ul { list-style: none; padding: 0; margin: 0; }
.on-page-nav li a { 
    display: block; 
    padding: 0.4rem 0; 
    color: var(--text-color-muted); 
    border-left: 2px solid var(--border-color); 
    padding-left: 1rem; 
    font-size: 0.9rem;
}
.on-page-nav li a:hover { text-decoration: none; color: var(--text-color); border-left-color: #666; }
.on-page-nav li a.active { color: var(--accent-color); border-left-color: var(--accent-color); font-weight: 600; }


/* --- Support Modal --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px); display: none; align-items: center; justify-content: center; z-index: 2000; }
.modal-content { background-color: var(--content-bg-color); padding: 2.5rem; border-radius: 12px; max-width: 500px; width: 90%; border: 1px solid var(--border-color); position: relative; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
.modal-close-btn { position: absolute; top: 15px; right: 20px; background: none; border: none; color: var(--text-color-muted); font-size: 2rem; cursor: pointer; line-height: 1; }
.modal-close-btn:hover { color: var(--text-color); }
.modal-divider { border: none; height: 1px; background-color: var(--border-color); margin: 1.5rem 0; }
.email-box { background-color: var(--bg-color); padding: 1rem; border-radius: 6px; font-family: monospace; font-size: 1.1rem; color: var(--accent-color); margin: 1rem 0; border: 1px dashed var(--border-color); }
.discord-button { display: inline-block; background-color: #5865F2; color: white; padding: 0.8rem 1.5rem; border-radius: 6px; font-weight: 600; text-decoration: none; transition: background 0.2s; }
.discord-button:hover { background-color: #4752c4; color: white; text-decoration: none; }


/* --- Mobile / Responsive Styles --- */
.mobile-menu-btn { display: none; }
.sidebar-nav-inner .mobile-search-container, .sidebar-nav-inner .mobile-nav-footer { display: none; }

@media (max-width: 1024px) {
    .page-wrapper { grid-template-columns: 200px 1fr; }
    .on-page-nav { display: none; } 
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; margin-top: 0; }
    
    /* Hide desktop-only elements */
    .header-search-desktop, .header-nav-desktop, .on-page-nav { display: none; }
    .page-wrapper { grid-template-columns: 1fr; padding: 1rem; }
    .main-content { padding-top: 1rem; }

    /* Mobile Hamburger Menu */
    .mobile-menu-btn {
        display: block;
        background: none;
        border: none;
        padding: 0.5rem;
        cursor: pointer;
        z-index: 3001;
    }
    .mobile-menu-btn .icon-bar {
        display: block;
        width: 22px;
        height: 2px;
        background-color: var(--text-color);
        border-radius: 1px;
        margin: 5px 0;
        transition: 0.3s;
    }

    body.menu-open .mobile-menu-btn .icon-bar:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
    body.menu-open .mobile-menu-btn .icon-bar:nth-child(2) { opacity: 0; }
    body.menu-open .mobile-menu-btn .icon-bar:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

    /* Slide-out Menu */
    .sidebar-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100%;
        background-color: var(--sidebar-bg-color);
        border-right: 1px solid var(--border-color);
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 3000;
        padding: 1rem;
        display: flex;
        flex-direction: column;
        box-shadow: 5px 0 15px rgba(0,0,0,0.5);
    }
    .sidebar-nav.is-open { transform: translateX(0); }
    .sidebar-nav-inner { display: flex; flex-direction: column; height: 100%; }
    .sidebar-nav-inner nav { flex-grow: 1; margin-top: 1rem; }

    /* Mobile Elements */
    .mobile-search-container { display: block; margin-bottom: 1rem; }
    .mobile-search-container input {
        width: 100%;
        background-color: var(--bg-color);
        border: 1px solid var(--border-color);
        color: var(--text-color);
        padding: 0.7rem 1rem;
        border-radius: 8px;
        font-size: 1rem;
    }
    .mobile-nav-footer {
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
        padding-top: 1.5rem;
        border-top: 1px solid var(--border-color);
    }
    .mobile-nav-footer .support-button { width: 100%; text-align: center; }
    
    .page-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.7);
        z-index: 2999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
        backdrop-filter: blur(2px);
    }
    .page-overlay.is-visible { opacity: 1; visibility: visible; }
}


/* --- Tutorials / Custom Page Styles (Optional) --- */
.tutorials-page {
  --doc-bg: #0f1115;
  --doc-surface: #161922;
  --doc-surface-2: #1b1f2a;
  --doc-text: #e8ecf3;
  --doc-text-muted: #aab3c5;
  --doc-border: #2a3040;
  --doc-accent: var(--accent-color);
  --doc-note-bg: rgba(101,149,237,0.10);
  --doc-shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 6px 30px rgba(0,0,0,0.35);
  background: var(--doc-bg); color: var(--doc-text);
}
.tutorials-page .doc-article { max-width: 840px; margin: 0 auto; }
.tutorials-page h2, .tutorials-page h3 { color: var(--doc-text); border-bottom: none; }
.tutorials-page .doc-block { background: var(--doc-surface); border: 1px solid var(--doc-border); padding: 18px 20px; box-shadow: var(--doc-shadow); margin: 22px 0; border-radius: 10px;}
.tutorials-page .callout.note { background: var(--doc-note-bg); border: 1px solid var(--doc-accent); padding: 14px 16px; border-radius: 10px; margin: 16px 0 22px; }
.tutorials-page .doc-img { display:block; margin:20px auto; max-width: 100%; border-radius:10px; border:1px solid var(--doc-border); box-shadow: 0 10px 40px rgba(0,0,0,0.45); }
.tutorials-page figcaption { color:var(--doc-text-muted); font-size:.9rem; margin-top:8px; font-style: italic; text-align: center; }