:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --bg-main: #ffffff;
    --bg-alt: #f8fafc;
    --bg-code: #1e293b;
    --text-main: #0f172a;
    --text-secondary: #475569;
    --border: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.1);
    --sidebar-width: 280px;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background: var(--bg-alt);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-main);
    border-right: 1px solid var(--border);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-main);
    transition: 0.3s;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-link {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: var(--bg-alt);
    color: var(--text-main);
}

.nav-link.active {
    color: var(--primary);
    background: var(--bg-alt);
    border-left-color: var(--primary);
    font-weight: 600;
}

.nav-link.indent {
    padding-left: 2.5rem;
    font-size: 0.9rem;
}

.nav-section {
    margin: 0.5rem 0;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    width: calc(100% - var(--sidebar-width));
}

.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero-badges {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-block;
}

.btn-primary {
    background: white;
    color: var(--primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: var(--primary);
}

/* Section */
.section {
    background: var(--bg-main);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px var(--shadow);
}

.section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
}

.section h3 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: var(--text-main);
}

.section h4 {
    font-size: 1.2rem;
    margin: 1.5rem 0 1rem;
    color: var(--text-secondary);
}

.section h5 {
    font-size: 1.1rem;
    margin: 1rem 0 0.5rem;
    color: var(--text-secondary);
}

.subsection {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

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

.feature-card {
    background: var(--bg-alt);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Code Blocks */
pre {
    background: var(--bg-code);
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1rem 0;
}

code {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
}

:not(pre)>code {
    background: var(--bg-alt);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    color: var(--primary);
    font-size: 0.85rem;
}

/* Info Boxes */
.info-box {
    background: #dbeafe;
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.note {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: 4px;
}

.warning {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: 4px;
}

/* Parameters */
.params {
    background: var(--bg-alt);
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.params ul {
    list-style: none;
    padding-left: 0;
}

.params li {
    padding: 0.25rem 0;
}

/* Images */
.image-container {
    margin: 2rem 0;
    text-align: center;
}

.image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px var(--shadow);
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.image-item {
    text-align: center;
}

.image-item h4 {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--text-secondary);
}

.image-item img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow);
}

/* Gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.gallery img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow);
    transition: transform 0.2s;
    cursor: pointer;
}

.gallery img:hover {
    transform: scale(1.05);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    margin-top: 4rem;
}

/* Responsive */
@media (max-width: 968px) {
    :root {
        --sidebar-width: 280px;
    }

    .sidebar {
        transform: translateX(-100%);
    }

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

    .menu-toggle {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .content-wrapper {
        padding: 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

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

/* Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--bg-alt);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: var(--primary);
    color: white;
}