/* -------------------------------------------------------------------------- */
/* GLOBAL STYLES & RESETS */
/* -------------------------------------------------------------------------- */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
    background-color: #f4f4f9; /* Leichter Hintergrund */
}

/* -------------------------------------------------------------------------- */
/* HEADER & LANGUAGE SWITCHER */
/* -------------------------------------------------------------------------- */

.main-header {
    width: 100%;
    overflow: hidden; 
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover; 
    max-height: 250px; 
}

/* SPRACHWAHLSCHALTER STYLING - OBEN RECHTS FÜR ALLE GRÖSSEN */
.language-selector {
    position: absolute;
    top: 15px; 
    right: 35px; 
    z-index: 10;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 4px;
    display: flex;
    gap: 5px;
}
.lang-button {
    background-color: rgba(255, 255, 255, 0.8);
    color: #333;
    border: 1px solid #ccc;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 6px;
    font-weight: bold;
    transition: all 0.2s;
}
.lang-button.active {
    background-color: #1065c0; /* Blau beibehalten */
    color: white;
    border-color: #1065c0;
}
.lang-button:hover:not(.active) {
    background-color: #f0f0f0;
}


/* -------------------------------------------------------------------------- */
/* MAIN LAYOUT (DESKTOP FIRST) */
/* -------------------------------------------------------------------------- */

.main-container {
    display: flex;
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    gap: 20px;
}

/* SIDEBAR STYLES (DESKTOP) */
.sidebar {
    flex-shrink: 0; 
    width: 250px; 
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    height: fit-content;
}

.sidebar-title {
    font-size: 1.2em;
    color: #1065c0; 
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 15px;
}

.nav-link {
    display: block;
    padding: 10px 0;
    margin-bottom: 5px;
    color: #555;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}
.nav-link:hover {
    color: #1065c0;
    background-color: #C6E2FF;
    padding-left: 10px;
}
.nav-link.active {
    color: #1065c0; 
    border-left: 3px solid #1065c0;
    font-weight: bold;
    padding-left: 10px;
}

/* CONTENT AREA STYLES */
.content-area {
    flex-grow: 1;
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    min-width: 0;
    margin-left: 0; /* Korrektur: Abstand wird durch main-container gap gesetzt */
}

.content-area h1 {
    color: #1065c0;
    border-bottom: 2px solid #1065c0;
    padding-bottom: 10px;
    margin-top: 0;
}
.content-area h2 {
    color: #555;
    margin-top: 30px;
}

/* -------------------------------------------------------------------------- */
/* FOOTER */
/* -------------------------------------------------------------------------- */

.footer {
    text-align: center;
    padding: 20px;
    background-color: #f4f4f9;
    color: #888;
    margin-top: 30px;
    font-size: 0.9em;
    border-top: 1px solid #ddd;
}

/* -------------------------------------------------------------------------- */
/* RESPONSIVENESS (MOBILE OPTIMIERUNG) */
/* -------------------------------------------------------------------------- */

@media screen and (max-width: 768px) {
    
    /* NEU: Sprachauswahl näher an den Rand rücken */
    .language-selector {
        top: 5px;
        right: 5px;
    }

    /* Layout wird vertikal gestapelt */
    .main-container {
        flex-direction: column;
        margin-top: 15px;
        padding: 0 10px;
        gap: 10px;
    }

    /* Sidebar nimmt die volle Breite ein und kommt zuerst */
    .sidebar {
        width: auto;
        padding: 15px 10px;
        order: 1; 
    }

    /* Navigation im Mobile-Modus als scrollbare horizontale Liste */
    .sidebar .nav-link {
        display: inline-block;
        white-space: nowrap; 
        padding: 8px 12px;
        margin-right: 5px;
        border-bottom: none;
        border-radius: 4px;
        font-size: 0.9em;
        border-left: none; /* Linke Akzentlinie auf Mobile entfernen */
    }

    .sidebar .sidebar-title {
        display: none; 
    }

    .sidebar nav {
        display: block;
        overflow-x: auto; 
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px; 
    }
    
    /* Aktive Links im Mobil-Modus anpassen */
    .nav-link.active {
        border-left: none; 
        background-color: #C6E2FF; /* Leichter Hintergrund für aktiv */
        padding-left: 12px;
    }

    /* Content Area */
    .content-area {
        padding: 20px 15px;
        order: 2; 
        margin-left: 0; /* Sicherstellen, dass kein zusätzlicher linker Rand da ist */
    }

    .content-area h1 {
        font-size: 1.8em;
    }
}
