/* ===================================================================
   gunztheduel.wiki - dark theme
   =================================================================== */

:root {
    --bg: #121212;
    --bg-panel: #1c1c1c;
    --bg-panel-alt: #232323;
    --border: #333333;
    --text: #e0e0e0;
    --text-muted: #9a9a9a;
    --accent: #d9534f;
    --accent-hover: #ef6c66;
    --link: #f0a04b;
    --success: #4caf50;
    --error: #e57373;
    --info: #64b5f6;
    --radius: 4px;
    --max-width: 1100px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

a:hover {
    text-decoration: underline;
}

/* ----------------------------------------------------------------
   Layout
   ---------------------------------------------------------------- */

.site-header {
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.nav-brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

.nav-brand span {
    color: var(--accent);
}

.nav-logo {
    height: 64px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--text);
    font-weight: 500;
}

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

.nav-links .btn {
    margin: 0;
}

main {
    flex: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
    width: 100%;
}

.site-footer {
    background-color: var(--bg-panel);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    padding: 1.5rem 1.25rem;
    margin-top: auto;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
}

.footer-links a {
    color: var(--text-muted);
    margin-right: 1rem;
}

.footer-links a:hover {
    color: var(--accent);
}

/* ----------------------------------------------------------------
   Typography
   ---------------------------------------------------------------- */

h1, h2, h3, h4 {
    color: #ffffff;
    line-height: 1.3;
}

h1 {
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.4rem;
    margin-top: 0;
}

code, pre {
    background-color: var(--bg-panel-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

code {
    padding: 0.1rem 0.35rem;
    font-size: 0.9em;
}

pre {
    padding: 0.75rem;
    overflow-x: auto;
}

pre code {
    border: none;
    padding: 0;
}

blockquote {
    border-left: 3px solid var(--accent);
    margin: 1rem 0;
    padding: 0.25rem 1rem;
    color: var(--text-muted);
    background-color: var(--bg-panel-alt);
}

table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
}

th, td {
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

th {
    background-color: var(--bg-panel-alt);
}

/* ----------------------------------------------------------------
   Panels / cards
   ---------------------------------------------------------------- */

.panel {
    background-color: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.toc {
    padding: 1rem 1.5rem;
}

.toc-title {
    margin: 0 0 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.toc ol {
    margin: 0;
    padding-left: 1.25rem;
}

.panel h2 {
    scroll-margin-top: 5.5rem;
}

.page-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-list li {
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 0;
}

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

.page-list .meta {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ----------------------------------------------------------------
   Forms
   ---------------------------------------------------------------- */

label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
    width: 100%;
    background-color: var(--bg-panel-alt);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.55rem 0.7rem;
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: 1rem;
}

textarea {
    min-height: 320px;
    font-family: "Cascadia Code", Consolas, "Courier New", monospace;
    resize: vertical;
}

input:focus, textarea:focus, select:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.form-group {
    margin-bottom: 1rem;
}

.form-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: -0.6rem;
    margin-bottom: 1rem;
}

/* ----------------------------------------------------------------
   Buttons
   ---------------------------------------------------------------- */

.btn {
    display: inline-block;
    background-color: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: var(--radius);
    padding: 0.55rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    background-color: var(--accent-hover);
    text-decoration: none;
}

.btn-secondary {
    background-color: var(--bg-panel-alt);
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background-color: #2c2c2c;
}

/* ----------------------------------------------------------------
   Alerts / flash messages
   ---------------------------------------------------------------- */

.alert {
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.alert-success {
    border-color: var(--success);
    color: var(--success);
}

.alert-error {
    border-color: var(--error);
    color: var(--error);
}

.alert-info {
    border-color: var(--info);
    color: var(--info);
}

/* ----------------------------------------------------------------
   Cookie consent banner
   ---------------------------------------------------------------- */

#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-panel);
    border-top: 1px solid var(--border);
    padding: 1rem 1.25rem;
    z-index: 1000;
    display: none;
}

#cookie-banner.visible {
    display: block;
}

.cookie-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.cookie-text {
    flex: 1 1 400px;
    font-size: 0.9rem;
    color: var(--text);
}

.cookie-text a {
    color: var(--link);
}

.cookie-actions {
    display: flex;
    gap: 0.6rem;
    flex-shrink: 0;
}

/* ----------------------------------------------------------------
   Utility
   ---------------------------------------------------------------- */

.text-muted {
    color: var(--text-muted);
}

/* ----------------------------------------------------------------
   Profiles, avatars and badges
   ---------------------------------------------------------------- */

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.profile-header h1 {
    margin: 0;
}

.profile-header-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

.avatar {
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--bg-panel-alt);
    border: 1px solid var(--border);
}

.avatar-lg {
    width: 96px;
    height: 96px;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    vertical-align: middle;
    line-height: 1.4;
}

.badge-admin {
    background-color: var(--accent);
    color: #ffffff;
}

.badge-vip {
    background-color: #f0c14b;
    color: #1c1c1c;
}

.badge-teacher {
    background-color: var(--info);
    color: #1c1c1c;
}

.badge-needs-help {
    background-color: var(--error);
    color: #1c1c1c;
}

.badge-banned {
    background-color: #555555;
    color: #ffffff;
}

#bio {
    min-height: 150px;
    font-family: inherit;
}

.form-check {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-right: 1rem;
    font-weight: normal;
}

.form-check input[type="checkbox"] {
    width: auto;
}

.revision-list {
    list-style: none;
    padding: 0;
}

.revision-list li {
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
}

/* ----------------------------------------------------------------
   Centred narrow-form layout (login, forgot password, reset password)
   ---------------------------------------------------------------- */

.form-box {
    max-width: 520px;
    margin: 0 auto;
}

.form-box h1 {
    text-align: center;
}

/* ----------------------------------------------------------------
   Responsive tables (markdown-rendered content)
   ---------------------------------------------------------------- */

.table-wrap {
    overflow-x: auto;
    margin: 1rem 0;
    -webkit-overflow-scrolling: touch;
}

.table-wrap table {
    margin: 0;
    min-width: 600px;
}

/* ----------------------------------------------------------------
   Wiki view: two-column layout (content + sidebar)
   ---------------------------------------------------------------- */

.wiki-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 0 1.5rem;
    align-items: start;
}

.wiki-sidebar {
    position: sticky;
    top: 5.5rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.4rem;
}

.sidebar-user > div {
    line-height: 1.4;
    font-size: 0.9rem;
}

.avatar-placeholder.avatar-sm {
    font-size: 0.8rem;
}

@media (max-width: 800px) {
    .wiki-layout {
        grid-template-columns: 1fr;
    }

    .wiki-sidebar {
        position: static;
        order: -1;
    }
}

@media (max-width: 600px) {
    .cookie-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-actions {
        justify-content: stretch;
    }

    .cookie-actions .btn {
        flex: 1;
        text-align: center;
    }
}
