/* hackin9.de/3d — Design System */

:root {
    --bg: #0b0f14;
    --bg-elevated: #121820;
    --bg-card: #151d27;
    --bg-card-hover: #1a2430;
    --border: #232d3a;
    --border-hover: #2f3d4f;
    --text: #e6edf3;
    --text-muted: #8b96a5;
    --text-faint: #5c6675;
    --accent: #00d4aa;
    --accent-hover: #00f0c0;
    --accent-dim: rgba(0, 212, 170, 0.12);
    --accent-2: #7c5cff;
    --danger: #ff5470;
    --warning: #ffb454;
    --success: #00d4aa;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    --max-width: 1180px;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
    margin: 0;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 900px 500px at 15% -10%, rgba(0, 212, 170, 0.08), transparent),
        radial-gradient(ellipse 700px 500px at 90% 0%, rgba(124, 92, 255, 0.07), transparent);
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; }
code, .mono { font-family: var(--font-mono); }

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Header / Nav ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 15, 20, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 19px;
    color: var(--text);
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0b0f14;
    font-weight: 900;
    font-family: var(--font-mono);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.nav-links a:hover { color: var(--text); background: var(--bg-card); }
.nav-links a.active { color: var(--accent); }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.lang-switch { display: flex; gap: 2px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; padding: 3px; }
.lang-switch a { padding: 4px 10px; border-radius: 16px; font-size: 12px; font-weight: 700; color: var(--text-faint); }
.lang-switch a.active { background: var(--accent); color: #0b0f14; }

.nav-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.1s, background 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--accent); color: #06110d; }
.btn-primary:hover { background: var(--accent-hover); color: #06110d; }

.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--border-hover); background: var(--bg-card); color: var(--text); }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 32px; text-align: center; }
.hero h1 { font-size: clamp(28px, 5vw, 42px); background: linear-gradient(135deg, #fff, var(--accent) 130%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--text-muted); max-width: 560px; margin: 0 auto 28px; font-size: 16px; }

.hero-split { padding: 48px 0 12px; display: flex; align-items: center; gap: 40px; text-align: left; }
.hero-split .hero-text { flex: 1 1 380px; }
.hero-split .hero-text h1 { font-size: clamp(28px, 4vw, 42px); background: linear-gradient(135deg, #fff, var(--accent) 130%); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 12px; }
.hero-split .hero-text p { color: var(--text-muted); font-size: 16px; max-width: 480px; margin: 0 0 24px; }
.hero-split .hero-art { flex: 1 1 280px; max-width: 320px; }
.hero-split .hero-art img { width: 100%; height: auto; display: block; }
.pill-icon { margin-right: 5px; }

@media (max-width: 760px) {
    .hero-split { flex-direction: column; text-align: center; padding-top: 28px; gap: 12px; }
    .hero-split .hero-text p { margin-left: auto; margin-right: auto; }
    .hero-split .hero-art { max-width: 220px; order: -1; }
}

/* ---------- Search / Filters ---------- */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 28px;
}

.search-box { position: relative; flex: 1 1 320px; }
.search-box input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
}
.search-box input:focus { outline: none; border-color: var(--accent); }
.search-box::before {
    content: "⌕";
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    font-size: 18px;
}

select, .select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
}

.category-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.pill {
    padding: 7px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    background: var(--bg-card);
}
.pill:hover { border-color: var(--border-hover); color: var(--text); }
.pill.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* ---------- Link cards ---------- */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.link-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.15s, transform 0.15s, background 0.15s;
    position: relative;
}
.link-card:hover { border-color: var(--border-hover); background: var(--bg-card-hover); transform: translateY(-2px); }

.link-card.pinned { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pinned-badge {
    position: absolute;
    top: -10px;
    right: 14px;
    background: var(--accent);
    color: #06110d;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
}

.link-card-top { display: flex; align-items: flex-start; gap: 12px; }
.link-card-top .favorite-btn { margin-left: auto; font-size: 16px; color: var(--text-faint); background: none; border: none; cursor: pointer; padding: 2px 6px; }
.link-card-top .favorite-btn:hover { color: var(--warning); }
.link-favicon { width: 32px; height: 32px; border-radius: 8px; background: var(--bg-elevated); flex-shrink: 0; object-fit: cover; }
.link-title { font-size: 15.5px; font-weight: 700; color: var(--text); }
.link-title a { color: inherit; }
.link-url { font-size: 12px; color: var(--text-faint); font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-desc { font-size: 13.5px; color: var(--text-muted); flex: 1; }

.link-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.link-category { font-size: 11.5px; color: var(--accent); background: var(--accent-dim); padding: 3px 10px; border-radius: 10px; font-weight: 600; }

.link-stats { display: flex; align-items: center; gap: 14px; }
.stat-btn { display: flex; align-items: center; gap: 5px; color: var(--text-muted); font-size: 13px; font-weight: 600; background: none; border: none; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.stat-btn:hover { color: var(--accent); background: var(--accent-dim); }
.stat-btn.voted { color: var(--accent); }
.favorite-btn.favorited { color: var(--warning); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 8px; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-supporter { background: rgba(0, 212, 170, 0.15); color: var(--accent); }
.badge-creator { background: rgba(124, 92, 255, 0.18); color: #a893ff; }
.badge-verified { background: rgba(255, 180, 84, 0.15); color: var(--warning); }

/* ---------- Comments ---------- */
.comments-panel { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.comments-list { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; }
.comment-item { font-size: 13px; background: var(--bg-elevated); border-radius: var(--radius-sm); padding: 8px 10px; }
.comment-item .comment-author { font-weight: 700; color: var(--text); margin-right: 6px; }
.comment-item .comment-time { color: var(--text-faint); font-size: 11px; margin-left: 6px; }
.comment-item .comment-body { color: var(--text-muted); margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.comment-form { display: flex; flex-direction: column; gap: 8px; }
.comment-form textarea {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
}
.comment-form textarea:focus { outline: none; border-color: var(--accent); }
.comment-form .btn { align-self: flex-start; }

/* ---------- Registrierungs-Sperre ---------- */
.gate-cta {
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    margin: 8px 0 40px;
}
.gate-cta h2 { font-size: 22px; margin-bottom: 10px; }
.gate-cta p { color: var(--text-muted); max-width: 480px; margin: 0 auto 24px; font-size: 14.5px; }
.gate-cta .btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 20px 0 40px; }
.pagination a, .pagination span {
    min-width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current { background: var(--accent); border-color: var(--accent); color: #06110d; }
.pagination .disabled { opacity: 0.35; pointer-events: none; }

/* ---------- Forms / Auth ---------- */
.auth-wrapper { display: flex; align-items: center; justify-content: center; padding: 60px 20px; min-height: 60vh; }
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 22px; }
.auth-card .subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.form-group input, .form-group textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); }

.form-footer { margin-top: 20px; text-align: center; font-size: 13.5px; color: var(--text-muted); }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 18px; border: 1px solid; }
.alert-error { background: rgba(255, 84, 112, 0.1); border-color: rgba(255, 84, 112, 0.3); color: #ff8fa3; }
.alert-success { background: rgba(0, 212, 170, 0.1); border-color: rgba(0, 212, 170, 0.3); color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer { margin-top: auto; border-top: 1px solid var(--border); padding: 32px 0; color: var(--text-faint); font-size: 13px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }

/* ---------- Utility ---------- */
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.text-muted { color: var(--text-muted); }
.mt-0 { margin-top: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .nav-links { position: fixed; top: 68px; left: 0; right: 0; background: var(--bg-elevated); border-bottom: 1px solid var(--border); flex-direction: column; align-items: stretch; padding: 10px; display: none; }
    .nav-links.open { display: flex; }
    .nav-toggle { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); cursor: pointer; }
    .nav-actions .btn-ghost span, .nav-actions .btn-primary span { display: none; }
}

@media (max-width: 560px) {
    .link-grid { grid-template-columns: 1fr; }
    .hero { padding: 36px 0 24px; }
    .auth-card { padding: 26px; }
}
