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

:root {
    --bg-grad-1: #eef1f5;
    --bg-grad-2: #f7f8fa;
    --container-bg: rgba(255, 255, 255, 0.65);
    --container-border: rgba(255, 255, 255, 0.9);
    --container-shadow: rgba(30, 41, 59, 0.08);
    --panel-bg: rgba(255, 255, 255, 0.4);
    --divider: rgba(0, 0, 0, 0.06);
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --text-faint: #9ca3af;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --img-placeholder: #e5e9f0;
    --bar-track: #e5e7eb;
    --bar-fill: #2563eb;
    --segment-line: rgba(255, 255, 255, 0.9);
    --like-color: #16a34a;
    --dislike-color: #dc2626;
    --vote-bg: rgba(0, 0, 0, 0.04);
}

html[data-theme="dark"] {
    --bg-grad-1: #0b1120;
    --bg-grad-2: #131c31;
    --container-bg: rgba(19, 27, 46, 0.65);
    --container-border: rgba(255, 255, 255, 0.08);
    --container-shadow: rgba(0, 0, 0, 0.4);
    --panel-bg: rgba(255, 255, 255, 0.03);
    --divider: rgba(255, 255, 255, 0.08);
    --text-primary: #eef1f8;
    --text-secondary: #cbd3e1;
    --text-muted: #8b96ac;
    --text-faint: #647089;
    --accent: #5b8def;
    --accent-hover: #7ea2f2;
    --img-placeholder: #1d2740;
    --bar-track: #23304e;
    --bar-fill: #5b8def;
    --segment-line: rgba(11, 17, 32, 0.9);
    --like-color: #4ade80;
    --dislike-color: #f87171;
    --vote-bg: rgba(255, 255, 255, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, var(--bg-grad-1) 0%, var(--bg-grad-2) 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
    transition: background 0.2s ease;
}

.container {
    max-width: 520px;
    margin: 0 auto;
    background: var(--container-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--container-border);
    box-shadow: 0 4px 24px var(--container-shadow);
}

/* Header mit Foto + Info */
.header {
    display: flex;
    gap: 24px;
    padding: 32px;
    background: var(--panel-bg);
    border-bottom: 1px solid var(--divider);
    position: relative;
}

.profile-image {
    width: 140px;
    height: 140px;
    border-radius: 8px;
    background: var(--img-placeholder) center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--text-faint);
    flex-shrink: 0;
    border: 1px solid var(--container-border);
}

.header-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.name {
    font-size: 30px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
    letter-spacing: -0.4px;
    word-break: break-word;
}

.title {
    font-size: 15px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 14px;
}

.email {
    font-size: 14px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    word-break: break-all;
}

.email:hover {
    color: var(--accent-hover);
}

.theme-toggle {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    border: 1px solid var(--divider);
    background: var(--panel-bg);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.theme-toggle:hover { color: var(--text-primary); }
.theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* Textabschnitte */
.text-section {
    padding: 26px 32px;
    border-bottom: 1px solid var(--divider);
}

.section-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.6px;
    margin-bottom: 10px;
}

.section-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    font-weight: 400;
    word-break: break-word;
}

.section-text a {
    color: var(--accent);
}

/* Skills (aufklappbar) */
.skills-details {
    border-bottom: 1px solid var(--divider);
}

.skills-details summary {
    padding: 26px 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    list-style: none;
    user-select: none;
}

.skills-details summary::-webkit-details-marker { display: none; }
.skills-details summary::marker { content: ''; }

.skills-details .chevron {
    color: var(--text-faint);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.skills-details[open] .chevron {
    transform: rotate(180deg);
}

.skills-content {
    padding: 0 32px 26px;
}

.skill-category {
    margin-bottom: 30px;
}

.skill-category:last-child {
    margin-bottom: 0;
}

.category-name {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.skill-levels-guide {
    display: flex;
    font-size: 11px;
    color: var(--text-faint);
    margin-bottom: 12px;
    font-weight: 500;
    padding: 0 1px;
}

.level-label { flex: 1; text-align: center; }
.level-label:first-child { text-align: left; }
.level-label:last-child { text-align: right; }

.skill-item { margin-bottom: 16px; }
.skill-item:last-child { margin-bottom: 0; }

.skill-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 7px;
}

.skill-bar-wrapper { position: relative; height: 8px; }

.skill-bar-container {
    height: 8px;
    background: var(--bar-track);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.skill-bar-fill {
    height: 100%;
    background: var(--bar-fill);
    border-radius: 2px;
}

.skill-segments {
    display: flex;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.segment-divider { flex: 1; border-right: 1.5px solid var(--segment-line); }
.segment-divider:last-child { border-right: none; }

/* Beiträge */
.posts-section {
    padding: 26px 32px;
    border-bottom: 1px solid var(--divider);
}

.posts-empty {
    padding: 12px 0;
    color: var(--text-faint);
    font-size: 14px;
}

.post-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--divider);
}

.post-item:last-child { border-bottom: none; }

.post-title {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
    display: block;
    margin-bottom: 6px;
}

.post-title:hover { color: var(--accent); }

.post-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.post-date { font-size: 12px; color: var(--text-faint); }

/* Vote-Buttons */
.vote-bar { display: flex; gap: 6px; }

.vote-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: 6px;
    border: 1px solid var(--divider);
    background: var(--vote-bg);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}

.vote-btn:hover:not(:disabled) { color: var(--text-primary); }
.vote-btn:disabled { cursor: default; opacity: 0.75; }

.vote-like.voted { color: var(--like-color); border-color: var(--like-color); }
.vote-dislike.voted { color: var(--dislike-color); border-color: var(--dislike-color); }

.footer {
    padding: 16px 32px;
    text-align: center;
    background: var(--panel-bg);
    font-size: 12px;
    color: var(--text-faint);
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Einzelbeitrag-Seite */
.post-page { padding: 0; }

.post-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    border-bottom: 1px solid var(--divider);
    background: var(--panel-bg);
}

.post-page-header .theme-toggle { position: static; }

.back-link {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover { color: var(--accent); }

.post-full { padding: 32px; }

.post-full-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.post-full .post-date { margin-bottom: 16px; display: block; }

.post-full .vote-bar { margin-bottom: 24px; }
.post-full .vote-btn { padding: 6px 12px; font-size: 13px; }

.post-full-content {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    word-break: break-word;
}

.post-full-content a { color: var(--accent); }

@media (max-width: 480px) {
    .header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 26px;
        gap: 16px;
    }

    .name { font-size: 26px; }
    .profile-image { width: 120px; height: 120px; }

    .text-section,
    .posts-section,
    .footer {
        padding: 22px;
    }

    .skills-details summary { padding: 22px; }
    .skills-content { padding: 0 22px 22px; }
    .post-full { padding: 24px; }
    .post-page-header { padding: 16px 22px; }
}

/* --- Admin-Bereich (immer hell) --- */
.admin-body {
    background: #f4f5f7;
    max-width: none;
    padding: 0;
}

.admin-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.admin-header h1 { font-size: 20px; font-weight: 700; }
.admin-header a { font-size: 13px; color: #6b7280; text-decoration: none; }

.admin-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
}

.admin-card h2 { font-size: 15px; font-weight: 700; margin-bottom: 16px; color: #111827; }

.admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.admin-tab {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.admin-tab.active { color: #2563eb; border-bottom-color: #2563eb; }

.form-row { margin-bottom: 14px; }

.form-row label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 5px;
}

.form-row input[type=text],
.form-row input[type=email],
.form-row input[type=password],
.form-row input[type=number],
.form-row textarea,
.form-row select {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.form-row textarea { resize: vertical; min-height: 80px; }

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
    outline: none;
    border-color: #2563eb;
}

.char-counter { font-size: 12px; color: #9ca3af; margin-top: 4px; text-align: right; }
.char-counter.over { color: #dc2626; }

.btn {
    display: inline-block;
    padding: 9px 16px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover { background: #1d4ed8; }

.btn-secondary { background: #fff; color: #374151; border: 1px solid #d1d5db; }
.btn-secondary:hover { background: #f9fafb; }

.btn-danger { background: #fff; color: #dc2626; border: 1px solid #fecaca; }
.btn-danger:hover { background: #fef2f2; }

.btn-sm { padding: 6px 12px; font-size: 12px; }

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f1f3;
    gap: 12px;
}

.list-item:last-child { border-bottom: none; }

.list-item-main { flex: 1; min-width: 0; }
.list-item-title { font-size: 14px; font-weight: 500; color: #111827; }
.list-item-sub { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.list-item-actions { display: flex; gap: 6px; flex-shrink: 0; }

.flash { padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 16px; }
.flash-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.flash-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

.login-box {
    max-width: 360px;
    margin: 80px auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 32px;
}

.login-box h1 { font-size: 18px; margin-bottom: 20px; text-align: center; }
.mini-note { font-size: 12px; color: #9ca3af; margin-top: 6px; }
hr.sep { border: none; border-top: 1px solid #f0f1f3; margin: 20px 0; }
