* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-body: #fafafa;
    --bg-main: #ffffff;
    --text: #333;
    --text-light: #7f8c8d;
    --nav-bg: #2c3e50;
    --accent: #3498db;
    --code-bg: #f4f4f4;
    --pre-bg: #2c3e50;
    --h2-color: #34495e;
}

.dark {
    --bg-body: #1a1a1a;
    --bg-main: #252525;
    --text: #e0e0e0;
    --text-light: #b0b0b0;
    --nav-bg: #1f2a38;
    --accent: #4da3e3;
    --code-bg: #3a3a3a;
    --pre-bg: #0f1419;
    --h2-color: #8ab4f7;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg-body);
    max-width: 1180px;
    margin: 0 auto;
    padding: 20px;
}

nav {
    background: var(--nav-bg);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    /* Platzhalter */
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.project-title {
    font-weight: bold;
    color: #fff;
    font-size: 1.1rem;
}

.page-title {
    color: #ccc;
    font-size: 0.95rem;
}

.nav-divider {
    color: rgba(255,255,255,0.4);
    margin: 0 5px;
}

.lang-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-link {
    color: #fff;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.lang-link:hover {
    background: rgba(255,255,255,0.1);
}

.lang-link.active {
    background: var(--accent);
    font-weight: bold;
}

.contact-link {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
    margin-left: 8px;
}

.contact-link:hover {
    background: rgba(255,255,255,0.1);
}

.theme-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 50%;
    color: #fff;
    transition: background 0.2s;
}

.theme-btn:hover {
    background: rgba(255,255,255,0.15);
}

main {
    background: var(--bg-main);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    min-height: 70vh;
}

footer {
    text-align: center;
    margin-top: 40px;
    color: var(--text-light);
    font-size: 0.95rem;
}

main h1 {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 12px;
    margin-bottom: 25px;
}

main h2 {
    color: var(--h2-color);
    margin-top: 32px;
    margin-bottom: 16px;
}

main code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}

main pre {
    background: var(--pre-bg);
    color: #ecf0f1;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 20px 0;
    position: relative;
}

main pre code {
    background: transparent;
    padding: 0;
}

main a {
    color: var(--accent);
    text-decoration: underline;
}

main a:hover {
    color: #2980b9;
}

/* --- Suchleiste in der Navigation --- */
.nav-search {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
}

.nav-search input {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 4px;
    border: 1px solid #aaa;
    background: #fff;
    color: #222;
    outline: none;
    width: 180px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.nav-search input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.25);
}

.nav-search button {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 4px;
    border: none;
    background: #3498db;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
}

.nav-search button:hover {
    background: #2980b9;
}

/* Dark Mode: Suchfeld */
html.dark .nav-search input {
    background: #2b2b2b;
    color: #f0f0f0;
    border-color: #555;
}

html.dark .nav-search input::placeholder {
    color: #aaa;
}

html.dark .nav-search button {
    background: #3daeec;
    color: #fff;
}

html.dark .nav-search button:hover {
    background: #2a8fd6;
}

/* --- Suchergebnisse --- */
.search-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-result-item {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px 12px;
    background: #fafafa;
}

.search-result-item a {
    font-weight: bold;
    text-decoration: none;
    color: #2980b9;
}

.search-result-item a:hover {
    text-decoration: underline;
}

.search-result-item .meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
}

.search-result-item .excerpt {
    font-size: 13px;
    color: #333;
    line-height: 1.45;
}

mark {
    background: #fff59d;
    padding: 0 2px;
    border-radius: 2px;
}

.no-results {
    color: #c0392b;
    font-weight: bold;
}

/* Dark Mode: Suchergebnisse */
html.dark .search-result-item {
    background: #2b2b2b;
    border-color: #444;
    color: #e0e0e0;
}

html.dark .search-result-item .meta {
    color: #bbb;
}

html.dark .search-result-item .excerpt {
    color: #d0d0d0;
}

html.dark .search-result-item a {
    color: #5dade2;
}

html.dark .search-result-item a:hover {
    color: #3daeec;
}

html.dark mark {
    background: #b7950b;
    color: #111;
}

html.dark .no-results {
    color: #e74c3c;
}

/* --- Copy-Button für Code-Blöcke --- */
.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.15);
    color: #ecf0f1;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.15s, background 0.15s;
    font-family: system-ui, -apple-system, sans-serif;
}

.copy-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.25);
}

.copy-btn.copied {
    background: rgba(46, 204, 113, 0.85);
    color: #fff;
}

html.dark .copy-btn {
    background: rgba(0, 0, 0, 0.35);
    color: #f0f0f0;
}

html.dark .copy-btn:hover {
    background: rgba(0, 0, 0, 0.5);
}

html.dark .copy-btn.copied {
    background: rgba(39, 174, 96, 0.9);
    color: #fff;
}

main img {
         max-width: 100%;
         max-height: 500px;
         width: auto;
         height: auto;
         display: block;
         margin: 1rem auto;
}
