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

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-sidebar: #fafbfc;
    --text-primary: #24292f;
    --text-secondary: #57606a;
    --text-muted: #6e7781;
    --border-color: #d0d7de;
    --link-color: #0969da;
    --link-hover: #0550ae;
    --accent-color: #0969da;
    --card-bg: #ffffff;
    --card-border: #d0d7de;
    --code-bg: #f6f8fa;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 3px 6px rgba(0, 0, 0, 0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-secondary);
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1);
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section h3 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 0 20px;
    margin-bottom: 8px;
}

.nav-section ul {
    list-style: none;
}

.nav-section ul li {
    margin-bottom: 2px;
}

.nav-section ul li a {
    display: block;
    padding: 6px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 2px solid transparent;
}

.nav-section ul li a:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.nav-section ul li a.active {
    color: var(--accent-color);
    background: var(--bg-secondary);
    border-left-color: var(--accent-color);
    font-weight: 500;
}

/* Main Content */
.content {
    margin-left: 280px;
    flex: 1;
    background: var(--bg-primary);
    min-height: 100vh;
}

.content-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.breadcrumb {
    font-size: 14px;
    color: var(--text-muted);
}

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

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

.header-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.header-links a:hover {
    color: var(--text-primary);
}

.header-links a svg {
    width: 20px;
    height: 20px;
}

.ca-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    font-family: monospace;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.ca-badge:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-color);
}

.ca-badge svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.ca-badge.copied {
    background: #dcfce7;
    border-color: #86efac;
}

.ca-badge.copied svg {
    color: #16a34a;
}

/* Main Article */
.main-article {
    max-width: 900px;
    padding: 40px;
    margin: 0 auto;
}

.main-article h1 {
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.intro-text {
    margin-bottom: 40px;
}

.main-article h2 {
    font-size: 24px;
    font-weight: 600;
    margin-top: 48px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.main-article h3 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.main-article p {
    margin-bottom: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.main-article ul, .main-article ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.main-article li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.main-article a {
    color: var(--link-color);
    text-decoration: none;
}

.main-article a:hover {
    text-decoration: underline;
}

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

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

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 24px;
    transition: all 0.3s;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.card h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--text-primary);
}

.card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

.card-link {
    display: inline-block;
    color: var(--link-color);
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
}

.card-link:hover {
    color: var(--link-hover);
}

/* Info Blocks */
.info-block {
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    margin: 24px 0;
}

.info-block p {
    margin-bottom: 12px;
}

.info-block p:last-child {
    margin-bottom: 0;
}

.help-block ul {
    list-style: none;
    padding-left: 0;
    margin-top: 12px;
}

.help-block ul li {
    margin-bottom: 8px;
}

/* Feature List */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 24px 0;
}

.feature-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.feature-list li:last-child {
    border-bottom: none;
}

/* Footer */
.content-footer {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px;
    border-top: 1px solid var(--border-color);
}

.footer-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.next-link {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.2s;
}

.next-link:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-color);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-280px);
        transition: transform 0.3s;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .content {
        margin-left: 0;
    }
    
    .main-article {
        padding: 24px;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
}

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

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

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

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