/* ============================================================
   Manifesto App — Main Stylesheet
   ============================================================ */

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

:root {
    --bg:        #0f0f0f;
    --surface:   #1a1a1a;
    --surface2:  #242424;
    --border:    #2e2e2e;
    --text:      #e8e8e8;
    --text-muted:#888;
    --accent:    #c8a96e;
    --accent2:   #8fb8d4;
    --green:     #5a9a6f;
    --red:       #a05050;
    --radius:    8px;
    --shadow:    0 2px 12px rgba(0,0,0,.4);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Georgia', serif;
    line-height: 1.75;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* ---- Nav ---- */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand { font-size: 1.2rem; font-weight: bold; color: var(--accent); letter-spacing: .03em; }
.nav-links { display: flex; align-items: center; gap: 1.25rem; font-family: sans-serif; font-size: .9rem; }
.nav-links a { color: var(--text-muted); }
.nav-links a:hover { color: var(--text); }
.nav-user { color: var(--accent2); }

/* ---- Container ---- */
.container { max-width: 860px; margin: 0 auto; padding: 2rem 1.5rem; flex: 1; }
.container.narrow { max-width: 480px; }

/* ---- Manifesto Header ---- */
.manifesto-header { text-align: center; padding: 3rem 0 2rem; border-bottom: 1px solid var(--border); margin-bottom: 2.5rem; }
.manifesto-header h1 { font-size: 2.8rem; color: var(--accent); letter-spacing: .04em; }
.subtitle { color: var(--text-muted); font-style: italic; margin-top: .5rem; }

/* ---- Section Cards ---- */
.section-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}
.section-card h2 { font-size: 1.4rem; color: var(--accent); margin-bottom: .75rem; }
.section-text { color: var(--text); line-height: 1.85; }
.section-actions { margin-top: 1.25rem; }
.edit-count { font-size: .8rem; color: var(--text-muted); margin-left: .5rem; }

/* ---- Section Detail ---- */
.section-detail-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}
.section-detail-card h1 { font-size: 1.8rem; color: var(--accent); margin-bottom: 1rem; }
.edit-meta { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; color: var(--text-muted); font-family: sans-serif; font-size: .85rem; }
.edit-byline { color: var(--text-muted); font-size: .85rem; font-family: sans-serif; margin-top: 1rem; }

/* ---- Cards ---- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}
.card h2 { font-size: 1.25rem; margin-bottom: 1.25rem; color: var(--text); }

/* ---- Forms ---- */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; margin-bottom: .4rem; color: var(--text-muted); font-family: sans-serif; font-size: .9rem; }
.form-control {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 4px;
    padding: .6rem .85rem;
    font-family: 'Georgia', serif;
    font-size: 1rem;
    transition: border-color .2s;
}
.form-control:focus { outline: none; border-color: var(--accent); }
textarea.form-control { resize: vertical; }

/* ---- Buttons ---- */
.btn-primary {
    background: var(--accent);
    color: #0f0f0f;
    border: none;
    border-radius: 4px;
    padding: .55rem 1.25rem;
    font-size: .9rem;
    font-weight: bold;
    cursor: pointer;
    font-family: sans-serif;
    transition: opacity .2s;
}
.btn-primary:hover { opacity: .85; }
.btn-primary.full-width { width: 100%; padding: .75rem; font-size: 1rem; }

.btn-suggest {
    display: inline-block;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: .45rem 1rem;
    font-size: .85rem;
    font-family: sans-serif;
    color: var(--text);
    transition: border-color .2s;
}
.btn-suggest:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.btn-discuss {
    display: inline-block;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: .35rem .85rem;
    font-size: .82rem;
    font-family: sans-serif;
    color: var(--text-muted);
    margin-left: 1rem;
}
.btn-discuss:hover { color: var(--accent2); border-color: var(--accent2); text-decoration: none; }

.btn-admin { background: var(--accent2); color: #0f0f0f; border-radius: 4px; padding: .3rem .75rem; font-size: .8rem; font-family: sans-serif; }
.btn-accept { background: var(--green); color: white; border: none; border-radius: 4px; padding: .4rem .9rem; cursor: pointer; font-family: sans-serif; }
.btn-reject { background: var(--red); color: white; border: none; border-radius: 4px; padding: .4rem .9rem; cursor: pointer; font-family: sans-serif; }

/* ---- Voting ---- */
.vote-form, .vote-display { display: flex; align-items: center; gap: .6rem; }
.vote-row { margin-top: 1.25rem; }
.btn-vote {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: .3rem .7rem;
    cursor: pointer;
    font-family: sans-serif;
    font-size: .85rem;
    color: var(--text-muted);
    transition: all .2s;
}
.btn-upvote:hover { border-color: var(--green); color: var(--green); }
.btn-downvote:hover { border-color: var(--red); color: var(--red); }
.vote-score { font-weight: bold; font-family: sans-serif; color: var(--accent); min-width: 2rem; text-align: center; }
.vote-score.big { font-size: 1.3rem; }

/* ---- Edit Items ---- */
.edit-item {
    border-top: 1px solid var(--border);
    padding: 1.25rem 0;
}
.edit-item:first-of-type { border-top: none; }
.edit-header { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; font-family: sans-serif; font-size: .82rem; color: var(--text-muted); margin-bottom: .6rem; }
.edit-author { color: var(--accent2); }
.edit-text { line-height: 1.75; background: var(--surface2); border-left: 3px solid var(--border); padding: .75rem 1rem; border-radius: 0 4px 4px 0; margin: .5rem 0; }
.edit-reason { font-size: .85rem; color: var(--text-muted); font-style: italic; margin: .4rem 0; }
.edit-footer { display: flex; align-items: center; margin-top: .75rem; flex-wrap: wrap; gap: .5rem; }

/* ---- Status Badges ---- */
.status-badge { font-family: sans-serif; font-size: .75rem; padding: .2rem .55rem; border-radius: 3px; font-weight: bold; text-transform: uppercase; letter-spacing: .04em; }
.badge-pending  { background: #3a3520; color: #c8a400; }
.badge-accepted { background: #1a3020; color: #5a9a6f; }
.badge-rejected { background: #2d1a1a; color: #a05050; }

/* ---- Comments ---- */
.comment-item { border-top: 1px solid var(--border); padding: 1rem 0; }
.comment-header { display: flex; gap: .75rem; align-items: baseline; font-family: sans-serif; font-size: .82rem; margin-bottom: .4rem; }
.comment-header strong { color: var(--accent2); }
.comment-date { color: var(--text-muted); }
.comment-form-wrap { border-top: 1px solid var(--border); padding-top: 1.25rem; margin-top: 1rem; }
.comment-form-wrap h3 { margin-bottom: .85rem; font-size: 1rem; }

/* ---- Auth ---- */
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.5rem; margin-top: 3rem; box-shadow: var(--shadow); }
.auth-card h1 { margin-bottom: 1.5rem; color: var(--accent); font-size: 1.6rem; }
.auth-switch { margin-top: 1.25rem; text-align: center; font-family: sans-serif; font-size: .9rem; color: var(--text-muted); }
.auth-notice { background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; padding: .85rem 1rem; font-family: sans-serif; font-size: .9rem; color: var(--text-muted); }

/* ---- Alerts ---- */
.alert { border-radius: 4px; padding: .75rem 1rem; margin-bottom: 1.25rem; font-family: sans-serif; font-size: .9rem; }
.alert-success { background: #1a3020; color: #5a9a6f; border: 1px solid #2d5040; }
.alert-error   { background: #2d1a1a; color: #c05050; border: 1px solid #4a2020; }

/* ---- About ---- */
.about-page { max-width: 700px; margin: 0 auto; }
.about-page h1 { font-size: 2rem; color: var(--accent); margin-bottom: 2rem; }
.about-section { margin-bottom: 2rem; }
.about-section h2 { font-size: 1.2rem; margin-bottom: .75rem; color: var(--text); border-bottom: 1px solid var(--border); padding-bottom: .4rem; }
.about-section ul { padding-left: 1.5rem; }
.about-section li { margin-bottom: .4rem; }

/* ---- Misc ---- */
.back-link { display: inline-block; color: var(--text-muted); font-family: sans-serif; font-size: .9rem; margin-bottom: 1.5rem; }
.back-link:hover { color: var(--text); }
.empty-state { color: var(--text-muted); font-style: italic; padding: 1rem 0; font-family: sans-serif; }
.admin-actions { display: flex; gap: .75rem; margin-top: .75rem; align-items: center; flex-wrap: wrap; }
.admin-edit { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; background: var(--surface2); }

/* ---- Footer ---- */
.footer { border-top: 1px solid var(--border); padding: 1.5rem 2rem; text-align: center; color: var(--text-muted); font-family: sans-serif; font-size: .85rem; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .navbar { padding: .75rem 1rem; }
    .container { padding: 1.25rem 1rem; }
    .manifesto-header h1 { font-size: 2rem; }
    .nav-links { gap: .75rem; font-size: .82rem; }
}
