/* --- GRUNDEINSTELLUNGEN --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    margin: 0;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

/* --- HEADER --- */
header {
    background: #333;
    color: #fff;
    padding: 0.8rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-height: 90px;
    box-sizing: border-box;
    width: 100%;
    transition: background-color 0.3s;
    position: relative;
}

.header-section {
    display: flex;
    align-items: center;
}

.header-left-content {
    flex: 1 0 auto;
    justify-content: flex-start;
}

.header-center-content {
    position: absolute;  
    left: 50%;       
    transform: translateX(-50%); 
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.header-center-content .logo-container img#logo {
    max-height: 50px;
    width: auto;
    display: block;
}

.header-main-title {
    font-size: 1.6em;
    font-weight: bold;
    white-space: nowrap;
    margin: 0;
}

.header-right-content {
    flex: 1 0 auto;
    justify-content: flex-end;
    display: flex;
    align-items: center;
}

header .theme-switcher {
    margin-right: 15px;
}

header .theme-switcher button {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85em;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
    outline: none;
    white-space: nowrap;
}

header .theme-switcher button:hover {
    background-color: #e0e0e0;
}

header .language-switcher a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9em;
    padding: 6px 10px;
    margin-left: 8px;
    border-radius: 5px;
    border: 1px solid transparent;
    transition: background-color 0.3s, color 0.3s;
    line-height: normal;
}

header .language-switcher a:first-child {
    margin-left: 0;
}

header .language-switcher a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

header .language-switcher a.active {
    background-color: #f0f0f0;
    color: #333;
}

.header-logo-link {
    display: flex;
    align-items: center;
    gap: 15px; 
    color: inherit; 
    text-decoration: none; 
}

/* --- MAIN CONTENT --- */
main {
    flex-grow: 1;
    transition: background-color 0.3s;
}

/* HOMEPAGE: Full-width Layout */
body.home main {
    max-width: 100%;
    padding: 0;
    box-shadow: none;
    background-color: transparent;
}

/* UNTERSEITEN: Card-Layout für Desktop */
body.subpage main,
body:not(.home) main {
    max-width: 900px;
    padding: 20px;
    margin: 20px auto;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    border-radius: 8px;
}

/* Content innerhalb von main */
main article h1, main article h2 {
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-top: 0;
    transition: color 0.3s, border-bottom-color 0.3s;
}

main .content {
    margin-top: 15px;
    min-width: 280px;
}

/* Zusätzliche CSS für Impressum-Seite */
.text-center {
    text-align: center;
}

.profile-image-container {
    text-align: center;
    margin: 20px 0;
}

.profile-image {
    max-width: 200px;
    height: auto;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* --- FOOTER --- */
footer {
    background: #222;
    color: #aaa;
    text-align: center;
    padding: 20px;
    margin-top: auto;
    transition: background-color 0.3s, color 0.3s;
}

footer .footer-links {
    margin-bottom: 20px;
}

footer .footer-links a {
    color: #ccc;
    text-decoration: none;
    margin: 0 10px;
    font-size: 0.9em;
    transition: color 0.3s, text-decoration 0.3s;
}

footer .footer-links a:hover {
    color: #fff;
    text-decoration: underline;
}

footer .copyright {
    margin-top: 15px;
    font-size: 0.85em;
}

/* --- DARK MODE STYLES --- */
body.dark-mode header {
    background: #1e1e1e;
}

body.dark-mode header .theme-switcher button {
    background-color: #4a4a4a;
    color: #e0e0e0;
    border-color: #666;
}

body.dark-mode header .theme-switcher button:hover {
    background-color: #5a5a5a;
}

body.dark-mode header .language-switcher a {
    color: #e0e0e0;
}

body.dark-mode header .language-switcher a:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

body.dark-mode header .language-switcher a.active {
    background-color: #4a4a4a;
    color: #e0e0e0;
}

/* KORREKTUR: Verhindert, dass der Header-Link hellblau wird */
body.dark-mode .header-logo-link {
    color: inherit;
}

/* NEUE KORREKTUR: Verhindert den blauen Hover-Effekt für den Header-Link */
body.dark-mode .header-logo-link:hover {
    color: inherit;
}

/* Dark Mode für Unterseiten */
body.subpage.dark-mode main,
body:not(.home).dark-mode main {
    background-color: #1e1e1e;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

body.dark-mode main article h1, body.dark-mode main article h2 {
    color: #f5f5f5;
    border-bottom-color: #444;
}

/* Dark Mode für Profilbild */
body.dark-mode .profile-image {
    box-shadow: 0 4px 8px rgba(255,255,255,0.1);
}

body.dark-mode footer {
    background: #1a1a1a;
    color: #888;
}

body.dark-mode footer .footer-links a {
    color: #bbb;
}

body.dark-mode footer .footer-links a:hover {
    color: #fff;
}

body.dark-mode a {
    color: #8ab4f8;
}

body.dark-mode a:hover {
    color: #aecbfa;
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 768px) {
    header {
        padding: 0.6rem 1rem;
        max-height: none;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .header-left-content {
        order: 3;
        flex-basis: auto;
    }
    
    .header-center-content {
        order: 1;
        flex-basis: 100%;
        text-align: center;
        margin-bottom: 10px;
        font-size: 1.4em;
        min-width: 0;
        gap: 10px;
        position: static; /* Zentrierung für Desktop rückgängig machen */
        transform: none;  /* Transformation aufheben */
    }
    
    .header-center-content .logo-container img#logo {
        max-height: 40px;
    }
    
    .header-right-content {
        order: 2;
        flex-basis: 100%;
        justify-content: center;
        margin-top: 5px;
    }
    
    header .theme-switcher {
        margin-right: 10px;
    }
    
    main article h1, main article h2 {
        font-size: 1.9em;
    }
    
    /* Mobile: Unterseiten bekommen weniger Margin */
    body.subpage main,
    body:not(.home) main {
        margin: 10px;
        border-radius: 8px;
    }
    
    .profile-image {
        max-width: 150px;
    }
}

@media (max-width: 600px) {
    header {
        padding: 0.5rem;
    }
    
    .header-center-content {
        font-size: 1.3em;
        gap: 8px;
    }
    
    .header-center-content .logo-container img#logo {
        max-height: 35px;
    }
    
    header .theme-switcher button {
        padding: 5px 10px;
        font-size: 0.8em;
    }
    
    main article h1, main article h2 {
        font-size: 1.6em;
    }
    
    footer {
        padding: 15px 10px;
    }
    
    footer .footer-links {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    
    footer .footer-links a {
        margin: 6px 0;
    }
    
    /* Mobile: Unterseiten bekommen noch weniger Margin und Padding */
    body.subpage main,
    body:not(.home) main {
        margin: 5px;
        padding: 15px;
        border-radius: 5px;
    }
    
    .profile-image {
        max-width: 120px;
    }
}