:root {
    /* Color Palette - Cyber/Premium Dark */
    --bg-primary: #0a0a0f;
    --bg-secondary: #13131f;
    --bg-card: #1c1c2e;

    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-accent: #64ffda;
    /* Cyan/Teal accent */

    --primary-color: #3b82f6;
    /* Blue */
    --secondary-color: #8b5cf6;
    /* Purple */
    --gradient-main: linear-gradient(135deg, var(--primary-color), var(--secondary-color));

    --border-color: #2d2d42;

    /* Spacing */
    --container-width: 1200px;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;

    /* Typography */
    --font-main: 'Inter', sans-serif;
    --font-code: 'Fira Code', monospace;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    /* Pill shape for modern look */
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.btn-primary {
    background: var(--gradient-main);
    color: white;
    border: 1px solid transparent;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(5px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-primary);
}

/* Typography Utilities */
.gradient-text {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem 0;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--text-primary);
}

/* Hero Section */
.hero {
    padding: 160px 0 100px;
    /* Top padding for fixed navbar */
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: radial-gradient(circle at 50% 20%, rgba(59, 130, 246, 0.15) 0%, rgba(10, 10, 15, 0) 50%);
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 500px;
}

.hero-cta {
    display: flex;
    gap: 1rem;
}

/* Code Window Visual */
.code-window {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    font-family: var(--font-code);
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
    transition: transform 0.5s ease;
}

.code-window:hover {
    transform: perspective(1000px) rotateY(0) rotateX(0);
}

.window-header {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.red {
    background: #ff5f56;
}

.yellow {
    background: #ffbd2e;
}

.green {
    background: #27c93f;
}

.code-window pre {
    padding: 24px;
    color: #e0e0e0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.language-python {
    color: #a5b3ce;
}

/* Page Layouts */
.page-content {
    padding-top: 120px;
    padding-bottom: 80px;
}

.page-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Course Grid */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.course-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.course-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.course-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.course-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    flex-grow: 1;
}

.card-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.full-width {
    width: 100%;
    text-align: center;
}

/* Lesson Layout */
.lesson-layout {
    display: block;
    min-height: 100vh;
    padding-top: 74px;
    /* Navbar height */
}

/* Sidebar */
.sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    position: fixed;
    width: 300px;
    height: calc(100vh - 74px);
    overflow-y: auto;
    padding: 2rem;
}

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

.sidebar-header h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: var(--gradient-main);
    border-radius: 3px;
}

.progress-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.lesson-list li {
    margin-bottom: 0.5rem;
}

.lesson-link {
    display: block;
    padding: 10px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.lesson-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.lesson-link.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

.lesson-link.completed {
    color: var(--text-accent);
}

.lesson-link.completed::before {
    content: "✓ ";
    margin-right: 4px;
}

/* Lesson Content */
.lesson-content {
    margin-left: 300px;
    /* Offset for fixed sidebar */
    padding: 4rem 6rem;
    width: auto;
    max-width: 1400px;
}

.lesson-header {
    margin-bottom: 3rem;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.lesson-header h1 {
    font-size: 2.5rem;
}

.content-block {
    margin-bottom: 3rem;
}

.content-block h2 {
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
}

.content-block p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.content-block code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-code);
    font-size: 0.9em;
    color: var(--text-accent);
}

.feature-list li {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.feature-list li::before {
    content: "•";
    color: var(--primary-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.lesson-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* Interactive Editor Styles */
.interactive-editor {
    margin: 3rem 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.editor-header {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.editor-header h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.editor-body {
    padding: 1.5rem;
}

.editor-instruction {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

#code-input {
    width: 100%;
    height: 150px;
    background: #0f0f16;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    color: #e0e0e0;
    font-family: var(--font-code);
    font-size: 0.95rem;
    resize: vertical;
    margin-bottom: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

#code-input:focus {
    border-color: var(--primary-color);
}

.editor-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-select {
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

.theme-select:hover,
.theme-select:focus {
    border-color: var(--primary-color);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.theme-select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

#feedback-area {
    flex-grow: 1;
}

.alert {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

.alert.success {
    background: rgba(39, 201, 63, 0.15);
    color: #27c93f;
    border: 1px solid rgba(39, 201, 63, 0.3);
}

.alert.error {
    background: rgba(255, 95, 86, 0.15);
    color: #ff5f56;
    border: 1px solid rgba(255, 95, 86, 0.3);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

/* Console Output */
.console-output {
    margin-top: 1.5rem;
    background: #0d1117;
    /* Darker background */
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #30363d;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
    font-family: 'Fira Code', monospace;
}

.console-label {
    font-size: 0.75rem;
    color: #8b949e;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #30363d;
    padding-bottom: 0.5rem;
}

#output-text {
    font-family: 'Fira Code', monospace;
    color: #3fb950;
    /* Neon Green for success/output */
    font-size: 0.9rem;
    white-space: pre-wrap;
    margin: 0;
    min-height: 20px;
}

/* CodeMirror Overrides */
.CodeMirror {
    border-radius: 8px;
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.CodeMirror-focused {
    border-color: var(--primary-color);
}
/* Theme Overrides to ensure visibility on dark background */
.cm-s-eclipse.CodeMirror {
    background-color: #ffffff !important;
    color: #000000 !important;
}

.cm-s-solarized.cm-s-light.CodeMirror {
    background-color: #fdf6e3 !important;
    color: #657b83 !important;
}

.cm-s-material.CodeMirror {
    background-color: #263238 !important;
    color: #e9eded !important;
}

.cm-s-monokai.CodeMirror {
    background-color: #272822 !important;
    color: #f8f8f2 !important;
}

.line-error {
    background-color: rgba(255, 95, 86, 0.2) !important;
}

/* Notebook Interface */
.notebook-interface {
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.notebook-header {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.notebook-cell {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.notebook-cell:focus-within {
    border-color: var(--primary-color);
}

.cell-input {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.cell-label {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-secondary);
    font-family: var(--font-code);
    font-size: 0.85rem;
    width: 80px;
    flex-shrink: 0;
    text-align: right;
    border-right: 1px solid var(--border-color);
}

.cell-editor-container {
    flex-grow: 1;
}

.cell-controls {
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: flex-end;
}

.btn-run-cell {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-run-cell:hover {
    background: var(--primary-color);
    color: white;
}

.cell-output {
    padding: 1rem;
    font-family: var(--font-code);
    font-size: 0.9rem;
    white-space: pre-wrap;
    background: #0d1117;
    min-height: 0;
}

.notebook-controls {
    display: flex;
    justify-content: center;
    padding: 1rem;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    transition: border-color 0.2s;
}

.notebook-controls:hover {
    border-color: var(--text-secondary);
}
