/* --- BATTLEWARZ THEME VARIABLES --- */
:root {
    --primary-red: #cf0000;
    --primary-blue: #00a8ff;
    --bg-dark: #121212;
    --glass-bg: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(255, 255, 255, 0.15);
    --text-main: #e0e0e0;
    --text-muted: #aaaaaa;
    --panel-bg: rgba(255, 255, 255, 0.05);
}

/* --- MAIN BODY & LAYOUT --- */
body {
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at 50% 0%, #2a2a2a 0%, #121212 60%);
    color: var(--text-main);
    font-family: 'Segoe UI', Tahoma, Verdana, Arial, sans-serif;
    font-size: 13px;
    text-align: center;
    line-height: 1.5;
    margin: 0;
    overflow-y: scroll;
}

/* Link Styles */
a:link, a:visited { color: #4db8ff; text-decoration: none; }
a:hover, a:active { color: #ff6666; text-decoration: none; transition: color 0.2s; }

/* The main container for content */
#container {
    color: var(--text-main);
    text-align: left;
    line-height: 1.5;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Verdana, Arial, sans-serif;
    font-size: 13px;
}

/* Wrapper */
.wrapper {
    width: 85%;
    min-width: 970px;
    max-width: 1500px;
    margin: auto auto;
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 12px;
}

/* --- HEADER & LOGO --- */
#logo {
    background: transparent;
    padding: 15px 0;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap; /* Keep side by side */
    gap: 20px;
}

#content {
    background: transparent;
    width: auto !important;
    padding: 20px 0;
    overflow: hidden;
}

/* HEADER MENU (Top Links) */
#header ul.menu {
    margin: 1rem;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-start; /* Keep aligned to right */
}

#header ul.menu li {
    display: inline-block;
}

#header ul.menu li a {
    color: #fff;
    font-weight: 700;
    font-size: 13px; 
    padding: 6px 12px; 
    border-radius: 6px;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.05); 
    border: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap; 
    display: inline-block;
}

#header ul.menu li a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

/* --- PANEL (Welcome Back & User Links) --- */
#panel {
    background: var(--panel-bg); 
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3); 
    /* Remove flex column here to let internal divs behave normally, then we fix insides */
}

#panel .upper {
    background: rgba(40, 40, 40, 0.8); 
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.1); 
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

#panel .upper a:link, #panel .upper a:visited {
    color: #fff;
    font-weight: bold;
    margin-left: 10px;
    white-space: nowrap;
}

#panel .upper a:hover { color: var(--primary-blue); }

/* Panel Lower (User CP etc) - FINAL FIX FOR ONE ROW */
#panel .lower {
    background: rgba(40, 40, 40, 0.8);
    color: #ddd;
    padding: 8px 15px; 
    font-size: 11px;
    display: flex; 
    flex-direction: row; /* Force row direction */
    flex-wrap: nowrap;   /* No wrapping */
    justify-content: flex-start; /* Align left */
    align-items: center;
    border-top: none;
    gap: 0; /* Reset gap, control via margins */
    overflow: hidden; /* Prevent spillover */
}

/* Target the ULs specifically to sit inline */
#panel .lower ul.panel_links,
#panel .lower ul.user_links {
    margin: 0;
    padding: 0;
    display: inline-flex; /* Use inline-flex */
    flex-direction: row;
    align-items: center;
}

/* Override float behavior if MyBB injects it */
#panel .lower ul.panel_links { float: none !important; margin-right: 10px; }
#panel .lower ul.user_links { float: none !important; }

#panel .lower ul.panel_links li,
#panel .lower ul.user_links li {
    display: inline-block;
    list-style: none;
}

#panel .lower a:link, #panel .lower a:visited {
    color: #ddd; 
    font-weight: 600;
    white-space: nowrap;
    padding: 4px 8px; 
    margin-right: 5px; /* Spacing between buttons */
    background: rgba(0,0,0,0.2); 
    border-radius: 4px;
    border: 1px solid transparent;
    display: inline-block;
}

#panel .lower a:hover {
    color: #fff; 
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    text-shadow: 0 0 5px var(--primary-blue);
}


/* --- GLASSMORPHISM TABLES --- */
.tborder {
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    border-radius: 8px;
    width: 100%;
    margin: auto auto;
    padding: 0;
    overflow: hidden;
}

.thead {
    background: linear-gradient(90deg, #222, #333);
    border-bottom: 2px solid var(--primary-red);
    color: #ffffff;
    padding: 12px;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 14px;
}
.thead a:link, .thead a:visited { color: #ffffff; }
.thead a:hover, .thead a:active { color: #ccc; text-decoration: underline; }

.tcat {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-bottom: 1px solid var(--glass-border);
    padding: 10px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}
.tcat a:link, .tcat a:visited { color: #fff; }

.trow1 {
    background: rgba(40, 40, 40, 0.4);
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 10px;
}

.trow2 {
    background: rgba(60, 60, 60, 0.4);
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 10px;
}

.trow_shaded {
    background: rgba(207, 0, 0, 0.15);
    border-bottom: 1px solid var(--primary-red);
}

.trow_selected, tr.trow_selected td {
    background: rgba(0, 168, 255, 0.2);
    color: #fff;
}

/* Postbit */
.post.classic .post_author {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    margin: 0 1% 15px 0;
    border-radius: 6px;
    padding: 10px;
}

.post_author {
    border-bottom: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-border);
    background: transparent;
}

/* --- BUTTONS & INPUTS --- */
button, input.button {
    padding: 6px 12px; 
    margin: 5px; 
    cursor: pointer;
    font-family: 'Segoe UI', sans-serif;
    font-size: 12px; 
    background: var(--primary-red);
    border: none;
    color: #fff;
    outline: 0;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    display: inline-block;
}

button:hover, input.button:hover {
    background: #ff3333;
    box-shadow: 0 0 15px rgba(207, 0, 0, 0.6);
}

a.button:link, a.button:hover, a.button:visited, a.button:active {
    background: rgba(255,255,255,0.1); 
    color: #fff;
    display: inline-block;
    padding: 6px 12px; 
    margin: 5px; 
    border: 1px solid rgba(255,255,255,0.2); 
    font-size: 11px;
    border-radius: 4px;
    white-space: nowrap; 
    line-height: normal;
}

a.button:hover {
    background: #fff;
    color: #000; 
    border-color: #fff;
}

/* Inputs/Textareas */
input.textbox, textarea, select {
    background: rgba(255,255,255,0.1); 
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 8px;
    outline: 0;
    font-family: 'Segoe UI', sans-serif;
    font-size: 13px;
    border-radius: 4px;
}

input.textbox:focus, textarea:focus {
    border-color: var(--primary-blue);
    background: rgba(255,255,255,0.15);
}

/* --- UTILITIES & NAVIGATION --- */
#footer ul.menu {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

#footer ul.menu li a {
    color: #888;
    font-weight: bold;
    white-space: nowrap;
}
#footer ul.menu li a:hover { color: #fff; }

#footer .upper {
    background: rgba(30, 30, 30, 0.9);
    border-top: 1px solid #444;
    border-bottom: 1px solid #444;
    padding: 15px;
    color: #aaa;
}

/* Fix for icons */
.forum_status { filter: grayscale(100%); opacity: 0.8; }
.forum_on { filter: none; opacity: 1; } 

/* Blockquote & Code */
blockquote {
    border: 1px solid var(--primary-red);
    margin: 0;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-left-width: 4px;
    color: #e0e0e0;
    border-radius: 4px;
}

.codeblock {
    background: #1a1a1a;
    border: 1px solid #333;
    padding: 10px;
    color: #0f0;
    border-radius: 4px;
}

/* Pagination */
.pagination a {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #ccc;
    border-radius: 3px;
}

.pagination .pagination_current {
    background: var(--primary-red);
    color: #fff;
    border: none;
    font-weight: bold;
    border-radius: 3px;
}

/* Misc */
.tfoot {
    border-top: 1px solid var(--glass-border);
    background: rgba(30,30,30,0.8);
    color: #aaa;
    padding: 10px;
}

.bottommenu {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    padding: 10px;
    color: #aaa;
    border-radius: 6px;
    margin-top: 10px;
}