/* =========================================
   Base Variables (Inherited from Main App)
   ========================================= */
:root {
    --bg-dark: #fbfbfc;
    --bg-panel: #ffffff;
    --text-main: #111827;
    --text-secondary: #4b5563;
    --accent-blue: #2563eb;
    --accent-blue-hover: #1d4ed8;
    --accent-green: #059669;
    --accent-green-hover: #047857;
    --accent-orange: #d97706;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --border-color: #e5e7eb;
    --card-bg: #ffffff;
    --card-hover: #f3f4f6;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.08);
    --sidebar-width: 280px;
    color-scheme: light;
}

/* Custom Scrollbar for a premium feel */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* =========================================
   Layout
   ========================================= */
.wiki-layout {
    display: flex;
    min-height: 100vh;
}

/* =========================================
   Sidebar
   ========================================= */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.tracker-logo {
    color: var(--accent-blue);
}

.brand h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.brand .light {
    font-weight: 300;
    color: var(--text-secondary);
}

.sub-brand {
    font-size: 12px;
    color: var(--accent-green);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    padding: 24px 16px;
    flex-grow: 1;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section h3 {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 1px;
    margin: 0 0 12px 8px;
}

.nav-link {
    display: block;
    padding: 8px 12px;
    color: var(--text-main);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.nav-link:hover {
    background-color: var(--card-bg);
    color: var(--accent-blue);
}

.nav-link.active {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    font-weight: 600;
}

.pro-tag {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: white;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    margin-left: 6px;
    vertical-align: middle;
}
.beta-tag {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: white;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    margin-left: 6px;
    vertical-align: middle;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.back-link {
    display: block;
    text-align: center;
    padding: 10px;
    background-color: var(--card-bg);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}

.back-link:hover {
    background-color: var(--card-hover);
    color: var(--text-main);
    border-color: var(--text-secondary);
}

/* =========================================
   Main Content Area
   ========================================= */
.content-area {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.mobile-header {
    display: none;
    padding: 16px 20px;
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.hamburger-btn,
.mobile-only-btn {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
}

.mobile-header h2 {
    margin: 0;
    font-size: 18px;
}

.mobile-header .light {
    font-weight: 300;
    color: var(--text-secondary);
}

.mobile-only-btn {
    display: none;
    margin-left: auto;
}

.wiki-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 40px;
    width: 100%;
    box-sizing: border-box;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   Typography & Article Formatting
   ========================================= */
.wiki-content h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -1px;
    background: linear-gradient(90deg, #111827, #4b5563);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wiki-content .lead {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-weight: 300;
}

.wiki-content h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 48px 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.wiki-content h3 {
    font-size: 18px;
    margin: 32px 0 12px;
}

.wiki-content p {
    margin-bottom: 20px;
    color: #374151;
}

.wiki-content ul,
.wiki-content ol {
    margin-bottom: 24px;
    padding-left: 24px;
    color: #374151;
}

.wiki-content li {
    margin-bottom: 8px;
}

.wiki-content a {
    color: var(--accent-blue);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.wiki-content a:hover {
    border-color: var(--accent-blue);
}

/* =========================================
   Components
   ========================================= */
.info-box {
    background-color: rgba(59, 130, 246, 0.1);
    border-left: 4px solid var(--accent-blue);
    padding: 16px 20px;
    border-radius: 0 8px 8px 0;
    margin: 24px 0;
}

.info-box.warning {
    background-color: rgba(245, 158, 11, 0.1);
    border-left-color: var(--accent-orange);
}

.info-box p:last-child {
    margin-bottom: 0;
}

.kbd {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: inherit;
    font-size: 12px;
    color: var(--accent-green);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 32px 0;
}

.feature-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.feature-card h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: var(--text-main);
}

.feature-card p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.hero-image-placeholder {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, var(--card-bg), var(--bg-panel));
    border: 1px dashed var(--border-color);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 32px 0;
    color: var(--text-secondary);
    font-style: italic;
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    }

    .mobile-only-btn {
        display: block;
    }

    .content-area {
        margin-left: 0;
    }

    .mobile-header {
        display: flex;
    }

    .wiki-content {
        padding: 30px 20px;
    }
}