/* =====================================================
   Natural-Dark Theme for SourceBans++ — -=SwGb=- Gaisburg
   v1.1 — Proper layout fix
   ===================================================== */

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #1c2333;
  --bg-card: #1e2430;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --accent-green: #3fb950;
  --accent-red: #f85149;
  --accent-orange: #f0883e;
  --text-primary: #c9d1d9;
  --text-secondary: #8b949e;
  --text-white: #e6edf3;
  --border: #30363d;
}

/* ===== BASE ===== */
body {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 12px;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    text-align: center;
}

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

/* ===== HEADER ===== */
#header {
    background: linear-gradient(180deg, #0d1117 0%, #161b22 100%);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#head-logo { float: none; margin-top: 0; }
#head-logo img { height: 44px; }

#search {
    text-align: right;
    margin-top: 0;
}

.searchbox {
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border) !important;
    border-radius: 6px;
    color: var(--text-primary) !important;
    font-size: 11px;
    padding: 6px 10px;
    width: 160px;
    transition: border-color 0.2s;
}
.searchbox:focus { outline: none; border-color: var(--accent) !important; }

.button {
    background: var(--accent) !important;
    border: none !important;
    border-radius: 4px;
    color: #0d1117 !important;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    transition: background 0.2s;
}
.button:hover { background: var(--accent-hover) !important; }

/* ===== TABS / NAVIGATION ===== */
#tabsWrapper {
    background: var(--bg-secondary) !important;
    border-bottom: 1px solid var(--border);
    height: auto !important;
    min-height: 44px;
    width: 100%;
}

#tabs {
    float: none !important;
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    position: relative;
}

#tabs ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: nowrap;
    flex: 1;
}

#tabs ul li {
    float: none !important;
}

#tabs ul li a {
    display: block;
    padding: 0 14px !important;
    line-height: 44px !important;
    color: var(--text-secondary) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif !important;
    font-size: 12px !important;
    font-weight: 500;
    text-transform: none !important;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    text-decoration: none !important;
}

#tabs ul li a:hover, #tabs ul li.active a {
    color: var(--text-white) !important;
    background: transparent !important;
    border-bottom-color: var(--accent);
    text-decoration: none !important;
}

/* ===== ADMIN NAV ===== */
#nav {
    position: static !important;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: inherit !important;
    font-size: 11px !important;
    color: var(--text-secondary) !important;
}

a.nav_link:link, a.nav_link:visited {
    color: var(--text-secondary) !important;
    background: var(--bg-tertiary);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 500;
}
a.nav_link:hover { color: var(--accent) !important; text-decoration: none !important; }
#nav a.active { color: var(--accent) !important; }

/* ===== LOGIN / LOGOUT BUTTON (override inline styles) ===== */
#tabs div[style*="float"] {
    float: none !important;
    margin-left: auto;
    display: flex;
    align-items: center;
}
#tabs div[style*="float"] ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}
#tabs div[style*="float"] ul li {
    float: none !important;
}
/* Override the inline style green/red backgrounds */
#tabs a[href*="p=login"],
#tabs a[style*="70B04A"] {
    background: var(--accent) !important;
    color: #0d1117 !important;
    border-radius: 5px;
    padding: 6px 14px !important;
    font-size: 12px !important;
    font-weight: 700;
    line-height: 1 !important;
    display: inline-block;
    margin: auto 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
#tabs a[href*="p=logout"],
#tabs a[style*="B8383B"] {
    background: var(--accent-red) !important;
    color: white !important;
    border-radius: 5px;
    padding: 6px 14px !important;
    font-size: 12px !important;
    font-weight: 700;
    line-height: 1 !important;
    display: inline-block;
    margin: auto 8px;
}

.user {
    color: var(--text-secondary);
    font-size: 11px;
    margin-left: 8px;
}
.user a { color: var(--accent); }

/* ===== MAIN WRAPPER ===== */
#mainwrapper {
    max-width: 1200px;
    margin: 0 auto;
    text-align: left;
    padding: 0 16px;
}

#innerwrapper { text-align: left; }

#breadcrumb {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 10px 0;
    letter-spacing: 0.5px;
}
#breadcrumb a { color: var(--text-secondary); }
#breadcrumb a:hover { color: var(--accent); }

#content_title {
    font-size: 22px;
    color: var(--text-white);
    margin-bottom: 12px;
    font-weight: 600;
}

/* ===== TABLES ===== */
table { border-collapse: collapse; }

.listtable {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.listtable thead tr th {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    padding: 8px 12px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--accent);
    border-right: 1px solid var(--border);
}
.listtable thead tr th a { color: var(--text-secondary) !important; }

.listtable tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}
.listtable tbody tr:hover td { background: var(--bg-tertiary) !important; }

.listtable tbody tr td {
    padding: 7px 12px;
    color: var(--text-primary) !important;
    border-right: 1px solid rgba(48,54,61,0.3);
}

tr.row1 td { background: var(--bg-secondary) !important; }
tr.row2 td { background: rgba(22,27,34,0.6) !important; }

/* ===== HEADERS h3/h4 ===== */
h3 {
    background: linear-gradient(90deg, var(--bg-tertiary), var(--bg-card)) !important;
    color: var(--text-white) !important;
    border-left: 3px solid var(--accent);
    padding: 8px 12px !important;
    border-radius: 0 4px 0 0;
    font-size: 12px;
    margin: 0 0 2px 0;
}

h4 { color: var(--text-primary); margin: 8px 0; font-size: 12px; }

/* ===== PANELS ===== */
.block, div.dashboard-col {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 14px;
}

/* ===== BAN STATUS ===== */
.ban-active, .status-active { color: var(--accent-red) !important; font-weight: bold; }
.ban-inactive, .status-inactive { color: var(--text-secondary) !important; }
.ban-expired { color: var(--text-secondary) !important; text-decoration: line-through; }
.ban-unbanned { color: var(--accent-green) !important; }

/* ===== FORMS ===== */
input[type="text"], input[type="password"], input[type="email"], select, textarea {
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border) !important;
    border-radius: 4px;
    color: var(--text-primary) !important;
    font-size: 12px;
    padding: 5px 8px;
    transition: border-color 0.2s;
}
input[type="text"]:focus, select:focus { border-color: var(--accent) !important; outline: none; }

input[type="submit"], input[type="button"] {
    background: var(--accent) !important;
    border: none !important;
    border-radius: 4px;
    color: #0d1117 !important;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    transition: background 0.2s;
}
input[type="submit"]:hover { background: var(--accent-hover) !important; }

/* ===== LOGIN PAGE ===== */
#login {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px;
    padding: 24px;
    max-width: 400px;
    margin: 40px auto;
}
#loginLogo { margin-bottom: 16px; }
.loginmedium { font-size: 12px; color: var(--text-secondary); }
#loginSubmit input { width: 100%; margin-top: 8px; padding: 8px; font-size: 13px; }
#loginOtherlinks a { color: var(--accent); }

/* ===== SERVER PAGE ===== */
#front-servers { text-align: left; }
#serverwindow_1, div[id^="serverwindow"] {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px;
    margin-bottom: 12px;
}
div[id^="serverwindow"] p { color: var(--accent) !important; font-size: 13px !important; font-weight: 600; }
div[id^="serverwindow"] h2 { color: var(--text-secondary) !important; font-size: 12px !important; }
div[id^="serverwindow"] input.btn.game {
    background: var(--accent-green) !important;
    color: #0d1117 !important;
    border-radius: 4px;
    padding: 5px 12px;
    font-weight: 600;
}

/* ===== FOOTER ===== */
#footer {
    background: var(--bg-secondary) !important;
    border-top: 1px solid var(--border);
    color: var(--text-secondary) !important;
    font-size: 11px;
    padding: 14px 20px;
    margin-top: 30px;
}
#footer a, #footqversion a { color: var(--text-secondary) !important; }
#footer a:hover { color: var(--accent) !important; }

/* ===== ALERTS ===== */
div.warning { background: rgba(240,136,62,0.08); border: 1px solid var(--accent-orange); color: var(--accent-orange); border-radius: 4px; padding: 10px 14px; margin: 8px 0; }
.warning-heading { color: var(--accent-orange) !important; }
div.error, .error { background: rgba(248,81,73,0.08); border: 1px solid var(--accent-red); color: var(--accent-red); border-radius: 4px; padding: 8px 12px; }
div.success, .success { background: rgba(63,185,80,0.08); border: 1px solid var(--accent-green); color: var(--accent-green); border-radius: 4px; padding: 8px 12px; }

/* ===== PAGINATION ===== */
.pager, .pagination { display: flex; gap: 4px; justify-content: center; margin: 14px 0; list-style: none; padding: 0; }
.pager li a, .pagination a {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 4px 10px;
    font-size: 11px;
    text-decoration: none !important;
}
.pager li a:hover { background: var(--bg-tertiary); color: var(--accent); }
.pager li.active a { background: var(--accent); color: #0d1117; border-color: var(--accent); font-weight: 700; }

/* ===== MISC ===== */
hr { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }
.dbg { font-size: 10px; color: var(--text-secondary); }
.dbg.b { font-weight: bold; color: var(--text-primary); }

select option { background: var(--bg-tertiary); color: var(--text-primary); }

/* Tooltip */
.tool-tip, .perm-tip { background: var(--bg-tertiary) !important; border: 1px solid var(--border); border-radius: 4px; }
.tool-title, .perm-title { background: var(--bg-tertiary) !important; color: var(--text-white) !important; }
.tool-text, .perm-text { background: var(--bg-card) !important; color: var(--text-primary) !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* Responsive */
@media (max-width: 900px) {
  #tabs ul { flex-wrap: wrap; }
  #tabs ul li a { line-height: 36px !important; padding: 0 10px !important; font-size: 11px !important; }
  #mainwrapper { padding: 0 8px; }
}
