:root {
    --primary: #00f2ff;
    --secondary: #7000ff;
    --accent: #ff00c8;
    --bg-dark: #05060a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --text-main: #e0e0e0;
    --text-dim: #a0a0a0;
    --glass-border: rgba(255, 255, 255, 0.1);
    --sidebar-width: 250px;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}


/* Custom Scrollbar Design */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #05060a;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2); /* Slightly more visible */
    border-radius: 20px;
    border: 2px solid #05060a;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 242, 255, 0.5); /* Primary glow on hover */
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) #05060a;
}
/* Global transitions & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Specific Font Override (Excluding Font Awesome icons) */
body, h1, h2, h3, h4, h5, h6, p, span, div, button, a, label, input, select {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    filter: blur(80px);
}

.blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s infinite alternate ease-in-out;
}

.blob-1 { top: -10%; left: -10%; width: 50vw; height: 50vw; background: var(--secondary); }
.blob-2 { bottom: -10%; right: -10%; width: 40vw; height: 40vw; background: var(--primary); }
.blob-3 { top: 30%; right: 20%; width: 30vw; height: 30vw; background: var(--accent); }

@keyframes float {
    0% { transform: translate(0, 0) scale(1.1); }
    100% { transform: translate(30px, 60px) scale(1); }
}

/* Sidebar Overlay Design */
aside {
    width: var(--sidebar-width);
    height: calc(100vh - 40px);
    margin: 20px;
    background: rgba(10, 11, 16, 0.5);
    backdrop-filter: blur(40px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    position: fixed;
    padding: 2rem 1.4rem;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

/* App Layout - Full Width */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 100px;
}

/* Top Navbar Design */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    padding: 0 5%;
    background: rgba(10, 11, 16, 0.8);
    backdrop-filter: blur(40px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.3);
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.5px;
    color: #fff;
}

.top-nav .btn-hub {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    line-height: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    transition: var(--transition);

    margin: 0;
}

.btn-hub:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: var(--primary);
}

main {
    padding: 2rem 5%;
    width: 100%;
}


/* Logo & Hub Link */
/* Hidden Sidebar Styles */ .hidden-sidebar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.3);
}

.logo-text {
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, #888);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hidden-sidebar .btn-hub {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 15px;
    line-height: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.btn-hub:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-4px);
    border-color: var(--primary);
}

/* Sidebar Nav */
#sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

#sidebar-nav::-webkit-scrollbar { width: 3px; }
#sidebar-nav::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 10px; }

.nav-section { margin-bottom: 1.5rem; }

.nav-title {
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 0.8rem;
    opacity: 0.5;
}

.nav-item {
    padding: 6px 10px;
    border-radius: 8px;
    color: var(--text-dim);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
}

.nav-item i {
    width: 14px;
    text-align: center;
    color: var(--primary);
    opacity: 0.8;
}

/* Sidebar Footer */
.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.sidebar-footer p { font-size: 0.65rem; margin-bottom: 2px; }
.footer-label { color: var(--primary); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }

/* Dashboard Content */
header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

#course-header-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #888);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

#course-header-desc {
    color: var(--text-dim);
    font-size: 0.9rem;
    max-width: 500px;
}

.progress-overview {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 1rem 1.2rem;
    border-radius: 14px;
    width: 250px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.progress-bar-container { height: 5px; background: rgba(255, 255, 255, 0.05); border-radius: 10px; }
.progress-bar-fill { height: 100%; background: linear-gradient(to right, var(--primary), var(--secondary)); width: 0%; transition: width 1s ease; }

/* Lesson Grid */
.lesson-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.lesson-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 1.5rem;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.lesson-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.04);
}

.section-tag {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.6rem;
}

.lesson-title { font-size: 1rem; font-weight: 800; margin-bottom: 0.6rem; color: #fff; }
.lesson-desc { font-size: 0.8rem; color: var(--text-dim); line-height: 1.5; margin-bottom: 1.5rem; flex: 1; }

/* Buttons */
.lesson-footer { display: flex; gap: 10px; }
.btn { padding: 0.6rem 1rem; border-radius: 10px; font-size: 0.8rem; font-weight: 800; cursor: pointer; transition: var(--transition); text-decoration: none; border: none; flex:1; display:flex; align-items:center; justify-content:center; }
.btn-primary { background: #fff; color: #000; }
.btn-primary:hover { background: var(--primary); transform: translateY(-2px); }
.btn-outline { background: rgba(255, 255, 255, 0.03); color: #fff; border: 1px solid var(--glass-border); }
.btn-outline:hover { background: rgba(255, 255, 255, 0.08); }

/* Theory Modal - FIX FOR NOT OPENING */
.theory-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-dark);
    z-index: 9999;
    display: none; /* Controlled by JS flex/none */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.theory-modal.active {
    opacity: 1;
}

.theory-content-wrapper {
    width: 100%;
    height: 100vh;
    background: transparent;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.theory-header { 
    border-bottom: 1px solid var(--glass-border); 
    padding: 1rem 3%; 
    background: rgba(10, 11, 16, 0.8); 
    backdrop-filter: blur(20px);
    display: flex; 
    align-items: center; 
    position: relative;
}

#theory-title { 
    font-size: 1.4rem; 
    font-weight: 800; 
    background: linear-gradient(to right, #fff, var(--text-dim));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: capitalize;
}

#theory-body { 
    padding: 3rem max(5%, calc(50vw - 450px)); 
    overflow-y: auto; 
    flex: 1; 
    color: #e0e0e0; 
    font-size: 1.05rem;
    scroll-behavior: smooth;
    background: #05060a;
}

/* Custom Scrollbar for Modal */
#theory-body::-webkit-scrollbar { width: 8px; }
#theory-body::-webkit-scrollbar-track { background: transparent; }
#theory-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 10px; }
#theory-body::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* Markdown Styling */
.markdown-body h1 { font-size: 2.2rem; margin: 2rem 0 1.2rem; color: #fff; font-weight: 800; letter-spacing: -0.5px; }
.markdown-body h2 { font-size: 1.8rem; margin: 2rem 0 1rem; color: #fff; font-weight: 700; border-bottom: 1px solid var(--glass-border); padding-bottom: 0.5rem; }
.markdown-body h3 { font-size: 1.4rem; margin: 1.5rem 0 0.8rem; color: var(--primary); }
.markdown-body p { margin-bottom: 1.5rem; line-height: 1.8; color: #cbd5e1; }
.markdown-body a { color: var(--primary); text-decoration: none; border-bottom: 1px dashed var(--primary); transition: var(--transition); }
.markdown-body a:hover { color: #fff; border-bottom-color: #fff; }

.markdown-body img { 
    max-width: 100%; 
    border-radius: 16px; 
    margin: 2rem auto; 
    display: block;
    border: 1px solid var(--glass-border); 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.markdown-body ul, .markdown-body ol { margin-bottom: 1.5rem; padding-left: 2rem; color: #cbd5e1; line-height: 1.8; }
.markdown-body li { margin-bottom: 0.5rem; }
.markdown-body li::marker { color: var(--primary); font-weight: bold; }

.markdown-body blockquote {
    border-left: 4px solid var(--primary);
    background: rgba(0, 242, 255, 0.05);
    padding: 1.2rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: #fff;
}

.markdown-body code {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.2em 0.4em;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 0.9em;
    color: #ff79c6;
}

.markdown-body pre {
    background: #0f111a;
    border: 1px solid var(--glass-border);
    padding: 1.2rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 1.5rem 0;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}

.markdown-body pre code {
    background: transparent;
    padding: 0;
    color: #a6accd;
    font-size: 0.9em;
    line-height: 1.5;
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
}
.markdown-body th, .markdown-body td {
    border: 1px solid var(--glass-border);
    padding: 1rem;
    text-align: left;
}
.markdown-body th { background: rgba(255, 255, 255, 0.05); color: #fff; font-weight: 700; }
.markdown-body tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }

/* Mermaid Diagrams */
.mermaid {
    background: rgba(10, 11, 16, 0.7);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2.5rem;
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    overflow-x: auto;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}
.mermaid svg {
    max-width: 100%;
    height: auto;
}

/* Notebook List */
.notebook-list { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px dashed var(--glass-border); display: flex; flex-direction: column; gap: 6px; }
.notebook-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: rgba(255,255,255,0.03); border-radius: 10px; font-size:0.85rem; font-weight:700; cursor:pointer; border: 1px solid transparent; transition: var(--transition); }
.notebook-item:hover { background: rgba(0, 242, 255, 0.05); border-color: rgba(0, 242, 255, 0.2); color: var(--primary); padding-left: 18px; }
