/* ═══════════════════════════════════════════════════════════
   Rext Menu — Shared Stylesheet
   Common base styles for all pages + Wiki-specific section
   ═══════════════════════════════════════════════════════════ */

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

/* ── Variables ── */
:root {
    /* Backgrounds */
    --bg:           #0b0d10;
    --bg2:          #111419;
    --bg3:          #161a22;
    --bg-card:      #12151a;
    --bg-card2:     #181c24;
    --bg-hover:     #1e1f29;
    --surface:      #171b24;
    --surface2:     #1c212c;

    /* Borders */
    --border:       #1e2530;
    --border-l:     #283040;

    /* Accent */
    --accent:       #cc6600;
    --accent2:      #e07700;
    --accent-glow:  #cc660035;
    --accent-dim:   #cc660018;

    /* Semantic Colors */
    --green:        #22c55e;
    --green-dim:    #22c55e18;
    --red:          #ef4444;
    --red-dim:      #ef444420;
    --yellow:       #eab308;
    --yellow-dim:   #eab30818;
    --blue:         #3b82f6;
    --blue-dim:     #3b82f620;
    --cyan:         #06b6d4;
    --cyan-dim:     #06b6d420;

    /* Text */
    --text:         #e2e8f0;
    --text-dim:     #94a3b8;
    --text-muted:   #64748b;

    /* Radius */
    --r:            12px;
    --r-sm:         8px;
    --r-lg:         14px;

    /* Aliases */
    --radius:       var(--r);
    --radius-sm:    var(--r-sm);
    --accent-hover: var(--accent2);
    --success:      var(--green);
    --warning:      var(--yellow);
    --danger:       var(--red);
    --info:         var(--blue);
}

/* ── Body ── */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a2f3a; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3a4050; }

/* ── Hero ── */
.hero {
    text-align: center;
    padding: 80px 20px 60px;
    background: linear-gradient(180deg, #0f1218 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    height: 500px;
    background: radial-gradient(ellipse, #99500035, transparent 70%);
    pointer-events: none;
}
.hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 12px;
    position: relative;
}
.hero h1 span { color: var(--accent); }
.hero p {
    font-size: 1.15rem;
    color: var(--text-dim);
    max-width: 560px;
    margin: 0 auto;
    position: relative;
}
.hero-badge {
    display: inline-block;
    margin-top: 24px;
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    border: 1px solid #99500080;
    border-radius: 20px;
    background: var(--accent-dim);
    position: relative;
}

/* ── Nav ── */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #0b0d10e6;
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
}
.nav-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    position: relative;
}
.nav-inner::-webkit-scrollbar { display: none; }
.nav a:not(.lang-btn) {
    padding: 14px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.nav a:not(.lang-btn):hover { color: var(--text); border-bottom-color: #99500080; }
.nav a:not(.lang-btn).active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Language Switch ── */
.lang-switch { display:flex; gap:0; margin-left:12px; background:var(--bg3,#151922); border:1px solid var(--border); border-radius:4px; padding:1px; align-self:center; }
.lang-btn { padding:3px 10px; font-size:0.6rem; font-weight:700; border:none; border-radius:3px; cursor:pointer; background:transparent; color:var(--text-muted); transition:all .2s; font-family:inherit; line-height:1.6; letter-spacing:.3px; text-decoration:none; display:inline-flex; align-items:center; }
.lang-btn:hover { color:var(--text); }
.lang-btn.active { background:var(--accent); color:#fff; }

/* ── Footer ── */
.footer {
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ── Animations ── */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.7); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ── Inline Code ── */
code {
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 12px;
    font-family: 'Consolas', monospace;
    color: var(--accent);
}


/* ═══════════════════════════════════════════════════════════
   Wiki — Page-specific Styles (body.wiki)
   ═══════════════════════════════════════════════════════════ */

body.wiki {
    /* Wiki color overrides */
    --bg:            #0d0e11;
    --bg-card:       #16171f;
    --bg-card2:      #1a1b23;
    --bg-hover:      #1e1f29;
    --accent:        #e87a20;
    --accent2:       #f09040;
    --accent-dim:    rgba(232, 122, 32, 0.15);
    --text:          #e0e0e5;
    --text-dim:      #8a8b95;
    --text-muted:    #5a5b65;
    --border:        #2a2b35;
    --border-l:      #35363f;
    --r:             10px;
    --r-sm:          6px;

    /* Wiki-only aliases */
    --bg-primary:    var(--bg);
    --bg-secondary:  #13141a;
    --bg-tertiary:   var(--bg-card2);
    --sidebar-bg:    #111218;
    --sidebar-width: 280px;
    --text-primary:  var(--text);
    --text-secondary:var(--text-dim);
    --border-light:  var(--border-l);

    /* Wiki layout overrides */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}

/* ── Sidebar ── */
#sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    overflow: hidden;
}

.sidebar-header {
    padding: 20px 18px 14px;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}
.logo i { font-size: 20px; }

.version {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.sidebar-search {
    padding: 12px 18px;
    position: relative;
}
.sidebar-search i {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 12px;
}
.sidebar-search input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: border 0.2s;
}
.sidebar-search input:focus {
    border-color: var(--accent);
}

.nav-list {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}
.nav-list::-webkit-scrollbar { width: 4px; }
.nav-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.nav-category { margin-bottom: 2px; }

/* HomePage link */
.nav-home {
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
}
.nav-home a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s;
}
.nav-home a:hover {
    background: var(--bg-hover);
    color: var(--accent);
}
.nav-home a i {
    color: var(--accent);
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.nav-cat-header {
    display: flex;
    align-items: center;
    padding: 10px 18px;
    cursor: pointer;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s;
    user-select: none;
}
.nav-cat-header:hover {
    background: var(--bg-hover);
    color: var(--text);
}
.nav-cat-header.active {
    color: var(--accent);
}

.cat-icon {
    width: 20px;
    text-align: center;
    margin-right: 10px;
    font-size: 14px;
}

.nav-cat-header .arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.2s;
}
.nav-cat-header.open .arrow {
    transform: rotate(180deg);
}

.nav-sub {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.nav-sub.open {
    max-height: 600px;
}

.nav-sub li a {
    display: block;
    padding: 7px 18px 7px 48px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.15s;
    border-left: 2px solid transparent;
}
.nav-sub li a:hover {
    color: var(--text);
    background: var(--bg-hover);
}
.nav-sub li a.active {
    color: var(--accent);
    border-left-color: var(--accent);
    background: var(--accent-dim);
}

/* ── Main Content ── */
#content {
    margin-left: var(--sidebar-width);
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    padding: 40px 50px;
}
#content::-webkit-scrollbar { width: 6px; }
#content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.content-inner {
    max-width: 820px;
    margin: 0 auto;
}

/* ── Back Button ── */
.back-bar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    margin-bottom: 18px;
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}
.back-bar:hover {
    background: var(--bg-hover);
    color: var(--accent);
    border-color: var(--accent);
}
.back-bar:hover i { transform: translateX(-2px); }
.back-bar i { font-size: 0.75rem; transition: transform 0.2s ease; }
.back-bar span { opacity: 0.9; }

/* ── Wiki Sections (scoped to avoid conflicts) ── */
body.wiki .section { display: none; animation: fadeIn 0.25s ease; }
body.wiki .section.active { display: block; }

body.wiki .section h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}
body.wiki .section h1 i {
    color: var(--accent);
    margin-right: 10px;
}

body.wiki .section-desc {
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 28px;
    line-height: 1.6;
}

body.wiki .section h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 28px 0 12px;
    color: var(--text);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

body.wiki .section h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 20px 0 10px;
    color: var(--text-dim);
}

/* ── Settings Table ── */
.settings-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 12px 0 24px;
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
}
.settings-table th {
    background: var(--bg-card2);
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.settings-table td {
    padding: 10px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: top;
}
.settings-table tr:last-child td { border-bottom: none; }
.settings-table tr:hover td { background: var(--bg-hover); }
.settings-table .setting-name { font-weight: 500; white-space: nowrap; color: var(--text); }
.settings-table .setting-type { color: var(--accent); font-size: 11px; font-weight: 500; font-family: 'Consolas', monospace; }
.settings-table .setting-desc { color: var(--text-dim); line-height: 1.5; }

/* ── Info / Warning / Tip Boxes ── */
.info-box {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--r);
    margin: 14px 0;
    font-size: 13px;
    line-height: 1.6;
}
.info-box i { font-size: 16px; margin-top: 2px; flex-shrink: 0; }
.info-box.warning { background: rgba(255, 183, 77, 0.08); border: 1px solid rgba(255, 183, 77, 0.2); color: var(--warning); }
.info-box.danger  { background: rgba(239, 83, 80, 0.08); border: 1px solid rgba(239, 83, 80, 0.2); color: var(--danger); }
.info-box.info    { background: rgba(66, 165, 245, 0.08); border: 1px solid rgba(66, 165, 245, 0.2); color: var(--info); }
.info-box.success { background: rgba(61, 220, 132, 0.08); border: 1px solid rgba(61, 220, 132, 0.2); color: var(--success); }

/* ── Wiki Badges (scoped) ── */
body.wiki .badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
}
body.wiki .badge.checkbox { background: rgba(66, 165, 245, 0.15); color: var(--info); }
body.wiki .badge.slider   { background: rgba(232, 122, 32, 0.15); color: var(--accent); }
body.wiki .badge.button   { background: rgba(61, 220, 132, 0.15); color: var(--success); }
body.wiki .badge.combo    { background: rgba(171, 71, 188, 0.15); color: #ab47bc; }
body.wiki .badge.input    { background: rgba(255, 183, 77, 0.15); color: var(--warning); }
body.wiki .badge.radio    { background: rgba(239, 83, 80, 0.15); color: var(--danger); }

/* ── Feature Cards ── */
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 20px;
    margin: 16px 0;
}
.feature-card h4 { font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--accent); }
.feature-card p { font-size: 13px; color: var(--text-dim); line-height: 1.6; }

/* ── Divider ── */
.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

/* ── Welcome Page ── */
.welcome-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
    margin-top: 24px;
}
.welcome-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 18px;
    cursor: pointer;
    transition: all 0.2s;
}
.welcome-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(232, 122, 32, 0.1);
}
.welcome-card i { font-size: 22px; color: var(--accent); margin-bottom: 10px; }
.welcome-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.welcome-card p { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* ── Server Grid (wiki) ── */
.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
    margin: 12px 0 20px;
}
.server-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.server-card:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
    transform: translateY(-1px);
}
.server-card i { color: var(--text-muted); font-size: 12px; }
.server-card.bearac { border-color: var(--red); background: rgba(239, 83, 80, 0.06); }
.server-card.bearac i { color: var(--red); }
.server-card.bearac:hover { border-color: var(--red); background: rgba(239, 83, 80, 0.12); }
.server-card.x64 { border-color: var(--blue); background: rgba(66, 165, 245, 0.06); }
.server-card.x64 i { color: var(--blue); }
.server-card.x64:hover { border-color: var(--blue); background: rgba(66, 165, 245, 0.12); }

/* ── Wiki Responsive ── */
@media (max-width: 900px) {
    #sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    #sidebar.open { transform: translateX(0); }
    #content { margin-left: 0; padding: 24px 20px; }
}
