:root {
    --primary-color: #3b82f6;
    --secondary-color: #1e293b;
    --accent-color: #f59e0b;
    --bg-color: #f8fafc;
    --text-color: #334155;
    --card-bg: #ffffff;
    --sidebar-width: 280px;
    --nav-bg: #1e293b;
    --nav-hover: #334155;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    /* Performance optimizations */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* SVG Performance */
svg {
    will-change: transform;
    transform: translateZ(0);
}

/* Smooth scrolling optimization */
.main-content {
    scroll-behavior: smooth;
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--nav-bg);
    color: white;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 30px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: white;
}

.sidebar-header p {
    font-size: 0.85rem;
    opacity: 0.9;
    color: rgba(255,255,255,0.9);
}

.nav-section {
    padding: 20px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nav-section-title {
    padding: 10px 20px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #e2e8f0;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--nav-hover);
    color: white;
    padding-left: 25px;
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
    border-left: 4px solid var(--accent-color);
}

.nav-item i {
    width: 20px;
    margin-right: 12px;
    font-size: 1rem;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 40px;
    min-height: 100vh;    overflow-x: hidden;
    word-wrap: break-word;
    max-width: 100%;}

.breadcrumb {
    color: #64748b;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

h1 {
    color: var(--secondary-color);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #64748b;
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.content-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);    overflow-x: auto;
    max-width: 100%;
}

.content-section pre,
.content-section code {
    overflow-x: auto;
    max-width: 100%;
    word-wrap: break-word;
    white-space: pre-wrap;}

.content-section h2 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.content-section h3 {
    color: var(--secondary-color);
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.math-block {
    background-color: #f1f5f9;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    overflow-x: auto;
    max-width: 100%;
}

.math-block::-webkit-scrollbar {
    height: 8px;
}

.math-block::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.math-block::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.math-block::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.note {
    border-left: 4px solid var(--accent-color);
    background-color: #fffbeb;
    padding: 15px;
    border-radius: 0 4px 4px 0;
    margin: 20px 0;
}

.visualization-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.visualization-section h2 {
    color: var(--secondary-color);
    margin-bottom: 15px;
}

/* Controls */
.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-group label {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

input[type="range"] {
    width: 100%;
}

.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    margin-right: 10px;
    font-size: 0.95rem;
}

.btn:hover {
    background-color: #2563eb;
}

.btn-reset {
    background-color: #64748b;
}

.btn-reset:hover {
    background-color: #475569;
}

/* Features Grid */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.feature-box {
    background: white;
    padding: 25px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.feature-box h4 {
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.feature-box p {
    color: #64748b;
    font-size: 0.95rem;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: var(--primary-color);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    font-size: 1.2rem;
}

.menu-toggle:hover {
    background: #2563eb;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    h1 {
        font-size: 2rem;
    }

    .controls {
        grid-template-columns: 1fr;
    }
}

/* Lists */
ul, ol {
    margin-left: 20px;
    margin-top: 10px;
}

li {
    margin-bottom: 5px;
}

/* Code */
code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 15px 0;
}

pre code {
    background: none;
    color: inherit;
    padding: 0;
}
