/* Allgemeine Grundeinstellungen */
body {
    font-family: 'Roboto', 'Segoe UI', Helvetica, Arial, sans-serif;
    line-height: 1.8;
    color: #444;
    margin: 0;
    padding: 0;
    background: linear-gradient(to bottom, rgb(80, 202, 255), #1051a5); 
    min-height: 100vh;
    overflow-x: hidden; /* Verhindert horizontales Scrollen bei Transitionen */
}

/* --- SIDEBAR STYLING --- */
aside.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh; /* Volle Höhe */
    width: 280px;
    background: #fff;
    z-index: 1000; /* Ganz oben */
    box-shadow: 4px 0 15px rgba(0,0,0,0.1); /* Schöner Schatten nach rechts */
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

/* Zustand wenn geschlossen */
body.menu-closed aside.sidebar {
    transform: translateX(-100%); /* Schiebt Sidebar aus dem Bild */
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

.sidebar h3 {
    margin: 0;
    font-size: 0.9rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
}

.sidebar-content {
    overflow-y: auto;
    flex: 1;
    padding: 10px 0;
}

/* Close Button (X) */
.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
    transition: color 0.2s;
    line-height: 1;
    padding: 0 5px;
}

.close-btn:hover {
    color: #e74c3c; /* Rot beim Hover */
}

/* Navigation Links */
#toc {
    display: flex;
    flex-direction: column;
}

#toc a {
    text-decoration: none;
    color: #555;
    font-size: 0.95rem;
    padding: 12px 25px;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
    display: block;
}

#toc a:hover {
    background-color: #f4f6f8;
    color: #3498db;
    border-left-color: #ddd; 
}

#toc a.active {
    background-color: #e3f2fd;
    color: #1565c0;
    border-left-color: #1565c0;
    font-weight: 600;
}

.back-to-top {
    margin: 20px 25px;
    display: block;
    font-size: 0.8rem;
    color: #999;
    border-top: 1px solid #eee;
    padding-top: 15px;
    text-decoration: none;
}

/* --- BURGER BUTTON (Öffnen) --- */
.menu-btn {
    position: fixed;
    top: 15px;
    left: 20px;
    z-index: 2000; /* Über allem, auch wenn Sidebar weg ist */
    background: #fff;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #2c3e50;
    transition: opacity 0.3s, transform 0.3s;
    /* Standardmäßig unsichtbar, wenn Menü offen ist */
    opacity: 0; 
    pointer-events: none;
}

/* Wenn Menü geschlossen ist, Button sichtbar machen */
body.menu-closed .menu-btn {
    opacity: 1;
    pointer-events: auto;
}

/* --- MAIN WRAPPER (Inhalt) --- */
.main-wrapper {
    /* Standard: Platz für Sidebar lassen */
    margin-left: 280px; 
    transition: margin-left 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Wenn Menü geschlossen: Inhalt nimmt vollen Platz ein */
body.menu-closed .main-wrapper {
    margin-left: 0;
}

/* Header Styles */
header {
    background-color: #1a252f;
    color: #ecf0f1;
    padding: 1rem 0;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

header h1 a {
    color: #fff;
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Hero Section */
.page-title {
    text-align: center;
    padding: 4rem 1rem 6rem 1rem;
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    margin-bottom: -4rem;
    /* Clip-Path leicht angepasst für Drawer-Look */
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
}

.page-title h1 {
    margin: 0;
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.page-title h5 {
    margin-top: 1rem;
    font-weight: 300;
    color: rgba(255,255,255,0.8);
    font-size: 1.1rem;
    border: none;
    padding: 0;
}

.page-title a {
    color: #fff;
    text-decoration: underline;
    font-weight: bold;
}

/* Content Container */
.content-container {
    padding: 0 40px 60px 40px;
    width: 100%;
    box-sizing: border-box;
}

/* Artikel Karte */
article#main-content {
    background: #fff;
    padding: 60px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    max-width: 1000px; 
    margin: 0 auto; 
    position: relative;
}

/* Intro Text */
.intro-text {
    font-size: 1.25rem;
    color: #555;
    margin-bottom: 4rem;
    line-height: 1.8;
    border-left: 5px solid #3498db;
    padding-left: 20px;
    font-style: italic;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 0 8px 8px 0;
}

/* Step Container */
.step-container {
    margin-bottom: 5rem;
    scroll-margin-top: 20px; 
}

/* Bilder Styling */
article img, article video {
    width: 100%;
    height: auto;
    display: block;
    margin: 30px 0; 
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Überschriften */
h5 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-weight: 700;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

p {
    margin-bottom: 1.5rem;
    color: #4a4a4a;
    font-size: 1.05rem;
}

/* Code Blocks */
pre {
    background: #282c34;
    color: #abb2bf;
    padding: 25px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95rem;
}

/* Footer */
footer {
    background-color: #1a252f;
    color: #95a5a6;
    text-align: center;
    padding: 4rem 0;
    margin-top: auto; /* Footer nach unten drücken */
    clip-path: polygon(0 15%, 100% 0, 100% 100%, 0 100%);
}

footer a {
    color: #fff;
    opacity: 0.7;
    text-decoration: none;
    margin: 0 15px;
}

footer a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Mobile Anpassung */
@media (max-width: 900px) {
    /* Standardmäßig geschlossen auf Mobile */
    .main-wrapper {
        margin-left: 0;
    }
    
    /* Sidebar verstecken (außer wenn Klasse 'menu-open' da wäre, 
       aber hier nutzen wir 'menu-closed' Logik umgekehrt. 
       Für Mobile ist es oft einfacher, per Default zu zu sein. 
       
       FIX für Mobile: Wir nutzen Media Query, um Standard-Verhalten zu überschreiben. */
       
    body:not(.menu-closed) .main-wrapper {
        /* Auf Mobile: Inhalt NICHT schieben, sondern Sidebar Overlay */
        margin-left: 0; 
        /* Overlay abdunkeln optional */
    }
    
    body:not(.menu-closed) aside.sidebar {
        box-shadow: 0 0 50px rgba(0,0,0,0.5); /* Starker Schatten als Overlay */
    }
    
    /* Auf Mobile müssen wir manuell 'menu-closed' hinzufügen per JS beim Laden, 
       oder CSS Logik umdrehen. Einfachste Lösung: CSS startet mit 'closed' Logik für Mobile.
       Aber da JS 'menu-closed' steuert, belassen wir es dabei. */

    .page-title {
        padding: 3rem 1rem 5rem 1rem;
        margin-bottom: -2rem;
    }
    
    .content-container {
        padding: 20px;
    }

    article#main-content {
        padding: 20px;
    }
}