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

:root {
    --bg:        #11161D;
    --surface:   #161C24;
    --surface2:  #1c2330;
    --border:    #1e2a38;
    --accent:    #FF6A1A;
    --accent2:   #e55a0f;
    --accent3:   #d946ef;
    --text:      #ffffff;
    --muted:     #6b7a8d;
    --success:   #1ED760;
    --danger:    #FF3B3B;
    --warning:   #FFB020;
    --radius:    12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* Header */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(255,106,26,0.1);
}

.site-logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.05em;
}
.site-logo span { color: var(--accent); }

.site-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.site-nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}
.site-nav a:hover { color: var(--accent); }

.site-nav .btn-login {
    background: var(--accent);
    color: #fff;
    padding: 0.4rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s;
}
.site-nav .btn-login:hover { background: var(--accent2); color: #fff; }

.site-user-badge {
    color: var(--muted);
    font-size: 0.85rem;
}

/* Main */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Page Header */
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.5rem; color: #fff; margin-bottom: 0.25rem; }
.page-header p  { color: var(--muted); font-size: 0.9rem; }

/* Kacheln */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

/* Forum-Kategorien (Kachellinks, analog Admin) */
.tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    text-align: center;
    transition: all 0.2s;
}
.tile-link {
    text-decoration: none;
    color: var(--text);
    cursor: pointer;
    display: block;
}
.tile-link:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(99,102,241,0.15);
}
.tile-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.tile-value { font-size: 1.8rem; font-weight: 700; color: #fff; margin-bottom: 0.25rem; }
.tile-label { font-size: 0.85rem; color: var(--muted); }
.tile-desc { font-size: 0.85rem; color: var(--muted); line-height: 1.45; word-break: break-word; }
.tile-desc-multiline { text-align: left; }

.forum-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.forum-section {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .forum-sections {
        grid-template-columns: 1fr;
    }
}

.tile-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
    display: block;
}

.tile-content:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255,106,26,0.2);
}

.tile-img {
    width: 100%;
    height: 160px;
    background-size: cover;
    background-position: center;
    background-color: #0d1117;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.tile-body { padding: 1rem; }
.tile-title { font-weight: 600; color: #fff; margin-bottom: 0.3rem; font-size: 0.95rem; }
.tile-meta  { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.5rem; }
.tile-excerpt {
    font-size: 0.85rem;
    color: #8899aa;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tile-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.reaction {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
}

/* Content Detail */
.content-wrap { max-width: 800px; }
.back-link { color: var(--muted); text-decoration: none; font-size: 0.85rem; display: block; margin-bottom: 1rem; }
.back-link:hover { color: var(--accent); }
.content-hero-img { width: 100%; border-radius: var(--radius); margin-bottom: 1.5rem; max-height: 400px; object-fit: cover; }
.content-title { font-size: 1.8rem; color: #fff; margin-bottom: 0.5rem; }
.content-meta { font-size: 0.85rem; color: var(--muted); margin-bottom: 1.5rem; }
.content-body { line-height: 1.8; }
.content-body p  { margin-bottom: 1rem; }
.content-body h2 { font-size: 1.3rem; color: #fff; margin: 1.5rem 0 0.75rem; }
.content-body h3 { font-size: 1.1rem; color: #fff; margin: 1.2rem 0 0.5rem; }
.content-body ul, .content-body ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.content-body blockquote { border-left: 3px solid var(--accent); padding-left: 1rem; color: #8899aa; margin: 1rem 0; }

/* Reaktionen */
.reactions-wrap { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.reactions-label { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.75rem; }
.reactions-btns { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.reaction-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text);
}
.reaction-btn:hover:not(:disabled) { border-color: var(--accent); background: rgba(255,106,26,0.1); }
.reaction-btn:disabled { opacity: 0.5; cursor: default; }

/* Module Kacheln Startseite */
.module-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
    display: block;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.module-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

.module-tile:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255,106,26,0.2);
}

.module-tile:hover::before { opacity: 1; }

.module-tile .icon { font-size: 2.5rem; margin-bottom: 1rem; }
.module-tile .title { font-size: 1.1rem; font-weight: 600; color: #fff; margin-bottom: 0.3rem; }
.module-tile .desc  { font-size: 0.85rem; color: var(--muted); }

/* Footer */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 2rem;
    margin-top: 4rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}
.site-footer a { color: var(--muted); text-decoration: none; margin: 0 0.5rem; transition: color 0.2s; }
.site-footer a:hover { color: var(--accent); }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1.5rem; font-size: 0.9rem; }
.alert-success { background: #0d2018; border: 1px solid #1ED760; color: #1ED760; }
.alert-error   { background: #2d1010; border: 1px solid #FF3B3B; color: #FF3B3B; }

/* Profil (Frontend) */
.profile-page { max-width: 640px; margin: 0 auto; }
.profile-dashboard { max-width: 960px; }
.profile-dash-header { margin-bottom: 1.5rem; }
.profile-dash-title { font-size: 1.5rem; font-weight: 800; color: #fff; margin: 0 0 0.25rem; }
.profile-dash-sub { font-size: 0.875rem; color: var(--muted); margin: 0; }
.profile-hero {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}
.profile-hero-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--accent);
    flex-shrink: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}
.profile-hero-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-hero-placeholder { line-height: 1; }
.profile-hero-body { min-width: 0; }
.profile-hero-name { font-size: 1.3rem; font-weight: 800; color: #fff; }
.profile-hero-handle { font-size: 0.85rem; color: var(--muted); }
.profile-hero-role { font-size: 0.8rem; color: var(--accent); margin-top: 0.25rem; }
.profile-tile-grid { margin-bottom: 1.5rem; }
.profile-tile-link { color: var(--accent); text-decoration: none; }
.profile-tile-link:hover { text-decoration: underline; }
.profile-nav { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; }
.profile-nav a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.profile-nav a:hover { color: var(--accent); }
.profile-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.profile-field { margin-bottom: 1rem; }
.profile-field label { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 0.35rem; }
.profile-field input,
.profile-field textarea { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 0.65rem 0.85rem; color: var(--text); font-size: 0.95rem; font-family: inherit; }
.profile-field input:focus,
.profile-field textarea:focus { outline: none; border-color: var(--accent); }
.profile-field textarea { min-height: 100px; resize: vertical; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; align-items: center; }
.btn-profile {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}
.btn-profile:hover { filter: brightness(1.08); }
.btn-profile-secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-profile-secondary:hover { border-color: var(--accent); color: var(--accent); }
.profile-dl dt { font-size: 0.75rem; color: var(--muted); margin-top: 0.75rem; }
.profile-dl dt:first-child { margin-top: 0; }
.profile-dl dd { color: var(--text); margin: 0.15rem 0 0 0; word-break: break-word; }
.profile-dl dd a { color: var(--accent); }
.profile-bio { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.profile-bio-title { font-size: 1rem; color: #fff; margin: 0 0 0.5rem; font-weight: 600; }
.profile-bio-text { line-height: 1.6; color: var(--text); }
.profile-hint { margin-bottom: 1rem !important; }
.profile-social-label { margin: 1.25rem 0 0.5rem !important; }
.profile-avatar-wrap { margin-bottom: 1rem; }
.profile-avatar { max-width: 120px; max-height: 120px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); display: block; }
.profile-avatar-preview-label { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 0.35rem; }
.profile-field input[type="file"] { padding: 0.5rem 0; }

/* Profil bearbeiten (2 Spalten) */
.profile-edit-page { max-width: 900px; }
.profile-edit-back { margin-bottom: 1.5rem; }
.profile-edit-title { font-size: 1.5rem; font-weight: 800; color: #fff; margin: 0 0 1.5rem; }
.profile-edit-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 768px) {
    .profile-edit-layout { grid-template-columns: 1fr; }
}
.profile-edit-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.profile-edit-avatar-panel { text-align: center; }
.profile-edit-avatar-ring {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--accent);
    margin: 0 auto 1rem;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}
.profile-edit-avatar-ring img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-edit-avatar-placeholder { line-height: 1; }
.profile-edit-avatar-label {
    font-size: 0.85rem;
    color: var(--muted);
    display: block;
    margin-bottom: 0.5rem;
    text-align: left;
}
.profile-edit-file {
    width: 100%;
    font-size: 0.85rem;
    color: var(--text);
    padding: 0.25rem 0;
}
.btn-profile-block { width: 100%; margin-top: 1rem; box-sizing: border-box; }
.profile-edit-fields { display: flex; flex-direction: column; gap: 1rem; }
.profile-edit-field-label {
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.4rem;
}
.profile-edit-input {
    width: 100%;
    box-sizing: border-box;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.6rem 0.75rem;
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
}
.profile-edit-input:focus { outline: none; border-color: var(--accent); }
.profile-edit-textarea { resize: vertical; min-height: 4.5rem; }

/* Passwort ändern */
.profile-password-page { max-width: 500px; }
.profile-password-card {
    max-width: 500px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.profile-password-form { display: flex; flex-direction: column; gap: 1rem; }
.profile-field-label-note {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    color: var(--muted);
    font-size: 0.8rem;
}
