/* --- MASTER STYLESHEET (Consolidated from all 3 pages) --- */
:root {
    /* Brand Colors */
    --primary: #2563eb;
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --accent-color: #0ea5e9;

    /* Neutrals */
    --bg-body: #f3f4f6;
    --bg-card: #ffffff;
    --bg-pinned: #f0f9ff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;

    /* Spacing & Radius */
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --container-width: 1200px;
}

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

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

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

p {
    line-height: 1.5em;
    margin-top: 1em;
}
h3 {
    margin-top: 1em;
}
ul {
    list-style: none;
}

.container {
    width: 100% !important;
    max-width: var(--container-width) !important; /* Caps width at 1200px */
    margin: 0 auto;
    padding: 0 1rem;
}

/* --- BUTTONS (Unified) --- */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;

    /* Add these to normalize <button> and <a> elements: */
    font-family: inherit;
    line-height: 1.5;
    vertical-align: middle;
    box-sizing: border-box;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none; /* Ensures clean look like 'Sign Up' */
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.container-xs .btn + .btn {
    margin-left: 0.5rem;
}

.btn-outline {
    border: 1px solid var(--border-color);
    background-color: transparent;
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--text-muted);
    background-color: #f9fafb;
}

.btn-danger {
    background-color: #eb4a25;
    color: white;
    border: none; /* Ensures clean look like 'Sign Up' */
}

.btn-danger:hover {
    background-color: #d14324;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* --- HEADER / NAVBAR --- */
.header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo span {
    color: var(--primary-color);
}

.logo img {
    max-height: 40px;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

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

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.user-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

/* --- HERO (Homepage only) --- */
.hero {
    background: linear-gradient(
        135deg,
        var(--primary-color),
        var(--accent-color)
    );
    color: white;
    padding: 3rem 0;
    margin-bottom: 2rem;
    text-align: center;
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.hero p {
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

/* --- LAYOUT GRID --- */
.content-grid {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

/* --- BREADCRUMBS --- */
.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;

    padding: 1.5rem 0;
    font-size: 0.875rem;
    color: var(--text-muted);

    /* Remove width: 100% here so it relies on parent .container
       (which we just fixed above) */
}

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

.breadcrumbs a:hover {
    color: var(--primary-color);
}

.breadcrumbs span {
    margin: 0 0.5rem;
    color: #d1d5db;
}

/* --- FORUM / CATEGORY STYLES (Homepage) --- */
/* --- FORUM / CATEGORY STYLES (Homepage) --- */
.category-block {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 2rem;
}

.category-header {
    background-color: #f9fafb;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.category-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
}

.forum-row {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.1s;
}

.forum-row:last-child {
    border-bottom: none;
}
.forum-row:hover {
    background-color: #f9fafb;
}

.forum-icon {
    flex: 0 0 48px;
    width: 48px;
    min-width: 48px;
    height: 48px;
    background-color: #e0f2fe;
    color: var(--primary-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1.25rem;
}

.forum-info {
    flex: 1;
    min-width: 0; /* Critical for text truncation */
}

.forum-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    display: block;
}

.forum-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.forum-stats {
    flex: 0 0 100px;
    width: 100px;
    min-width: 100px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-count {
    font-weight: 700;
    color: var(--text-main);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.forum-last-post {
    flex: 0 0 280px;
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    padding-left: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.forum-last-post .avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
}

.last-post-meta {
    min-width: 0; /* Critical for text truncation */
    flex: 1;
}

.last-post-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    color: var(--text-main);
    display: block;
    margin-bottom: 0.25rem;
}

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

.last-post-date {
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- THREAD LIST STYLES (View Forum) --- */
.general-container,
.forum-subheader {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.forum-title-block h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.forum-title-block p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.thread-list {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.thread-row {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.1s;
}

.thread-row:last-child {
    border-bottom: none;
}
.thread-row:hover {
    background-color: #f9fafb;
}

.thread-row.pinned {
    background-color: var(--bg-pinned);
    border-left: 4px solid var(--primary-color);
    padding-left: calc(1.5rem - 4px);
}
.thread-row.pinned:hover {
    background-color: #e0f2fe;
}
.thread-row.locked {
    opacity: 0.7;
}

.thread-icon {
    flex: 0 0 32px;
    height: 32px;
    margin-right: 1rem;
    color: var(--text-muted);
}
.pinned .thread-icon {
    color: var(--primary-color);
}
.locked .thread-icon {
    color: #9ca3af;
}

.thread-info {
    flex: 1;
}
.thread-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.35rem;
    display: block;
}
.thread-title:hover {
    color: var(--primary-color);
}

.thread-meta-tags {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.tag {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}
.tag-blue {
    background-color: #dbeafe;
    color: #1e40af;
}
.tag-green {
    background-color: #dcfce7;
    color: #166534;
}
.tag-gray {
    background-color: #f3f4f6;
    color: #4b5563;
}

.thread-author {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.thread-stats {
    flex: 0 0 140px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.stat-val {
    font-weight: 600;
    color: var(--text-main);
}

.thread-last-post {
    flex: 0 0 220px;
    padding-left: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 0 0 1px var(--border-color);
}

.last-post-info {
    line-height: 1.2;
}
.last-post-time {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- POST / THREAD VIEW STYLES (View Thread) --- */
.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    margin-bottom: 2rem;
    overflow: hidden;
}

.post-sidebar {
    background-color: #f9fafb;
    border-right: 1px solid var(--border-color);
    width: 180px;
    flex-shrink: 0;
    padding: 1.5rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.post-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 0 0 1px var(--border-color);
    margin-bottom: 0.75rem;
}

.post-username {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    display: block;
}

.post-role {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    display: inline-block;
}
.role-admin {
    background-color: #fee2e2;
    color: #991b1b;
}
.role-mod {
    background-color: #dbeafe;
    color: #1e40af;
}
.role-user {
    background-color: #f3f4f6;
    color: #374151;
}

.post-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.post-main {
    flex: 1;
    padding: 1.5rem 1.5rem 0.5rem 1.5rem;
    display: flex;
    flex-direction: column;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.post-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.post-number {
    color: var(--text-muted);
    font-size: 0.85rem;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
}

.post-body {
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    line-height: 1.7;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    min-width: 0;
}

table {
    overflow-wrap: normal;
    word-break: normal;
}

.post-body p {
    margin-bottom: 1rem;
}
.post-body p:last-child {
    margin-bottom: 0;
}

.code-block {
    background-color: #1f2937;
    color: #e5e7eb;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-family: "Menlo", "Monaco", "Courier New", monospace;
    font-size: 0.875rem;
    overflow-x: auto;
    margin: 1rem 0;
    border: 1px solid #374151;
}

.post-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    justify-content: center;
    gap: 0.33rem;
}

.quick-reply-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 2rem;
}

.reply-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

textarea.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    min-height: 120px;
    resize: vertical;
    margin-bottom: 1rem;
}
textarea.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* --- PAGINATION --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}
.page-link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-main);
    font-size: 0.9rem;
}
.page-link.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}
.page-link:hover:not(.active) {
    background-color: #f9fafb;
    border-color: var(--text-muted);
}

/* --- SIDEBAR WIDGETS --- */
.sidebar-widget {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.widget-title {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}
.leaderboard-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.leaderboard-list li {
    border-bottom: 1px #e5e7eb dashed;
    padding-bottom: 5px;
}

.leaderboard-list li > div > img {
    margin-right: 5px;
}

.leaderboard-list li > div:nth-child(1) {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
}

.forum-stats-list li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.forum-stats-list span {
    color: var(--text-main);
    font-weight: 600;
}

/* --- FOOTER --- */
.footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: auto;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Code-specific elements */
.forum-code-sample pre,
.forum-code-sample code,
code {
    white-space: pre-wrap; /* Preserve whitespace, wrap when needed */
    word-break: break-all; /* Break at any character for code */
    overflow-wrap: break-word; /* Fallback for broader compatibility */
}

.forum-code-sample {
    width: 90%;
    margin: 0 auto 1em auto;
    overflow: auto;
    max-width: 820px;
}

.code-block-header {
    margin-top: 1em;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0.6em 1em 0 1em;
}

.code-block-header > div:nth-child(1) {
    font-family: "Courier New", Courier, monospace;
}

.code-block-header > div:nth-child(2) {
    cursor: pointer;
    font-size: 1.1em;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 0;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 12px 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(88, 91, 200, 0.1);
    transition: transform 0.3s ease;
}

.stat-card h3 {
    font-size: 32px;
    font-weight: 700;
    color: #585bc8;
    margin-top: 0;
    padding-top: 0;
    margin-bottom: 5px;
}

.stat-card p {
    color: #666;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
}

.xl {
    font-size: 1.5em;
}
.lg {
    font-size: 1.3em;
}
.sm {
    font-size: 0.85em;
}
.xs {
    font-size: 0.7em;
}

.mt-0 {
    margin-top: 0 !important;
}
.mt-1 {
    margin-top: 1em !important;
}
.mt-2 {
    margin-top: 2em !important;
}
.mt-3 {
    margin-top: 3em !important;
}
.mt-4 {
    margin-top: 4em !important;
}
.mt-5 {
    margin-top: 5em !important;
}
.mt-6 {
    margin-top: 6em !important;
}
.mt-7 {
    margin-top: 7em !important;
}

.spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    position: relative;
    margin: 0.6em;
}

.spinner::after {
    animation: spinning 0.5s infinite linear;
    width: 24px;
    height: 24px;
    background: 0 0;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    border-right-color: transparent;
    border-top-color: transparent;
    content: "";
    display: block;
    opacity: 1;
    padding: 0;
    position: absolute;
    z-index: 1;
}

.stats-spinner::after {
    border-color: #eee;
    border-right-color: transparent;
    border-top-color: transparent;
}

@keyframes spinning {
    0% {
        transform: rotate(0);
    }
    100% {
        transform: rotate(360deg);
    }
}

.blink {
    text-decoration: blink;
    -webkit-animation-name: blinker;
    -webkit-animation-duration: 0.5s;
    -webkit-animation-iteration-count: infinite;
    -webkit-animation-timing-function: ease-in-out;
    -webkit-animation-direction: alternate;
}

@-webkit-keyframes blinker {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.cloak {
    display: none;
}
.text-center {
    text-align: center;
}

.mx-indicator-hidden {
    display: none;
}

#mx-tick,
#mx-cross {
    max-width: 200px;
    min-width: 160px;
    margin: 33px auto;
}

.mx-circ {
    opacity: 0;
    stroke-dasharray: 130;
    stroke-dashoffset: 130;
    -webkit-transition: all 1s;
    -moz-transition: all 1s;
    -ms-transition: all 1s;
    -o-transition: all 1s;
    transition: all 1s;
}

.mx-tick {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    -webkit-transition: stroke-dashoffset 1s 0.5s ease-out;
    -moz-transition: stroke-dashoffset 1s 0.5s ease-out;
    -ms-transition: stroke-dashoffset 1s 0.5s ease-out;
    -o-transition: stroke-dashoffset 1s 0.5s ease-out;
    transition: stroke-dashoffset 1s 0.5s ease-out;
}

.mx-cross {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    -webkit-transition: stroke-dashoffset 1s 0.7s ease-out;
    -moz-transition: stroke-dashoffset 1s 0.7s ease-out;
    -ms-transition: stroke-dashoffset 1s 0.7s ease-out;
    -o-transition: stroke-dashoffset 1s 0.7s ease-out;
    transition: stroke-dashoffset 1s 0.7s ease-out;
}

.mx-trigger.mx-drawn .path,
.mx-drawn + svg .path {
    opacity: 1;
    stroke-dashoffset: 0;
}

.modal .form-field-validation-error,
.form-field-validation-error {
    border: 3px #ff0000 solid !important;
    background-color: #ff000011 !important;
}

.modal .validation-error-alert,
.validation-error-alert {
    padding: 12px 12px 0 12px;
    border-radius: 12px;
}

.modal .validation-error-alert h3,
.validation-error-alert h3 {
    margin-top: 0;
    display: flex;
    align-items: center;
    color: #ff0000;
}

.modal .validation-error-report,
.validation-error-report {
    color: #ff0000 !important;
    width: 100%;
    text-align: left;
}

.modal .validation-error-report > div,
.validation-error-report > div {
    margin-bottom: 7px;
    font-size: 14px;
}

.container-xxs {
    width: 90%;
    max-width: 450px;
    margin: 0 auto;
    padding: 1em;
}

.container-xs {
    width: 90%;
    max-width: 640px;
    margin: 0 auto;
    padding: 1em;
}

.container-sm {
    width: 90%;
    max-width: 760px;
    margin: 0 auto;
    padding: 1em;
}

.container-md {
    width: 90%;
    max-width: 820px;
    margin: 0 auto;
    padding: 1em;
}

.container-lg {
    width: 90%;
    max-width: 960px;
    margin: 0 auto;
    padding: 1em;
}

.container-xl {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1em;
}

.container-xxl {
    width: 90%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 1em;
}

.general-container {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    height: auto;
}

.winning-post,
.winning-post .post-sidebar {
    background-color: #dbfef7 !important;
}

/* --- DARK MODE (using friend's color palette) --- */
body.dark-mode {
    --primary-color: #66b3ff;
    --primary-hover: #99ccff;
    --accent-color: #38bdf8;

    --bg-body: #09080d;
    --bg-card: #1a1a1a;
    --bg-pinned: #1e293b;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --border-color: #333333;
}

body.dark-mode .category-header,
body.dark-mode .post-sidebar,
body.dark-mode .forum-row:hover,
body.dark-mode .thread-row:hover {
    background-color: #262626;
}

body.dark-mode .code-block {
    background-color: #0d1117;
    color: #c9d1d9;
    border-color: #30363d;
}

body.dark-mode .stat-card {
    background: #1a1a1a;
    border-color: rgba(88, 91, 200, 0.3);
}

body.dark-mode .stat-card h3 {
    color: #999be4;
}

body.dark-mode .page-link {
    background: #1a1a1a;
}

body.dark-mode .tag-blue {
    background-color: #1e3a5f;
    color: #93c5fd;
}

body.dark-mode .tag-green {
    background-color: #14532d;
    color: #86efac;
}

body.dark-mode .tag-gray {
    background-color: #404040;
    color: #d1d5db;
}

body.dark-mode .post-role.role-admin {
    background-color: #7f1d1d;
    color: #fecaca;
}

body.dark-mode .post-role.role-mod {
    background-color: #1e3a5f;
    color: #93c5fd;
}

body.dark-mode .post-role.role-user {
    background-color: #404040;
    color: #d1d5db;
}

body.dark-mode .post-number {
    background: #404040;
}

body.dark-mode .avatar {
    border-color: #333333;
}

body.dark-mode textarea.form-input {
    background-color: #0d1117;
    color: #e0e0e0;
    border-color: #30363d;
}

body.dark-mode .alert-reminder,
body.dark-mode .thread-controls {
    background-color: #0f172a;
    color: #38bdf8;
    border-color: #1e293b;
}

body.dark-mode .winning-post,
body.dark-mode .winning-post .post-sidebar {
    background-color: #134e4a !important;
}

body.dark-mode > section > div > div.stats-grid > div > p,
body.dark-mode .stat-card {
    color: var(--text-main);
}

body.dark-mode > section.hero {
    background: #6767d1;
}

body.dark-mode .create-thread-container,
body.dark-mode .btn-outline {
    color: #555;
}

.pagination {
    display: inline-block;
    margin-top: 1em;
}

.pagination:first-of-type {
    margin: 0 0 1em 0;
}

.pagination a {
    color: black;
    float: left;
    padding: 8px 16px;
    text-decoration: none;
    border: 1px solid #ddd;
    background-color: #fff;
}

.pagination a.active {
    background-color: var(--primary);
    color: white;
    border: 1px solid var(--primary);
}

.pagination a:hover:not(.active) {
    background-color: #fff;
    color: var(--primary);
}

.pagination a:first-child {
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
}

.pagination a:last-child {
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
}

/* --- MOBILE RESPONSIVENESS --- */

@media (max-width: 900px) {
    .hide-at-sm {
        display: none;
    }
}

@media (max-width: 900px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    .hero h1 {
        font-size: 1.5rem;
    }

    /* Homepage Forum Rows */
    .forum-row {
        flex-wrap: wrap;
        padding: 1rem;
    }
    .forum-icon {
        margin-bottom: 0.75rem;
    }
    .forum-info {
        width: 100%;
        margin-bottom: 1rem;
    }
    .forum-stats {
        display: none;
    }
    .forum-last-post {
        flex: 1 1 100%;
        padding-left: 0;
        margin-top: 0.5rem;
        padding-top: 0.75rem;
        border-top: 1px dashed var(--border-color);
    }
    .last-post-title {
        font-size: 0.9rem;
    }

    /* View Forum Thread Rows */
    .forum-subheader {
        flex-direction: column;
        align-items: flex-start;
    }
    .forum-subheader .btn {
        width: 100%;
        text-align: center;
    }
    .thread-row {
        flex-wrap: wrap;
        padding: 1rem;
    }
    .thread-icon {
        display: none;
    }
    .thread-info {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    .thread-stats {
        display: none;
    }
    .thread-last-post {
        flex: 1 1 100%;
        padding-left: 0;
        margin-top: 0.5rem;
        padding-top: 0.75rem;
        border-top: 1px dashed var(--border-color);
    }

    /* View Thread Post Cards */
    .post-card {
        flex-direction: column;
    }
    .post-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        flex-direction: row;
        text-align: left;
        padding: 1rem;
        gap: 1rem;
    }
    .post-avatar {
        width: 48px;
        height: 48px;
        margin-bottom: 0;
    }
    .post-sidebar-info {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .post-meta {
        display: none;
    }
}

.alert-reminder,
.thread-controls {
    color: rgb(113, 107, 88);
    background-color: rgb(246, 246, 214);
    border-width: 1px;
    border-style: solid;
    border-color: rgb(95, 129, 122);
    border-image: initial;

    font-size: 15px;
    line-height: 1.6em;
    margin: 1em auto;
    padding: 12px;
    border-radius: 6px;
}

.btn-set-winner {
    background-color: rgb(73, 172, 151);
    border-width: 1px;
    border-style: solid;
    border-color: rgb(67, 158, 139);
    border-image: initial;
    color: #eee;
}

.btn-set-winner:hover {
    background-color: #54c9b0;
}

.dark-mode-toggle {
    top: 3px;
    position: relative;
}
