:root {
    --bg-color: #0d1117;
    --sidebar-bg: rgba(22, 27, 34, 0.7);
    --surface-bg: rgba(33, 38, 45, 0.6);
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --accent: #58a6ff;
    --accent-glow: rgba(88, 166, 255, 0.3);
    --border: rgba(240, 246, 252, 0.1);
    --border-hover: rgba(240, 246, 252, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden;
    line-height: 1.6;
}

/* Background Gradients & Blurs */
.bg-blur {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    pointer-events: none;
}

.top-blob {
    top: -100px;
    left: -100px;
    width: 400px;
    height: 400px;
    background: var(--accent-glow);
}

.bottom-blob {
    bottom: -150px;
    right: -100px;
    width: 600px;
    height: 600px;
    background: rgba(138, 43, 226, 0.2);
}

/* App Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 10;
    transition: transform 0.3s ease;
}

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

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.nav-list {
    list-style: none;
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.nav-item {
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.nav-item:hover {
    background: var(--surface-bg);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.nav-item.active {
    background: rgba(88, 166, 255, 0.1);
    color: var(--accent);
    border-color: rgba(88, 166, 255, 0.3);
    box-shadow: inset 0 0 10px rgba(88, 166, 255, 0.05);
}

/* Main Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.top-bar {
    height: 70px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-bottom: 1px solid var(--border);
    background: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(10px);
    z-index: 5;
}

.menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    margin-right: auto;
}

.menu-icon {
    width: 24px;
    height: 24px;
}

/* Header Tools & Buttons */
.header-tools {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-download {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(88, 166, 255, 0.1);
    color: var(--accent);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(88, 166, 255, 0.3);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-download:hover {
    background: rgba(88, 166, 255, 0.2);
    box-shadow: 0 0 10px rgba(88, 166, 255, 0.2);
    color: #fff;
}

/* Language Toggle */
.language-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface-bg);
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.lang-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.lang-label.active {
    color: var(--text-primary);
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #21262d;
    transition: .3s;
    border: 1px solid var(--border);
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: var(--accent);
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-glow);
}

input:checked+.slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 22px;
}

/* Content Area */
.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 48px;
    scroll-behavior: smooth;
}

.markdown-body {
    max-width: 850px;
    margin: 0 auto;
    font-size: 1.05rem;
    color: #c9d1d9;
}

.welcome-screen {
    text-align: center;
    margin-top: 20vh;
    color: var(--text-secondary);
}

/* Markdown Styles */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 2em;
    margin-bottom: 0.8em;
    line-height: 1.3;
}

.markdown-body h1 {
    font-size: 2.2rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.3em;
    margin-top: 0;
}

.markdown-body h2 {
    font-size: 1.6rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.3em;
}

.markdown-body h3 {
    font-size: 1.3rem;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol {
    margin-bottom: 1.2M;
}

.markdown-body a {
    color: var(--accent);
    text-decoration: none;
}

.markdown-body a:hover {
    text-decoration: underline;
}

.markdown-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

.markdown-body em {
    color: #a5d6ff;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 2em;
    margin-bottom: 1.5em;
}

.markdown-body li {
    margin-bottom: 0.5em;
}

.markdown-body hr {
    height: 1px;
    background: var(--border);
    border: none;
    margin: 2em 0;
}

.markdown-body code {
    background: rgba(110, 118, 129, 0.4);
    padding: 0.2em 0.4em;
    border-radius: 6px;
    font-size: 85%;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.markdown-body pre {
    background: #161b22;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    overflow: auto;
    margin-bottom: 1.5em;
}

.markdown-body pre code {
    background: transparent;
    padding: 0;
}

.markdown-body blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 1em;
    color: var(--text-secondary);
    background: rgba(88, 166, 255, 0.05);
    margin: 1.5em 0;
    padding: 1em;
    border-radius: 0 8px 8px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5em;
}

th,
td {
    border: 1px solid var(--border);
    padding: 10px 16px;
    text-align: left;
}

th {
    background: var(--surface-bg);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        left: -320px;
        height: 100vh;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .sidebar.open {
        transform: translateX(320px);
    }

    .menu-btn {
        display: block;
    }

    .content-scroll {
        padding: 24px;
    }
}