@import url('font/css/icons.css');
@import url('font/css/font-awesome.css');

/* ── Utility ────────────────────────────────────────────────────────────── */
.hide        { display: none; }
.bold        { font-weight: bold; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.margin-auto { margin: auto; }
.pointer     { cursor: pointer; }
.float-right { float: right; }
.float-left  { float: left; }

.flex        { display: flex; }
.center      { justify-content: center; }
.around      { justify-content: space-around; }
.between     { justify-content: space-between; }
.align-items { align-items: center; }

.spacer       { margin: 10px 0; }
.spacer-med   { margin: 20px 0; }
.spacer-tiny  { margin-bottom: .15em; }
.spacer-small { margin: 3px 0; }
.spacer-large { margin: 30px 0; }

.grow       { transition: all .2s ease-in-out; }
.grow:hover { transform: scale(1.1); }

.mb5 { margin-bottom: 5px; }
.m5  { margin: 5px; }
.m8  { margin: 8px; }
.m10 { margin: 10px; }
.mt15 { margin-top: 15px; }
.p3  { padding: 3px; }
.flag-input { width: 20px; text-align: center; }

/* ── Reset / Base ───────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    text-rendering: optimizeLegibility;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background: var(--background);
    color: var(--font-color);
    font-size: 14px;
    line-height: 1.4;
    overflow: hidden;
}

img {
    background: url('/assets/loading.gif') center/contain no-repeat;
}

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

::selection { background: var(--selection-highlight); }

/* ── Typography ─────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family);
    font-weight: 500;
    line-height: 1.1;
    color: inherit;
    text-shadow: -1px -1px 0 rgba(0,0,0,.3);
}
.h3, h3 { font-size: 28px; }
.h1, .h2, .h3 { margin-top: 20px; margin-bottom: 10px; }

.link {
    color: var(--link);
    text-decoration: none;
    cursor: pointer;
}
.link:hover {
    color: var(--link-hover);
    text-decoration: underline;
    transition: all 0.3s ease;
}

/* ── Theme role classes ─────────────────────────────────────────────────── */
.panel      { background: var(--panel-background); color: var(--panel-font-color); }
.subject    { color: var(--subject-color); }
.author     { color: var(--poster-name); }
.trip       { color: var(--poster-trip); }
.admin      { color: var(--admin-color); }
.mod        { color: var(--mod-color); }
.post-date  { color: var(--post-date); }
.post-number { color: var(--post-number); cursor: pointer; }

/* ── Navigation ─────────────────────────────────────────────────────────── */
nav {
    background: var(--nav-background);
    border-bottom: var(--nav-border);
}
.nav-link { color: var(--nav-link); cursor: pointer; }
.nav-link:hover { color: var(--nav-link-hover); transition: all 0.3s ease; }

.navbar {
    display: flex;
    justify-content: space-between;
    height: 52px;
    background-image: linear-gradient(#484e55, #3a3f44 60%, #313539);
    border-bottom: 1px solid rgba(0,0,0,.6);
    text-shadow: 1px 1px 1px rgba(0,0,0,.3);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 10;
}
.navbar > .navbar-items {
    padding-top: 12px;
    color: #ccc;
    cursor: pointer;
}
.navbar-items > .navbar-brand {
    color: #fff;
    padding: 15px;
    border-right: 1px solid rgba(255,255,255,.1);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
}
.navbar-items > .navbar-item {
    padding: 16px;
    margin-left: -5px;
    border-right: 1px solid rgba(0,0,0,.2);
    font-weight: 500;
    letter-spacing: .01em;
}
.navbar-items > .navbar-item:hover {
    color: #fff;
    background-image: linear-gradient(#020202, #101112 40%, #191b1d);
}

.welcome-user {
    align-self: center;
    display: flex;
    padding: 15px;
    text-shadow: 1px 1px 1px rgba(0,0,0,.3);
}

.icon-cog.header-item   { cursor: pointer; font-size: 16px; color: #ddd; }
.icon-wrench.header-item { cursor: pointer; font-size: 16px; margin-right: 2px; color: #dc463d; }
.icon-attention-3       { cursor: pointer; color: rgba(255,220,0,.8); }

/* ── Dropdown ───────────────────────────────────────────────────────────── */
.show { display: block !important; }

.dropdown-menu {
    position: fixed;
    top: 52px;
    left: 110px;
    z-index: 1000;
    display: none;
    min-width: 160px;
    padding: 5px 0;
    list-style: none;
    font-size: 14px;
    background-color: #3a3f44;
    border: 1px solid rgba(0,0,0,.3);
    border-radius: 2px;
    box-shadow: 0 6px 12px rgba(0,0,0,.3);
}
.dropdown-menu > li > span {
    display: block;
    padding: 7px 20px;
    font-weight: 400;
    line-height: 1.5;
    color: #c8c8c8;
    white-space: nowrap;
    cursor: pointer;
}
.dropdown-menu > li > span:hover {
    color: #fff;
    background-color: #272b30;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.container {
    width: 1170px;
    margin: 0 auto;
    padding: 95px 15px 0;
}

/* ── Forms & Inputs ─────────────────────────────────────────────────────── */
input[type="submit"], input[type="text"], input[type="password"],
input[type="button"], select {
    background: var(--input-background);
    color: var(--input-color);
    border: var(--input-border);
    font-size: 9pt;
}
textarea {
    background: var(--input-background);
    color: var(--input-color);
    border: var(--input-border);
    font-size: 9pt;
}
input[type="checkbox"] {
    background: rgba(0,0,0,.4);
    border: 1px solid rgba(255,255,255,.3);
    height: 10px;
    width: 10px;
    border-radius: 2px;
}
input[type="checkbox"]:checked { background: rgba(255,255,255,.4) !important; }

button, input, optgroup, select, textarea {
    color: inherit;
    font: inherit;
    font-size: inherit;
    line-height: inherit;
    font-family: inherit;
    margin: 0;
}

.form-control {
    display: block;
    width: 100%;
    height: 32px;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.42857143;
    color: #272b30;
    background-color: #fff;
    background-image: none;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
    transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
input.form-control[type="text"],
input.form-control[type="password"],
input.form-control[type="email"],
textarea.form-control {
    background-color: #161a20 !important;
    color: #c8c8c8;
}
.navbar > .navbar-form {
    margin: 6px -15px;
    padding-right: 25px;
    width: auto;
    border-top: 1px solid transparent;
}
.navbar > .navbar-form .form-group {
    display: inline-block;
    margin-bottom: 0;
    vertical-align: middle;
}
.navbar > #loginform > .form-group { margin-right: 5px; }

fieldset { margin: 4px 0; }
fieldset label { display: block; padding: 5px; }
legend { padding-left: 5px !important; padding-right: 5px !important; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
    padding: 5.4px 12px;
    font-size: 14px;
    line-height: 1.4;
    border-radius: 4px;
    border: 1px solid transparent;
    text-shadow: 1px 1px 1px rgba(0,0,0,.3);
}
.btn:hover { color: #fff; text-decoration: none; }
.btn-default {
    color: #fff;
    background-color: #3a3f44 !important;
    border-color: rgba(0,0,0,.6) !important;
    background-image: linear-gradient(#484e55, #3a3f44 60%, #313539) !important;
}
.btn-default:hover {
    background-image: linear-gradient(#020202, #101112 40%, #191b1d) !important;
}
.btn-default.active, .btn-default:active, .btn-default:focus {
    color: #fff;
    background-color: #232628;
    border-color: #1e2023;
}

/* ── Tables ─────────────────────────────────────────────────────────────── */
table {
    background-color: #2e3338;
    border-collapse: collapse;
    border-spacing: 0;
}
.table { width: 100%; max-width: 100%; margin-bottom: 20px; }
.table-bordered,
.table-bordered > tbody > tr > td,
.table-bordered > tbody > tr > th,
.table-bordered > tfoot > tr > td,
.table-bordered > tfoot > tr > th,
.table-bordered > thead > tr > td,
.table-bordered > thead > tr > th {
    border: 1px solid #1c1e22;
}
.table-striped > tbody > tr:nth-child(odd) { background-color: #353a41; }
th { padding: 4px 3px; }
td { padding: 4px 3px; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
footer {
    width: 100%;
    min-height: 60px;
    background-color: #161a20 !important;
    position: absolute;
    bottom: 0;
}
.credit { color: #7a8288; margin: 20px 0; text-align: center; }

/* ── Pocket / Options overlay ───────────────────────────────────────────── */
.pocket-wrapper {
    display: none;
    position: fixed;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 25;
}
.pocket-content {
    background-color: #272b30;
    color: #999;
    border: var(--options-border);
    position: relative;
    width: 600px;
    height: 360px;
    z-index: 25;
    margin: 51px auto;
}
.pocket-overlay {
    background: black;
    opacity: 0.5;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    z-index: -1;
}
.pocket-close {
    top: 0; right: 0;
    position: absolute;
    margin-right: 3px;
    font-size: 20px;
    z-index: 100;
}
.pocket-menu {
    background-color: #272b30;
    padding: 15px 5px;
    left: 0; top: 0; bottom: 0;
    width: 90px;
    height: 100%;
    border-right: 1px solid black;
}
.pocket-tab {
    padding: 10px;
    position: absolute;
    top: 0; bottom: 10px; left: 101px; right: 0;
    text-align: left;
    font-size: 12px;
    overflow-y: auto;
}
.pocket-tab h2    { text-align: center; margin-bottom: 5px; }
.pocket-menu-icon { text-align: center; padding: 5px; cursor: pointer; }
.pocket-menu-icon.active { color: #fff; }

/* ── Tabs ───────────────────────────────────────────────────────────────── */
.tabcontent  { display: none; }
.tab button.active { background-color: #ccc; }
#modDiv { display: none; }

/* ── Board / Thread images ──────────────────────────────────────────────── */
.image {
    width: 300px;
    height: 300px;
}
.clone-image {
    margin-top: 28px;
    position: absolute;
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 100%;
    z-index: 1001;
    pointer-events: none;
}

/* ── Server List ────────────────────────────────────────────────────────── */
.tl-container {
    height: calc(100vh - 52px);
    overflow-y: auto;
    padding: 20px 24px 60px;
    margin-top: 52px;
}

.tl-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.tl-filter-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    margin-right: 2px;
}
.tl-filter-sep {
    width: 1px;
    height: 18px;
    background: #444;
    margin: 0 4px;
}
.tl-filter-btn {
    padding: 4px 12px;
    border-radius: 3px;
    border: 1px solid #444;
    background: #2a2f36;
    color: #aaa;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tl-filter-btn:hover {
    background: #353a41;
    color: #ddd;
    border-color: #555;
}
.tl-filter-btn.active,
.tl-filter-btn.active-game {
    background: #3d5a80;
    color: #e0e8f5;
    border-color: #3d5a80;
}

.tl-heading {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #888;
    margin-bottom: 12px;
    text-shadow: none;
}

.server-card {
    border: 1px solid rgba(0,0,0,.25);
    border-radius: 3px;
    margin-bottom: 8px;
    overflow: hidden;
    background-color: #353a41;
}

.server-summary {
    display: flex;
    align-items: stretch;
    cursor: pointer;
    height: 140px;
    user-select: none;
}
.server-summary:hover .server-info {
    background-color: #3c4249;
}

.server-thumb {
    height: 140px;
    width: 280px;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
    background: #272b30;
}

.server-info {
    flex: 1;
    padding: 14px 18px;
    background-color: #353a41;
    color: #f0f0f0;
    transition: background 0.15s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.server-top {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.server-name {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.3;
    margin: 0;
    text-shadow: none;
}

.server-game-tag {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #888;
    background: rgba(0,0,0,.3);
    padding: 2px 6px;
    border-radius: 2px;
    flex-shrink: 0;
}

.server-addr {
    font-size: 12px;
    color: #999;
    font-family: monospace;
    margin-top: 4px;
}

.server-desc-line {
    font-size: 12px;
    color: #888;
    font-style: italic;
    margin-top: 2px;
    margin-bottom: 2px;
}

.server-desc-inline {
    font-family: var(--font-body);
    font-style: italic;
    color: #777;
    font-size: 11px;
}

.server-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    flex-wrap: wrap;
}
.server-stat { display: flex; align-items: center; gap: 4px; }
.server-stat a { color: #7fdbff; text-decoration: none; }
.server-stat a:hover { text-decoration: underline; }
.meta-sep    { color: #555; }

.status-online  { color: #3d9970; font-weight: 600; }
.status-offline { color: #ff4136; font-weight: 600; }

.expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    flex-shrink: 0;
    background-color: #2a2f35;
    color: #666;
    font-size: 16px;
    transition: color 0.15s, background 0.15s;
}
.server-summary:hover .expand-btn {
    color: #aaa;
    background-color: #252a30;
}
.server-card.open .expand-btn i {
    transform: rotate(180deg);
}
.expand-btn i {
    transition: transform 0.2s ease;
}

/* ── Server Detail Panel ────────────────────────────────────────────────── */
.server-detail {
    display: none;
    background-color: #272b30;
    border-top: 1px solid rgba(0,0,0,.35);
    padding: 18px 22px;
    animation: slideDown 0.15s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.server-detail.open { display: block; }

.detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 32px;
}
.detail-col {}

.detail-section {
    margin-bottom: 18px;
}
.detail-section h4 {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #666;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255,255,255,.05);
    text-shadow: none;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 12px;
    border-bottom: 1px solid rgba(255,255,255,.03);
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: #777; }
.detail-value { color: #ccc; font-weight: 400; text-align: right; }
.detail-value a { color: #7fdbff; }
.detail-value a:hover { color: #b0ecff; text-decoration: underline; }
.detail-aside { color: #666; font-size: 11px; }
.detail-value code {
    font-family: monospace;
    font-size: 11px;
    background: rgba(0,0,0,.3);
    padding: 1px 5px;
    border-radius: 2px;
    color: #adf;
}

.map-thumb {
    display: block;
    width: 100%;
    max-width: 240px;
    border-radius: 3px;
    margin-bottom: 10px;
    opacity: 0.9;
    transition: opacity 0.2s;
}
.map-thumb:hover { opacity: 1; }

/* ── Legacy list classes (board use) ────────────────────────────────────── */
.list {
    width: 100%;
    height: calc(100vh - 50px);
    font-weight: 400;
    border-bottom: 1px solid rgba(0,0,0,.22);
    transition: background 0.3s ease;
    overflow: auto;
}
.list .item {
    height: 150px;
    width: 100%;
    position: relative;
    border: 1px solid rgba(0,0,0,.1);
}
.list .item img {
    height: 149px;
    width: 334px;
    float: left;
}
.list .item .info {
    height: 100%;
    overflow: hidden;
    background-color: #353a41;
    padding: 1em;
    color: #FAFAFA;
}
.list .item .info h1 { display: inline-block; margin: 0; font-weight: 400; line-height: 55px; }
.list .item .info h2 { display: inline-block; margin: 0; font-weight: 300; line-height: 55px; }
.list .item .info span { display: inline-block; line-height: 55px; font-size: 2em; margin: 0 1em; }
.list .item .info .bottom { height: 55px; display: block; }
.list .item .info .bottom h2 { display: inline-block; margin: 0; font-weight: 300; line-height: 55px; }
.list .item .info .bottom span { display: inline-block; margin: 0 0 0 .5em; font-weight: 300; line-height: 55px; font-size: 20px; }
.list .item .info .bottom span.seperator { display: inline-block; line-height: 55px; font-size: 2em; margin: 0 1em; }
.list .item .info .join { position: absolute; right: 0; top: 0; height: 150px; width: 150px; text-align: center; }
.list .item .info .join i { display: block; line-height: 150px; cursor: pointer; font-size: 50px; transition: all 0.3s ease; margin: 0 0 0 -1em; }
.list .item .info .join:hover i { margin: 0; }
