/* =========================================================
   MyBB Dark Modern Theme — global.css
   Preserves every MyBB 1.8 class hook (.trow1, .thead, .tcat,
   .tborder, .button, .textbox, etc.) so the rest of the forum
   (forumdisplay, showthread, postbit, moderation, editor) keeps
   working. Adds a modern dark design on top of those hooks.
   ========================================================= */

/* ---------- 1. Design tokens ---------- */
:root {
	--bg: #0f172a;            /* page background */
	--bg-2: #111a30;          /* alt surface */
	--surface: #15203b;       /* card */
	--surface-2: #1b2748;     /* elevated card */
	--surface-3: #232f54;     /* row hover */
	--border: #243154;        /* hairline */
	--border-soft: #1c2747;
	--text: #e6ebf5;
	--text-soft: #aab3c8;
	--text-mute: #7c869e;
	--accent: #3b82f6;        /* primary blue */
	--accent-2: #60a5fa;
	--accent-3: #1d4ed8;
	--success: #22c55e;
	--warn: #f59e0b;
	--danger: #ef4444;
	--link: #60a5fa;
	--link-hover: #93c5fd;
	--radius: 12px;
	--radius-sm: 8px;
	--radius-lg: 16px;
	--shadow: 0 1px 0 rgba(255,255,255,0.02), 0 8px 24px rgba(0,0,0,0.25);
	--container: 1280px;
}

/* ---------- 2. Base / reset ---------- */
* { box-sizing: border-box; }

html, body {
	background: var(--bg);
	color: var(--text);
}

body {
	background: radial-gradient(1200px 600px at 80% -10%, rgba(59,130,246,0.10), transparent 60%),
				radial-gradient(900px 500px at 0% 100%, rgba(99,102,241,0.07), transparent 60%),
				var(--bg);
	color: var(--text);
	text-align: left;
	line-height: 1.5;
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
	font-size: 14px;
	overflow-y: scroll;
	-webkit-font-smoothing: antialiased;
}

a:link, a:visited { color: var(--link); text-decoration: none; }
a:hover, a:active { color: var(--link-hover); text-decoration: none; }
a img { border: 0; }

#container {
	color: var(--text);
	text-align: left;
	line-height: 1.5;
	margin: 0 auto;
	font-family: inherit;
	font-size: 14px;
	min-width: 990px;
	max-width: var(--container);
	padding: 0 20px;
}

body > #content {
	max-width: var(--container);
	margin: 0 auto;
	padding: 0 20px;
}

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

/* ---------- 3. Top navigation bar ---------- */
.mb-topbar {
	background: rgba(15, 23, 42, 0.65);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--border-soft);
	position: sticky;
	top: 0;
	z-index: 50;
}

.mb-topbar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	height: 64px;
}

.mb-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--text);
	font-weight: 700;
	font-size: 20px;
	letter-spacing: -0.01em;
}
.mb-brand:hover { color: var(--text); text-decoration: none; }
.mb-brand-icon {
	width: 32px; height: 32px;
	display: inline-flex;
	align-items: center; justify-content: center;
	color: var(--accent-2);
}
.mb-brand-icon svg { width: 28px; height: 28px; }

.mb-nav {
	display: flex;
	gap: 6px;
	align-items: center;
	list-style: none;
	margin: 0; padding: 0;
}
.mb-nav a {
	color: var(--text-soft);
	padding: 8px 14px;
	border-radius: 8px;
	font-weight: 500;
	font-size: 14px;
	display: inline-block;
	transition: color .15s ease, background .15s ease;
}
.mb-nav a:hover { color: var(--text); background: rgba(255,255,255,0.04); text-decoration: none; }
.mb-nav a.mb-nav-active { color: var(--text); position: relative; }
.mb-nav a.mb-nav-active::after {
	content: "";
	position: absolute;
	left: 14px; right: 14px; bottom: 2px;
	height: 2px;
	background: var(--accent);
	border-radius: 2px;
}

.mb-topbar-right {
	display: flex;
	gap: 10px;
	align-items: center;
}

/* ---------- 4. Buttons (override MyBB buttons) ---------- */
.mb-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 36px;
	padding: 0 16px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	border: 1px solid var(--border);
	background: var(--surface-2);
	color: var(--text);
	transition: background .15s ease, border-color .15s ease, transform .05s ease;
	text-decoration: none;
	white-space: nowrap;
	line-height: 1;
}
.mb-btn:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.mb-btn:active { transform: translateY(1px); }
.mb-btn-primary {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
}
.mb-btn-primary:hover { background: var(--accent-3); border-color: var(--accent-3); color: #fff; }
.mb-btn-ghost {
	background: transparent;
	border-color: var(--border);
}
.mb-btn-ghost:hover { background: rgba(255,255,255,0.04); }
.mb-btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.mb-btn-lg { height: 44px; padding: 0 22px; font-size: 15px; border-radius: 10px; }

/* MyBB's .button / input.button / button */
input.button, input.textbox, select, textarea, button {
	font-family: inherit;
	font-size: 14px;
}
input.textbox, textarea, select {
	background: var(--surface);
	border: 1px solid var(--border);
	color: var(--text);
	padding: 8px 10px;
	border-radius: 8px;
	outline: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}
input.textbox:focus, textarea:focus, select:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(59,130,246,0.18);
}
input.button, button, a.button {
	background: var(--accent);
	border: 1px solid var(--accent);
	color: #fff;
	padding: 8px 14px;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 500;
}
input.button:hover, button:hover, a.button:hover { background: var(--accent-3); border-color: var(--accent-3); color: #fff; text-decoration: none; }

/* ---------- 5. Layout grid (main + sidebar) ---------- */
.mb-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 24px;
	margin: 24px 0;
}
@media (max-width: 960px) {
	.mb-layout { grid-template-columns: 1fr; }
}

.mb-main { min-width: 0; }
.mb-side { min-width: 0; display: flex; flex-direction: column; gap: 14px; }

/* ---------- 6. Card primitive ---------- */
.mb-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
}
.mb-card-head {
	padding: 14px 18px;
	display: flex;
	align-items: center;
	gap: 10px;
	border-bottom: 1px solid var(--border-soft);
	color: var(--accent-2);
	font-weight: 600;
	font-size: 15px;
}
.mb-card-head .mb-toggle {
	margin-left: auto;
	color: var(--text-mute);
	cursor: pointer;
	user-select: none;
	transition: transform .2s ease, color .15s ease;
}
.mb-card-head .mb-toggle:hover { color: var(--text); }
.mb-card-head .mb-toggle.is-collapsed { transform: rotate(180deg); }
.mb-card-body { padding: 16px 18px; }
.mb-card-body.is-collapsed { display: none; }
.mb-card-foot {
	padding: 12px 18px;
	border-top: 1px solid var(--border-soft);
	color: var(--text-soft);
	font-size: 13px;
}

/* ---------- 7. Hero card (welcome) ---------- */
.mb-hero {
	background:
		radial-gradient(700px 300px at 95% 60%, rgba(59,130,246,0.45), transparent 65%),
		radial-gradient(400px 200px at 60% 0%, rgba(96,165,250,0.10), transparent 70%),
		linear-gradient(135deg, #131e3a 0%, #14213b 50%, #0f1a30 100%);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	padding: 36px 36px;
	position: relative;
	overflow: hidden;
	margin-bottom: 24px;
	min-height: 200px;
}
.mb-hero::before {
	content: "";
	position: absolute;
	right: -40px; top: 0;
	width: 65%; height: 100%;
	background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 300' preserveAspectRatio='none'><defs><linearGradient id='g' x1='0%25' y1='0%25' x2='100%25' y2='100%25'><stop offset='0%25' stop-color='%233b82f6' stop-opacity='0.0'/><stop offset='50%25' stop-color='%233b82f6' stop-opacity='0.6'/><stop offset='100%25' stop-color='%231d4ed8' stop-opacity='0.0'/></linearGradient></defs><path d='M0 180 C 100 100, 200 220, 300 160 S 500 60, 600 140 S 800 80, 900 200' fill='none' stroke='url(../../../%23g)' stroke-width='3' stroke-opacity='0.8'/><path d='M0 220 C 120 140, 220 260, 340 200 S 540 100, 660 180 S 840 120, 960 240' fill='none' stroke='url(../../../%23g)' stroke-width='2' stroke-opacity='0.55'/><path d='M0 260 C 140 180, 240 300, 380 240 S 580 140, 720 220 S 880 160, 1020 280' fill='none' stroke='url(../../../%23g)' stroke-width='1.5' stroke-opacity='0.4'/></svg>") no-repeat right center / contain;
	opacity: .9;
	pointer-events: none;
}
.mb-hero-title {
	font-size: 30px;
	font-weight: 700;
	margin: 0 0 8px;
	letter-spacing: -0.01em;
	color: #fff;
}
.mb-hero-sub {
	color: var(--text-soft);
	margin: 0 0 28px;
	font-size: 14px;
}
.mb-hero-stats {
	display: flex;
	gap: 36px;
	flex-wrap: wrap;
	position: relative;
	z-index: 1;
}
.mb-hero-stat {
	display: flex;
	gap: 12px;
	align-items: center;
}
.mb-hero-stat-icon {
	width: 36px; height: 36px;
	color: var(--accent-2);
	display: inline-flex;
	align-items: center; justify-content: center;
}
.mb-hero-stat-icon svg { width: 24px; height: 24px; }
.mb-hero-stat-num {
	font-size: 18px;
	font-weight: 700;
	color: #fff;
	line-height: 1.1;
}
.mb-hero-stat-lbl {
	font-size: 12px;
	color: var(--text-soft);
}

/* ---------- 8. Forum category (collapsible card) ---------- */
.mb-cat { margin-bottom: 18px; }
.mb-cat .mb-card-head { color: var(--accent-2); }

.mb-forum-table {
	width: 100%;
	border-collapse: collapse;
}
.mb-forum-table > tbody > tr > td {
	padding: 16px 18px;
	border-top: 1px solid var(--border-soft);
	vertical-align: middle;
}
.mb-forum-table > tbody > tr:first-child > td { border-top: 0; }
.mb-forum-table > tbody > tr:hover > td { background: rgba(255,255,255,0.015); }

.mb-forum-icon {
	width: 44px; height: 44px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 50%;
	display: inline-flex;
	align-items: center; justify-content: center;
	color: var(--accent-2);
	flex-shrink: 0;
}
.mb-forum-icon svg { width: 22px; height: 22px; flex-shrink: 0; }
.mb-forum-icon .mb-forum-icon-extra { display: inline-flex; align-items: center; justify-content: center; }
.mb-forum-icon .mb-forum-icon-extra:empty { display: none; }
.mb-forum-icon .mb-forum-icon-extra:not(:empty) + svg { display: none; }

.mb-forum-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.mb-forum-body { min-width: 0; }
.mb-forum-name {
	font-weight: 600;
	color: var(--text);
	font-size: 15px;
	margin: 0 0 2px;
}
.mb-forum-name a { color: inherit; }
.mb-forum-desc { color: var(--text-soft); font-size: 13px; line-height: 1.4; }

.mb-forum-count {
	text-align: center;
	width: 110px;
}
.mb-forum-count-num { font-weight: 700; color: var(--text); font-size: 15px; }
.mb-forum-count-lbl { color: var(--text-mute); font-size: 12px; }

.mb-forum-last {
	width: 280px;
	font-size: 13px;
	color: var(--text-soft);
	line-height: 1.4;
}
.mb-forum-last-title { color: var(--text); font-weight: 500; }
.mb-forum-last-meta { color: var(--text-mute); font-size: 12px; }
.mb-forum-last-author { color: var(--link); }
.mb-forum-last-icon {
	width: 28px; height: 28px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	color: var(--accent-2);
	margin-left: 12px;
	flex-shrink: 0;
}
.mb-forum-last-icon svg { width: 14px; height: 14px; }
.mb-forum-last-row { display: flex; align-items: center; }

.mb-forum-noview { color: var(--text-mute); font-size: 13px; }

/* Category header expand/collapse chevron */
.mb-cat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.mb-cat-title { color: var(--accent-2); font-weight: 600; font-size: 15px; }
.mb-cat-chevron {
	color: var(--text-mute);
	cursor: pointer;
	user-select: none;
	transition: transform .2s ease;
}
.mb-cat-chevron.is-collapsed { transform: rotate(180deg); }

/* ---------- 9. Sidebar blocks ---------- */
.mb-stat-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px 20px;
}
.mb-stat-grid .mb-stat-lbl { color: var(--text-soft); font-size: 13px; margin-bottom: 6px; }
.mb-stat-grid .mb-stat-num { font-size: 22px; font-weight: 700; }
.mb-stat-num.mb-green { color: var(--success); }
.mb-stat-num.mb-blue { color: var(--accent-2); }
.mb-stat-num.mb-mute { color: var(--text-mute); }

.mb-latest-list { list-style: none; margin: 0; padding: 0; }
.mb-latest-list li {
	display: flex;
	gap: 12px;
	padding: 12px 0;
	border-top: 1px solid var(--border-soft);
	align-items: center;
}
.mb-latest-list li:first-child { border-top: 0; padding-top: 4px; }
.mb-latest-icon {
	width: 36px; height: 36px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	color: var(--accent-2);
	flex-shrink: 0;
}
.mb-latest-icon svg { width: 16px; height: 16px; }
.mb-latest-body { min-width: 0; }
.mb-latest-title {
	color: var(--text);
	font-weight: 500;
	font-size: 13.5px;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
	display: block;
}
.mb-latest-time { color: var(--text-mute); font-size: 12px; }

.mb-stats-list { margin: 0; padding: 0; list-style: none; }
.mb-stats-list li {
	display: flex;
	justify-content: space-between;
	padding: 10px 0;
	border-top: 1px solid var(--border-soft);
	font-size: 13.5px;
	color: var(--text-soft);
}
.mb-stats-list li:first-child { border-top: 0; }
.mb-stats-list li strong { color: var(--text); font-weight: 600; }

/* ---------- 10. Header panel (welcome block) ---------- */
.mb-welcomebar {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 10px 16px;
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 13.5px;
	color: var(--text-soft);
}
.mb-welcomebar .mb-welcomebar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.mb-quicksearch input.textbox {
	background: var(--bg-2);
	border: 1px solid var(--border);
}
.mb-quicksearch input.button { display: none; } /* textbox acts as prompt; search icon inside */

/* ---------- 11. Content / wrapper inside page ---------- */
#content { padding: 0; }
#content .wrapper { padding: 0; }

/* ---------- 12. Tables (MyBB compatibility for forumdisplay, showthread, modcp, usercp) ---------- */
.tborder {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 0;
	margin-bottom: 18px;
	overflow: hidden;
}
.tborder > table { width: 100%; border-collapse: collapse; }

.thead {
	background: var(--surface-2);
	color: var(--text);
	padding: 10px 14px;
	font-weight: 600;
}
.thead a { color: var(--text); }

.tcat {
	background: transparent;
	color: var(--text-soft);
	padding: 10px 14px;
	font-weight: 600;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	border-bottom: 1px solid var(--border-soft);
}

.trow1, .trow2 {
	background: var(--surface);
	color: var(--text);
	padding: 10px 14px;
}
.trow2 { background: var(--surface-2); }
.trow_shaded { background: rgba(59,130,246,0.08); color: var(--text); }

.tfoot {
	background: var(--surface-2);
	color: var(--text-soft);
	padding: 10px 14px;
	border-top: 1px solid var(--border-soft);
}

/* MyBB forum status icons — repaint as circular dot */
.forum_status {
	display: inline-block;
	width: 12px; height: 12px;
	border-radius: 50%;
	background: var(--text-mute);
	vertical-align: middle;
}
.forum_status.forum_on { background: var(--success); box-shadow: 0 0 0 3px rgba(34,197,94,0.15); }
.forum_status.forum_off { background: var(--text-mute); }
.forum_status.forum_offclose { background: var(--danger); }
.forum_status.forum_offlink { background: var(--accent); }

/* ---------- 13. Navigation breadcrumbs ---------- */
.navigation {
	color: var(--text-soft);
	font-size: 13px;
	margin: 14px 0;
}
.navigation a { color: var(--text-soft); }
.navigation a:hover { color: var(--text); }
.navigation .active { color: var(--text); }

/* ---------- 14. Pagination ---------- */
.pagination {
	font-size: 13px;
	color: var(--text-soft);
}
.pagination a, .pagination .pagination_current {
	display: inline-block;
	padding: 4px 10px;
	margin: 0 2px;
	border-radius: 6px;
	background: var(--surface-2);
	color: var(--text);
	border: 1px solid var(--border);
}
.pagination a:hover { background: var(--surface-3); text-decoration: none; }
.pagination .pagination_current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- 15. Notices / alerts ---------- */
.red_alert, .pm_alert, div.error {
	background: rgba(239,68,68,0.10);
	border: 1px solid rgba(239,68,68,0.35);
	color: #fecaca;
	padding: 10px 14px;
	border-radius: 8px;
	margin-bottom: 12px;
}
.pm_alert { background: rgba(59,130,246,0.10); border-color: rgba(59,130,246,0.35); color: #bfdbfe; }

/* ---------- 16. Footer ---------- */
.mb-footer {
	margin: 40px 0 0;
	padding: 18px 0;
	border-top: 1px solid var(--border-soft);
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	font-size: 13px;
	color: var(--text-soft);
	flex-wrap: wrap;
}
.mb-footer a { color: var(--text-soft); }
.mb-footer a:hover { color: var(--text); }
.mb-footer-links { display: flex; gap: 24px; }
.mb-back-to-top {
	width: 36px; height: 36px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	color: var(--text-soft);
}
.mb-back-to-top:hover { color: var(--text); background: var(--surface-3); text-decoration: none; }

/* MyBB's old #footer and #content (for compatibility on other pages) */
#footer { display: none; } /* we replaced it with mb-footer */

/* ---------- 17. Small utilities ---------- */
.smalltext { color: var(--text-soft); font-size: 12.5px; }
.mb-mt-0 { margin-top: 0 !important; }
.mb-mb-0 { margin-bottom: 0 !important; }
.mb-row { display: flex; align-items: center; gap: 8px; }
.mb-flex-1 { flex: 1 1 auto; min-width: 0; }
.mb-mute { color: var(--text-mute); }
.mb-right { text-align: right; }
.mb-center { text-align: center; }

/* ---------- 18. Sub-forums list ---------- */
.mb-subforums { color: var(--text-mute); font-size: 12px; margin-top: 4px; }
.mb-subforums a { color: var(--text-soft); }
.mb-subforums a:hover { color: var(--text); }

/* ---------- 19. Forum legend (small icons at bottom) ---------- */
.forum_legend { color: var(--text-soft); font-size: 12.5px; margin-top: 12px; }
.forum_legend dt, .forum_legend dd { display: inline-block; margin: 4px 8px 4px 0; }
.forum_legend .forum_status { margin-right: 6px; }

/* ---------- 20. Modal quick login (override MyBB) ---------- */
.modal {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	color: var(--text);
}
.modal a { color: var(--link); }

/* ---------- 21. MyBB forum on/off icons - we replace with a clean dot system above ---------- */
.forum_on, .forum_off, .forum_offclose, .forum_offlink {
	width: 12px; height: 12px;
}

/* Hide legacy MyBB header structure that's been replaced */
#header, #panel { display: none; }
#logo, #logo .wrapper { display: none; }

/* Keep task image / debug stuff readable */
#debug { color: var(--text-mute); font-size: 12px; }
