/* CoreX Documentation Styles */

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --border-color: #374151;
    --border-hover: #4b5563;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
    --radius: 8px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
}

.container {
    display: flex;
    min-height: 100vh;
}

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

.sidebar-header {
    padding: 2rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.sidebar-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.sidebar-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Theme Toggle Button */
.theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius);
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.theme-toggle:hover {
    background: var(--border-hover);
    color: var(--text-primary);
    transform: scale(1.05);
}

.theme-toggle:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

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

.nav-menu {
    list-style: none;
}

.nav-menu li {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-left-color: var(--primary-color);
}

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

.nav-link i {
    margin-right: 0.75rem;
    width: 16px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
}

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

.section {
    margin-bottom: 4rem;
}

.section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

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

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

.section h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem;
    color: var(--text-primary);
}

.section p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.lead {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

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

.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-hover);
}

.feature-card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

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

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

/* Code Blocks */
.code-block {
    background: #1e1e1e;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin: 1rem 0;
    overflow: hidden;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #2d2d2d;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.copy-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

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

.code-block pre {
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
    background: #1e1e1e;
}

.code-block code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #e5e7eb;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin: 1rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-info {
    background: #1e3a8a;
    border: 1px solid #3b82f6;
    color: #93c5fd;
}

.alert i {
    margin-top: 0.125rem;
}

/* File Tree */
.file-tree {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    margin: 1rem 0;
}

.tree-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
}

.tree-child {
    margin-left: 1.5rem;
}

.tree-grandchild {
    margin-left: 3rem;
}

.tree-item i {
    color: var(--text-secondary);
    width: 16px;
}

/* Modules Grid */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.module-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.module-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-hover);
}

.module-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.module-header i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.module-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.module-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.module-card ul {
    list-style: none;
    padding: 0;
}

.module-card li {
    padding: 0.25rem 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.module-card li:before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
    margin-right: 0.5rem;
}

/* API Sections */
.api-section {
    margin: 2rem 0;
}

.api-section h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Schema Grid */
.schema-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.schema-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.2s ease;
}

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

.schema-card h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.schema-card ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.schema-card li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.schema-card code {
    background: var(--bg-tertiary);
    color: var(--accent-color);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Command Cards */
.commands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.command-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.command-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.command-card h4 {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-family: 'Courier New', monospace;
    background: var(--bg-tertiary);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    display: inline-block;
}

.command-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.command-example {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

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

.command-example code {
    background: var(--bg-primary);
    color: var(--primary-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

/* Command Categories */
.command-category {
    margin-bottom: 3rem;
}

.command-category h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

/* Command Search */
.command-search {
    margin-bottom: 2rem;
}

.search-input {
    width: 100%;
    max-width: 500px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

/* Command Filters */
.command-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Command Usage Guide */
.usage-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.usage-step {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    position: relative;
}

.usage-step::before {
    content: counter(step-counter);
    counter-increment: step-counter;
    position: absolute;
    top: -10px;
    left: 20px;
    background: var(--primary-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.usage-steps {
    counter-reset: step-counter;
}

/* Command Syntax Highlighting */
.syntax-highlight {
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 1rem;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    overflow-x: auto;
}

.syntax-highlight .command {
    color: var(--primary-color);
    font-weight: 600;
}

.syntax-highlight .parameter {
    color: var(--accent-color);
    font-style: italic;
}

.syntax-highlight .optional {
    color: var(--text-muted);
}

.syntax-highlight .required {
    color: var(--warning-color);
}

/* Command Examples */
.command-examples {
    margin-top: 1rem;
}

.example-item {
    background: var(--bg-tertiary);
    border-left: 3px solid var(--primary-color);
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.example-item code {
    color: var(--primary-color);
    font-weight: 500;
}

.example-item .description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
    
    .features-grid,
    .modules-grid,
    .schema-grid,
    .commands-grid,
    .keybindings-grid {
        grid-template-columns: 1fr;
    }
    
    .section h1 {
        font-size: 2rem;
    }
    
    .section h2 {
        font-size: 1.5rem;
    }
    
    .theme-toggle {
        position: fixed;
        top: 1rem;
        right: 1rem;
        z-index: 300;
    }

    .commands-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .command-card {
        padding: 1rem;
    }
    
    .command-filters {
        flex-direction: column;
    }
    
    .filter-btn {
        text-align: center;
    }
    
    .usage-steps {
        grid-template-columns: 1fr;
    }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 200;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 0.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
}

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

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

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

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

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

/* Focus Styles */
.nav-link:focus,
.copy-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Animation for sections */
.section {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

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

/* Stagger animation for feature cards */
.feature-card {
    animation-delay: calc(var(--index) * 0.1s);
}

/* Code syntax highlighting for dark theme */
.code-block code .keyword {
    color: #ff79c6;
}

.code-block code .string {
    color: #f1fa8c;
}

.code-block code .comment {
    color: #6272a4;
    font-style: italic;
}

.code-block code .function {
    color: #50fa7b;
}

.code-block code .number {
    color: #bd93f9;
}

.code-block code .operator {
    color: #ff79c6;
}

.code-block code .variable {
    color: #f8f8f2;
}

.code-block code .class {
    color: #8be9fd;
}

.code-block code .property {
    color: #66d9ef;
}

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

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

/* Inline code */
code {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 0.125rem 0.25rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Lists */
ul, ol {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.25rem;
}

/* Blockquotes */
blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

.corex-logo {
    display: block;
    margin: 0 auto 1rem auto;
    width: 80%;
    height: auto;
}

/* Command Status Indicators */
.command-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.status-available {
    background: var(--success-color);
    color: white;
}

.status-coming-soon {
    background: var(--warning-color);
    color: white;
}

.status-deprecated {
    background: var(--error-color);
    color: white;
}

/* Command Permissions */
.command-permissions {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.permission-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    margin-right: 0.25rem;
    font-size: 0.75rem;
}

/* Command Search Results */
.search-results {
    margin-top: 2rem;
}

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Command Copy Button */
.copy-command {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
}

.command-card:hover .copy-command {
    opacity: 1;
}

.copy-command:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Command Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.category-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.category-card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.category-card h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.category-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.4;
}

.command-category-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-right: 0.5rem;
    vertical-align: middle;
}