:root {
    --primary: #c6a0f6; /* Muted Purple */
    --primary-alt: #b7bdf8; /* Soft Lavender */
    --secondary: #8aadf4; /* Dusty Blue */
    --secondary-alt: #eed49f; /* Muted Gold */
    --accent: #8bd5ca; /* Muted Teal */
    --bg-dark: #181926; /* Deep Navy/Charcoal */
    --bg-card: rgba(36, 39, 58, 0.92); /* Muted Dark Card */
    --bg-input: rgba(30, 32, 48, 0.95);
    --text: #cad3f5; /* Pale Gray-White */
    --text-dim: #939ab7; /* Muted Slate */
    --glass-border: rgba(255, 255, 255, 0.05);
    --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.5);
    --sidebar-width: 320px; /* Slightly wider for the mascot */
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: #111111; /* Darker for space theme */
    background-image: url('bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.7; /* Slightly more breathing room */
    letter-spacing: 0.015em;
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

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

/* Page Section Spacing */
.page-section {
    padding-top: 60px; /* Offset for sticky header if needed */
    padding-bottom: 60px;
    border-bottom: 1px solid var(--glass-border);
}
.page-section:last-child {
    border-bottom: none;
}

/* Scrollbar Style */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { 
    background: var(--bg-card); 
    border-radius: 10px; 
}
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-card);
    border-right: 1px solid var(--glass-border);
    position: fixed;
    left: 0;
    top: 0;
    padding: 30px 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
}

.sidebar-logo {
    padding: 0 30px;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 40px;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.9;
}

.nav-section-title {
    padding: 20px 30px 10px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-dim);
    font-weight: 700;
}

.nav-item {
    padding: 14px 20px;
    margin: 4px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-dim);
    position: relative;
    text-decoration: none;
    user-select: none;
}

.arrow {
    margin-left: auto;
    font-size: 0.7rem;
    transition: transform 0.3s;
}

.nav-group {
    list-style: none; /* remove details marker */
}

summary::-webkit-details-marker {
    display:none;
}
summary {
    list-style: none;
    outline: none;
}

/* Rotate arrow when open */
details[open] summary .arrow {
    transform: rotate(90deg);
}

.nav-sub-items {
    padding-top: 5px;
}

.sub-item {
    padding: 10px 20px 10px 45px;
    margin: 2px 15px;
    font-size: 0.9rem;
    border-radius: 4px;
}

.nav-item:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: var(--bg-dark);
    background: var(--primary);
    font-weight: 600;
    box-shadow: var(--shadow-soft);
}
.nav-item.active span {
    color: var(--bg-dark);
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    padding: 0 40px 60px; /* adjusted for sections */
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Markdown Rendered Styles */
.markdown-body {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 20px 50px 50px;
    margin-top: 40px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
}

.markdown-body h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-alt);
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.markdown-body h2 {
    font-size: 2rem;
    color: var(--primary);
    margin-top: 3rem;
    margin-bottom: 1.2rem;
    font-weight: 700;
}

.markdown-body h3 {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.markdown-body p, .markdown-body ul, .markdown-body ol {
    margin-bottom: 1.2rem;
    color: var(--text-dim);
    font-size: 1.1rem;
    font-weight: 300;
}

.markdown-body strong {
    color: var(--text);
    font-weight: 600;
}

.markdown-body li {
    margin-left: 24px;
    margin-bottom: 0.6rem;
}

/* Custom Alert Styles */
.deep-dive {
    background: var(--bg-input);
    border: none;
    padding: 24px;
    border-radius: 20px;
    margin: 2rem 0;
    position: relative;
    box-shadow: inset 4px 4px 10px rgba(18, 19, 23, 0.4), inset -4px -4px 10px rgba(56, 60, 74, 0.1);
}

.deep-dive strong {
    color: var(--secondary-alt);
    font-size: 1.2rem;
    display: block;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Code Styling */
.markdown-body code:not(pre code) {
    background: var(--bg-input);
    color: var(--secondary);
    padding: 4px 10px;
    border-radius: 8px;
    font-family: 'Fira Code', monospace;
    font-size: 0.95em;
    box-shadow: inset 2px 2px 5px rgba(18, 19, 23, 0.4);
}

.command-block {
    background: var(--bg-input);
    padding: 24px;
    border-radius: 6px;
    font-family: 'Fira Code', monospace;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    transition: all 0.3s;
}

.command-block:hover {
    transform: translateY(-2px);
    box-shadow: 10px 10px 20px rgba(18, 19, 23, 0.5), -10px -10px 20px rgba(56, 60, 74, 0.2);
}

.command-block code {
    color: var(--accent) !important;
    background: none !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

/* Removed Copy Icon Styles as JS is removed */

/* Tables */
.markdown-body table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 2rem 0;
    border-radius: 20px;
    overflow: hidden;
    background: var(--bg-input);
    box-shadow: var(--shadow-soft);
}

.markdown-body th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--primary-alt);
    padding: 18px 20px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-align: left;
}

.markdown-body td {
    padding: 16px 20px;
    color: var(--text-dim);
    border-top: 1px solid rgba(255, 255, 255, 0.02);
}

.markdown-body tr:hover td {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
}

/* Animations */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
/* Tablet & Small Desktop (Landscape) */
@media (max-width: 1024px) and (orientation: landscape) {
    .sidebar { width: 80px; border-radius: 0; border-top-right-radius: 20px; border-bottom-right-radius: 20px; }
    /* Hide all text and arrows, only keep the first span (emoji/icon) */
    .sidebar-logo, .nav-item span:not(:first-child), .nav-section-title { display: none; }
    .main-content { margin-left: 80px; padding: 30px 20px; }
    .nav-item { justify-content: center; padding: 15px; }
    .markdown-body { padding: 30px; border-radius: 20px; }
    .markdown-body h1 { font-size: 2.2rem; }
}

/* Phones & Tablets (Portrait) */
@media (max-width: 768px), (orientation: portrait) {
    body {
        flex-direction: column;
    }
    
    /* Top Navigation Bar */
    .sidebar { 
        position: static;
        width: 100%; 
        height: auto;
        border-radius: 0; 
        border-bottom-right-radius: 30px; 
        border-bottom-left-radius: 30px;
        padding: 20px 0;
        box-shadow: 0 10px 30px rgba(15, 16, 20, 0.4);
    }
    
    .main-content { 
        margin-left: 0; 
        width: 100%; 
        padding: 20px 15px; 
    }
    
    /* Restore text and logo */
    .sidebar-logo {
        display: flex;
        justify-content: center;
        padding: 10px 0 20px;
    }
    .nav-item span:not(:first-child) {
        display: inline;
    }
    .nav-section-title {
        display: block;
        text-align: center;
    }
    .nav-item {
        justify-content: flex-start;
        padding: 12px 25px;
        margin: 4px 20px;
    }
    
    .markdown-body { 
        padding: 20px; 
        border-radius: 15px;
    }
    .markdown-body h1 { 
        font-size: 1.8rem; 
    }
    
    /* Responsive Content Elements */
    .markdown-body img {
        max-width: 100%;
        height: auto;
    }
    
    /* Adjust tables for mobile */
    .markdown-body table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}
