:root {
    --bg: #0f1115;
    --surface: #171a21;
    --surface-2: #1f2430;
    --surface-3: #252b38;

    --text: #e8ecf1;
    --muted: #9aa4b2;

    --border: rgba(255,255,255,0.08);

    --accent: #4cc9f0;
    --accent-2: #67e8f9;

    --success: #37d67a;
    --warning: #ffb703;
    --danger: #ef476f;

    --shadow: 0 14px 40px rgba(0,0,0,0.35);
    --shadow-soft: 0 6px 20px rgba(0,0,0,0.25);

    --radius: 16px;
    --radius-lg: 22px;

    --gloss: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.03));
}

/* THEMES */
:root[data-theme='terminal'] {
    --bg: #06110a;
    --surface: #0b1b12;
    --surface-2: #0f2418;
    --surface-3: #153120;

    --text: #8cff9b;
    --muted: #55c26a;

    --border: rgba(140,255,155,0.18);

    --accent: #00ffa6;
    --accent-2: #5cffc2;

    --shadow: 0 14px 40px rgba(0,255,166,0.10);
    --shadow-soft: 0 6px 20px rgba(0,255,166,0.08);
}

:root[data-theme='light'] {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-2: #eef3f9;
    --surface-3: #e4ebf5;

    --text: #1e293b;
    --muted: #64748b;

    --border: rgba(15,23,42,0.10);

    --accent: #2563eb;
    --accent-2: #60a5fa;

    --shadow: 0 14px 40px rgba(15,23,42,0.10);
    --shadow-soft: 0 6px 20px rgba(15,23,42,0.08);
}

:root[data-theme='default'] {
    --bg: #0b1220;
    --surface: #111827;
    --surface-2: #172033;
    --surface-3: #1e293b;

    --text: #e5e7eb;
    --muted: #9ca3af;

    --accent: #60a5fa;
    --accent-2: #93c5fd;
}

/* BASE */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at top right, rgba(76,201,240,0.12), transparent 30%),
        radial-gradient(circle at bottom left, rgba(76,201,240,0.06), transparent 25%),
        var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* LINKS */
a {
    color: var(--accent);
    text-decoration: none;
    transition: 0.2s ease;
}
a:hover {
    color: var(--accent-2);
    text-decoration: underline;
}

/* LAYOUT */
.layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.04), transparent),
        linear-gradient(180deg, var(--surface), var(--surface-2));
    border-right: 1px solid var(--border);
    padding: 24px;
}

.brand {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 18px;
}
.brand span {
    color: var(--accent);
}

/* BUTTONS */
.theme-switcher button,
.lang-toggle a {
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 14px;
    border-radius: 14px;
    cursor: pointer;
    background:
        var(--gloss),
        linear-gradient(180deg, var(--surface-3), var(--surface-2));
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.08),
        var(--shadow-soft);
    transition: all 0.2s ease;
    font-weight: 700;
    font-size: 1em;
    min-width: 90px;
    text-align: center;
    display: inline-block;
}

.theme-switcher button:hover,
.lang-toggle a:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 12px 28px rgba(0,0,0,0.3);
}

/* NAV */
.nav-links a {
    display: block;
    padding: 12px 14px;
    margin-bottom: 10px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-weight: 600;
    transition: 0.2s ease;
}

.nav-links a:hover {
    transform: translateX(4px);
    background: var(--surface-3);
}

.nav-links a.active {
    background: rgba(255,255,255,0.12);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
}

/* TOPBAR */
.topbar {
    position: fixed;
    top: 0;
    left: 260px;
    width: calc(100% - 260px);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    padding: 10px 18px;

    background:
        linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.06)),
        var(--surface);

    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

/* CONTENT */
.content {
    padding: 28px;
    margin-top: 62px;
}

/* CARDS */
.card,
.panel,
.side-box {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01)),
        var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow);
}

/* TEXT */
.muted {
    color: var(--muted);
}

/* CODE */
pre {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    padding: 14px;
    border-radius: var(--radius);
    overflow-x: auto;
}

code {
    font-family: Consolas, monospace;
}

/* LANGUAGE SWITCH */
.lang-toggle {
    display: flex;
    gap: 8px;
    align-items: center;
    height: 100%;
}

.lang-toggle a.active {
    background: rgba(255,255,255,0.18);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
}

/* FOOTER */
.footer {
    margin-top: 24px;
    color: var(--muted);
    font-family: monospace;
}

/* SCROLLBAR */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

/* RESPONSIVE */
@media (max-width: 780px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .topbar {
        left: 0;
        width: 100%;
    }

    .content {
        padding: 140px 20px 20px;
    }
}

/* FRAME */
.content-frame {
    height: calc(98vh - 110px);
    min-height: 720px;
}