/* ============================================================
   LEGACY UTHERVERSE & RLC UNIVERSAL STYLE ENGINE
   ============================================================ */

/* 1. THEME DEFINITIONS */
:root, .theme-utv {
    --primary: #FF8C00; /* Classic Utherverse Orange */
    --primary-hover: #e67e00;
    --accent: #27ae60;
    --bg: #f1f5f9;
    --panel-bg: #ffffff;
    --text: #1e293b;
    --header-text: #ffffff;
    --header-bg: #000000;
    --border: #cbd5e1;
    --radius: 0px !important;
}

.theme-rlc {
    --primary: #FF0000; /* Classic Red Light Center Red */
    --primary-hover: #cc0000;
    --neon: #61ff69; /* Neon Green accent */
    --accent: #61ff69;
    --bg: #121212;
    --panel-bg: #1e1e1e;
    --text: #e2e8f0;
    --header-text: #ffffff;
    --header-bg: #000000;
    --border: #800000;
    --radius: 0px !important;
}

/* 2. CORE LAYOUT */
body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* 3. AUTHENTIC SECTION HEADERS (Strict 21px Legacy) */
.section-header, h1, .list-header, .gate-header, .app-header {
    height: 21px !important;
    background: #000000 url('https://www.utherverse.com/images/t2/sec-header-bg-bk.gif') repeat-x !important;
    color: var(--header-text) !important;
    font-weight: bold !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    display: flex;
    align-items: center;
    padding: 0 10px !important;
    border-radius: 0px !important;
    margin: 0 0 15px 0;
    border-left: 4px solid var(--primary) !important;
    box-sizing: border-box;
}

/* 4. NAVIGATION & TABS */
.tab-nav { 
    display: flex; 
    gap: 5px; 
    margin-bottom: 25px; 
    border-bottom: 2px solid var(--border); 
    padding-bottom: 10px; 
}

.tab-btn { 
    padding: 10px 20px; 
    border: 1px solid var(--border); 
    border-bottom: none; 
    background: #eee; 
    cursor: pointer; 
    font-weight: bold; 
    color: #666; 
    border-radius: 0px !important; 
    font-size: 11px; 
    text-transform: uppercase;
    display: inline-block;
}

.tab-btn.active { 
    background: var(--panel-bg) !important; 
    color: var(--primary) !important; 
    border-top: 3px solid var(--primary) !important; 
    border-bottom: 1px solid var(--panel-bg) !important;
    margin-bottom: -11px;
    z-index: 1;
}

/* 5. BUTTONS */
.btn, .system-accent {
    background-color: var(--primary) !important;
    color: #ffffff !important;
    border: 1px solid rgba(0,0,0,0.1);
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 0px !important;
    text-decoration: none;
    display: inline-block;
    box-sizing: border-box;
}

.btn:hover { filter: brightness(1.1); }

.btn-neon {
    background-color: #61ff69 !important;
    color: #000000 !important;
    border: 1px solid #000000;
}

.theme-rlc .btn:not(.btn-neon) { color: #ffffff !important; }

.btn-block { display: block; width: 100%; text-align: center; }

/* 6. PANELS & CARDS */
.card, .container, .detail-view, .item-card, .gate-panel, .section, .invite-form {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius) !important;
    padding: 20px;
    box-shadow: none !important;
    margin-bottom: 20px;
    box-sizing: border-box;
}

/* 7. FORMS */
.form-group { margin-bottom: 15px; }

label {
    display: block;
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--text);
    text-transform: uppercase;
}

input[type="text"], input[type="email"], input[type="password"], select, textarea {
    border: 1px solid #7F9DB9 !important;
    padding: 6px;
    font-size: 12px;
    border-radius: 0px !important;
    background: #fff;
    color: #000;
    box-sizing: border-box;
}

.theme-rlc input, .theme-rlc select, .theme-rlc textarea {
    background: #2d2d2d;
    color: #fff;
    border-color: #444 !important;
}

/* 8. SIDEBAR & PORTAL LAYOUT */
#sidebar { 
    width: 240px; 
    background: #1e293b; 
    color: white; 
    display: flex; 
    flex-direction: column; 
    flex-shrink: 0; 
    border-right: 1px solid var(--primary);
}

.sidebar-header { padding: 15px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.nav-group { flex-grow: 1; padding: 10px 0; }

.nav-btn-link { 
    width: 100%; 
    padding: 10px 15px; 
    border: none; 
    background: none; 
    color: rgba(255,255,255,0.7); 
    text-align: left; 
    border-bottom: 1px solid rgba(255,255,255,0.05);
    text-decoration: none;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    display: block;
    box-sizing: border-box;
    cursor: pointer;
}

.nav-btn-link:hover { background: rgba(255,255,255,0.05); color: white; }
.nav-btn-link.active { background: var(--primary) !important; color: white !important; border-left: 4px solid #fff; }

.theme-rlc #sidebar { background: #000; border-right: 1px solid #FF0000; }

/* 9. TAB VISIBILITY LOGIC */
.section { display: none !important; }
.section.active { display: block !important; }

/* 10. UTILITIES */
.success { color: #27ae60; font-weight: bold; }
.error { color: #ef4444; font-weight: bold; }
#log-box { white-space: pre-wrap; font-family: monospace; font-size: 11px; }
.status-area { font-size: 11px; font-weight: bold; margin-bottom: 10px; min-height: 14px; text-align: center; }
