:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-hover: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --border-color: #30363d;
    --accent: #58a6ff;
    --accent-hover: #79b8ff;
    --success: #3fb950;
    --warning: #d29922;
    --danger: #f85149;
    --sidebar-width: 280px;
    --header-height: 60px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 100;
    overflow: hidden;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    text-decoration: none;
    flex-shrink: 0;
    height: 100%;
}

.logo-container {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.logo-img {
    width: 32px;
    height: 32px;
}

.search-container {
    flex: 1;
    max-width: 400px;
    margin: 0 40px;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.header-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

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

.logout-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.logout-btn:hover {
    color: var(--danger) !important;
}

/* Layout */
.layout {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    width: 100%;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 20px 0;
}

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

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

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

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

.nav-section-title {
    padding: 8px 24px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

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

.nav-item.active {
    background: rgba(88, 166, 255, 0.1);
    color: var(--accent);
    border-left-color: var(--accent);
}

.nav-item-icon {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

/* Main Content */
.main {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    padding: 40px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: calc(100vh - var(--header-height));
}

.page-title {
    width: 100%;
    max-width: 900px;
    text-align: left;
}

.page-description {
    width: 100%;
    max-width: 900px;
    text-align: left;
}

.content {
    width: 100%;
    max-width: 900px;
}

.page-nav {
    width: 100%;
    max-width: 900px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 13px;
    color: var(--text-muted);
    width: 100%;
    max-width: 900px;
}

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

.breadcrumb a:hover {
    color: var(--accent);
}

.breadcrumb-separator {
    color: var(--text-muted);
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
}

.page-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 48px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.content h2:first-child {
    margin-top: 0;
}

.content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 32px 0 12px;
}

.content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 24px 0 8px;
}

.content p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.content ul, .content ol {
    margin: 16px 0;
    padding-left: 24px;
    color: var(--text-secondary);
}

.content li {
    margin-bottom: 8px;
}

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

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

.content strong {
    color: var(--text-primary);
}

/* Code Blocks */
.code-block {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 20px 0;
    overflow: hidden;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border-color);
}

.code-lang {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.copy-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

pre {
    padding: 16px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
}

code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

.inline-code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--accent);
}

/* Callout Boxes */
.callout {
    padding: 16px 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid;
}

.callout-info {
    background: rgba(88, 166, 255, 0.1);
    border-left-color: var(--accent);
}

.callout-warning {
    background: rgba(210, 153, 34, 0.1);
    border-left-color: var(--warning);
}

.callout-danger {
    background: rgba(248, 81, 73, 0.1);
    border-left-color: var(--danger);
}

.callout-success {
    background: rgba(63, 185, 80, 0.1);
    border-left-color: var(--success);
}

.callout-title {
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.callout-info .callout-title { color: var(--accent); }
.callout-warning .callout-title { color: var(--warning); }
.callout-danger .callout-title { color: var(--danger); }
.callout-success .callout-title { color: var(--success); }

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

/* Info Box */
.info-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin: 20px 0;
}

.info-box p {
    margin-bottom: 16px;
}

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

.feature-list {
    list-style: none;
    padding: 0;
    margin: 16px 0 0 0;
}

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

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

.feature-list li strong {
    color: var(--accent);
}

.warning-box {
    background: rgba(210, 153, 34, 0.1);
    border: 1px solid var(--warning);
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.warning-box p {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.warning-box p:first-child {
    color: var(--warning);
    margin-bottom: 12px;
}

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

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    text-decoration: none;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.card-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.card-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    text-align: center;
}

.card-description {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
}

/* Table */
.table-container {
    overflow-x: auto;
    margin: 20px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

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

th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

td {
    color: var(--text-secondary);
}

tr:hover td {
    background: var(--bg-secondary);
}

/* Steps */
.steps {
    counter-reset: step;
    margin: 24px 0;
}

.step {
    display: flex;
    gap: 20px;
    margin-bottom: 32px;
    position: relative;
}

.step-number {
    counter-increment: step;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.step-number::before {
    content: counter(step);
}

.step-content {
    flex: 1;
    padding-top: 6px;
}

.step-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.step-description {
    color: var(--text-secondary);
}

.step-description ul {
    margin: 12px 0;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 17px;
    top: 44px;
    bottom: -8px;
    width: 2px;
    background: var(--border-color);
}

/* Footer Navigation */
.page-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.page-nav-link {
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
    max-width: 45%;
}

.page-nav-link:hover {
    border-color: var(--accent);
}

.page-nav-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.page-nav-title {
    color: var(--accent);
    font-weight: 500;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    margin-right: 12px;
}

/* Checklist */
.checklist {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.checklist li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    color: var(--text-secondary);
}

.checklist li::before {
    content: '☐';
    font-size: 16px;
    flex-shrink: 0;
}

/* Overlay Display */
.overlay-display {
    background: #0d1117;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    margin: 20px 0;
}

.overlay-display pre {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    color: #e6edf3;
    margin: 0;
    white-space: pre;
}

/* Color indicators */
.color-green { color: #3fb950; }
.color-red { color: #f85149; }
.color-yellow { color: #d29922; }
.color-orange { color: #db6d28; }
.color-cyan { color: #58a6ff; }
.color-gray { color: #6e7681; }
.color-white { color: #e6edf3; }
.color-gold { color: #e3b341; }
.color-purple { color: #a855f7; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
        z-index: 99;
    }

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

    .main {
        margin-left: 0;
        width: 100%;
        padding: 24px 20px;
    }

    .menu-toggle {
        display: block;
    }

    .search-container {
        display: none;
    }

    .page-title {
        font-size: 1.8rem;
    }

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

    .page-nav {
        flex-direction: column;
        gap: 12px;
    }

    .page-nav-link {
        max-width: 100%;
    }
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-green {
    background: rgba(63, 185, 80, 0.2);
    color: var(--success);
}

.badge-blue {
    background: rgba(88, 166, 255, 0.2);
    color: #58a6ff;
}

.badge-red {
    background: rgba(248, 81, 73, 0.2);
    color: var(--danger);
}

.badge-yellow {
    background: rgba(210, 153, 34, 0.2);
    color: var(--warning);
}

.badge-orange {
    background: rgba(219, 109, 40, 0.2);
    color: #db6d28;
}

.badge-gray {
    background: rgba(110, 118, 129, 0.2);
    color: var(--text-muted);
}

.badge-cyan {
    background: rgba(88, 166, 255, 0.2);
    color: var(--accent);
}
