/* =============================================
   WebburnsTech Knowledge Base - Design System
   ============================================= */

/* CSS Custom Properties */
:root {
    /* Dark Theme (Default) */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;
    --bg-card: #16161f;
    --bg-hover: #1e1e2a;
    
    --text-primary: #f4f4f6;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    --accent: #6c63ff;
    --accent-hover: #5b52e0;
    --accent-secondary: #00d4ff;
    --accent-gradient: linear-gradient(135deg, #6c63ff 0%, #00d4ff 100%);
    
    --border-color: #27272f;
    --border-light: #3f3f46;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    
    --sidebar-width: 280px;
    --header-height: 64px;
    --content-max-width: 900px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --bg-card: #ffffff;
    --bg-hover: #f1f3f4;
    
    --text-primary: #1a1a2e;
    --text-secondary: #52525b;
    --text-muted: #71717a;
    
    --border-color: #e4e4e7;
    --border-light: #d4d4d8;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; margin-bottom: 1.5rem; }
h2 { font-size: 1.875rem; margin-bottom: 1rem; margin-top: 2rem; }
h3 { font-size: 1.5rem; margin-bottom: 0.75rem; margin-top: 1.5rem; }
h4 { font-size: 1.25rem; margin-bottom: 0.5rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

ul, ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* Layout Structure */
.kb-layout {
    display: flex;
    min-height: 100vh;
}

/* Header */
.kb-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
}

.kb-header-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.kb-header-logo span {
    color: var(--accent);
}

.kb-header-logo .kb-badge {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 500;
    background: var(--accent-gradient);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kb-header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Search Bar */
.kb-search {
    position: relative;
    width: 300px;
}

.kb-search input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.kb-search input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.kb-search input::placeholder {
    color: var(--text-muted);
}

.kb-search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Theme Toggle */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

.theme-toggle i {
    font-size: 1rem;
    color: var(--text-secondary);
}

.theme-toggle .fa-sun {
    display: none;
}

[data-theme="light"] .theme-toggle .fa-moon {
    display: none;
}

[data-theme="light"] .theme-toggle .fa-sun {
    display: block;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition-fast);
}

/* Sidebar */
.kb-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: 1.5rem 0;
    z-index: 90;
    transition: transform var(--transition-normal);
}

.kb-sidebar::-webkit-scrollbar {
    width: 6px;
}

.kb-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.kb-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.kb-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* Sidebar Navigation */
.kb-nav-section {
    margin-bottom: 1.5rem;
}

.kb-nav-section-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 0 1.5rem;
    margin-bottom: 0.5rem;
}

.kb-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.kb-nav-item {
    margin: 0;
}

.kb-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

.kb-nav-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    text-decoration: none;
}

.kb-nav-link.active {
    background: var(--bg-hover);
    color: var(--accent);
    border-left-color: var(--accent);
}

.kb-nav-link i {
    width: 18px;
    font-size: 0.875rem;
    opacity: 0.7;
}

.kb-nav-link .draft-badge {
    font-size: 0.6rem;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-sm);
    margin-left: auto;
}

/* Main Content */
.kb-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

.kb-content {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 2rem 3rem;
}

/* Breadcrumbs */
.kb-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.kb-breadcrumbs a {
    color: var(--text-muted);
}

.kb-breadcrumbs a:hover {
    color: var(--accent);
}

.kb-breadcrumbs .separator {
    color: var(--border-light);
}

.kb-breadcrumbs .current {
    color: var(--text-secondary);
}

/* Page Header */
.kb-page-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.kb-page-header h1 {
    margin-bottom: 0.75rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.kb-page-header .description {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin: 0;
}

/* Cards */
.kb-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all var(--transition-fast);
}

.kb-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

.kb-card-title {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kb-card-title i {
    color: var(--accent);
}

/* Info Boxes */
.kb-info-box {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
    border-left: 4px solid;
}

.kb-info-box.note {
    background: rgba(108, 99, 255, 0.1);
    border-color: var(--accent);
}

.kb-info-box.tip {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
}

.kb-info-box.warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
}

.kb-info-box.important {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

.kb-info-box-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kb-info-box p:last-child {
    margin-bottom: 0;
}

/* Grid Layouts */
.kb-grid {
    display: grid;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.kb-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.kb-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Link Cards */
.kb-link-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.kb-link-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.kb-link-card-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.kb-link-card-icon i {
    color: white;
    font-size: 1rem;
}

.kb-link-card h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.kb-link-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

/* Tables */
.kb-table-wrapper {
    overflow-x: auto;
    margin: 1.5rem 0;
}

.kb-table {
    width: 100%;
    border-collapse: collapse;
}

.kb-table th,
.kb-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.kb-table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-tertiary);
}

.kb-table td {
    color: var(--text-secondary);
}

.kb-table tr:hover td {
    background: var(--bg-hover);
}

/* Code Blocks */
code {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.875em;
    background: var(--bg-tertiary);
    padding: 0.2em 0.4em;
    border-radius: var(--radius-sm);
    color: var(--accent-secondary);
}

pre {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

pre code {
    background: none;
    padding: 0;
}

/* Draft Overlay */
.kb-draft-banner {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.2), transparent);
    border: 1px solid #f59e0b;
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.kb-draft-banner i {
    color: #f59e0b;
}

.kb-draft-banner span {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Footer */
.kb-footer {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.kb-footer a {
    color: var(--text-secondary);
}

/* Last Updated */
.kb-last-updated {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .kb-content {
        padding: 2rem;
    }
    
    .kb-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .kb-search {
        display: none;
    }
    
    .kb-sidebar {
        transform: translateX(-100%);
        width: 100%;
        max-width: 300px;
    }
    
    .kb-sidebar.active {
        transform: translateX(0);
    }
    
    .kb-main {
        margin-left: 0;
    }
    
    .kb-content {
        padding: 1.5rem;
    }
    
    .kb-grid-2,
    .kb-grid-3 {
        grid-template-columns: 1fr;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}

/* Sidebar Overlay for Mobile */
.kb-sidebar-overlay {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 85;
}

.kb-sidebar-overlay.active {
    display: block;
}

/* Print Styles */
@media print {
    .kb-sidebar,
    .kb-header,
    .theme-toggle,
    .kb-breadcrumbs {
        display: none !important;
    }
    
    .kb-main {
        margin-left: 0;
        margin-top: 0;
    }
    
    .kb-content {
        max-width: 100%;
        padding: 0;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.kb-content > * {
    animation: fadeIn 0.3s ease forwards;
}

/* Utility Classes */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 2rem; }
