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

body {
    font-family: 'Space Grotesk', sans-serif;
    background: #0a0a0f;
    color: #e8e6e3;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(45, 212, 191, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(251, 146, 60, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-bottom: 1px solid rgba(45, 212, 191, 0.2);
    padding: 1.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 2rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #2dd4bf, #fb923c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.progress-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-track {
    width: 200px;
    height: 8px;
    background: #1a1a2e;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2dd4bf, #fb923c);
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-text {
    font-size: 0.875rem;
    color: #94a3b8;
    font-weight: 500;
}

.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    min-height: calc(100vh - 100px);
}

@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
    }
}

/* Sidebar - Lesson List */
.sidebar {
    background: rgba(26, 26, 46, 0.6);
    border: 1px solid rgba(45, 212, 191, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.sidebar h2 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
}

.lesson-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.lesson-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 10px;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    color: #94a3b8;
    font-size: 0.95rem;
    font-family: inherit;
}

.lesson-item:hover {
    background: rgba(45, 212, 191, 0.05);
    border-color: rgba(45, 212, 191, 0.2);
}

.lesson-item.active {
    background: rgba(45, 212, 191, 0.1);
    border-color: rgba(45, 212, 191, 0.3);
    color: #2dd4bf;
}

.lesson-item.completed {
    color: #fb923c;
}

.lesson-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.lesson-item.active .lesson-number {
    background: #2dd4bf;
    color: #0a0a0f;
}

.lesson-item.completed .lesson-number {
    background: #fb923c;
    color: #0a0a0f;
}

/* Content Area */
.content-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Lesson Card */
.lesson-card {
    background: rgba(26, 26, 46, 0.8);
    border: 1px solid rgba(45, 212, 191, 0.1);
    border-radius: 16px;
    padding: 2rem;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.lesson-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(45, 212, 191, 0.1);
    border: 1px solid rgba(45, 212, 191, 0.2);
    border-radius: 20px;
    font-size: 0.75rem;
    color: #2dd4bf;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.lesson-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.lesson-description {
    color: #94a3b8;
    line-height: 1.7;
    font-size: 1.05rem;
}

.concept-box {
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1.5rem 0;
}

.concept-box h4 {
    color: #a78bfa;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.concept-box p {
    color: #c4b5fd;
    line-height: 1.6;
}

.concept-box code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
    color: #2dd4bf;
}

/* Code Editor */
.editor-section {
    background: #12121a;
    border: 1px solid rgba(45, 212, 191, 0.1);
    border-radius: 16px;
    overflow: hidden;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #1a1a2e;
    border-bottom: 1px solid rgba(45, 212, 191, 0.1);
}

.editor-tabs {
    display: flex;
    gap: 0.5rem;
}

.editor-tab {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #64748b;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.editor-tab.active {
    background: rgba(45, 212, 191, 0.1);
    color: #2dd4bf;
}

.editor-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-reset {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.btn-reset:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-hint {
    background: rgba(251, 146, 60, 0.1);
    color: #fb923c;
}

.btn-hint:hover {
    background: rgba(251, 146, 60, 0.2);
}

.code-editor {
    width: 100%;
    min-height: 200px;
    padding: 1.25rem;
    background: transparent;
    border: none;
    color: #e8e6e3;
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    line-height: 1.7;
    resize: vertical;
    outline: none;
    tab-size: 2;
}

.code-editor::placeholder {
    color: #475569;
}

/* Preview Panel */
.preview-section {
    background: #fff;
    border: 1px solid rgba(45, 212, 191, 0.2);
    border-radius: 16px;
    overflow: hidden;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.preview-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.browser-dots {
    display: flex;
    gap: 6px;
}

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

.dot.red { background: #f87171; }
.dot.yellow { background: #fbbf24; }
.dot.green { background: #34d399; }

.preview-frame {
    min-height: 180px;
    padding: 1.5rem;
    background: #fff;
    color: #1a1a2e;
}

/* Task & Success */
.task-box {
    background: rgba(45, 212, 191, 0.05);
    border: 1px solid rgba(45, 212, 191, 0.2);
    border-left: 4px solid #2dd4bf;
    border-radius: 0 12px 12px 0;
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.task-box h4 {
    color: #2dd4bf;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.task-box p {
    color: #94a3b8;
    line-height: 1.6;
}

.success-banner {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(45, 212, 191, 0.1));
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-icon {
    font-size: 2rem;
}

.success-content h4 {
    color: #34d399;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.success-content p {
    color: #6ee7b7;
    font-size: 0.9rem;
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(45, 212, 191, 0.1);
}

.btn-nav {
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-prev {
    background: transparent;
    border: 1px solid rgba(45, 212, 191, 0.3);
    color: #2dd4bf;
}

.btn-prev:hover:not(:disabled) {
    background: rgba(45, 212, 191, 0.1);
}

.btn-next {
    background: linear-gradient(135deg, #2dd4bf, #14b8a6);
    border: none;
    color: #0a0a0f;
}

.btn-next:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(45, 212, 191, 0.3);
}

.btn-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Hint Toast */
.hint-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #1a1a2e;
    border: 1px solid rgba(251, 146, 60, 0.3);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    max-width: 400px;
    color: #fb923c;
    font-size: 0.9rem;
    animation: slideIn 0.3s ease;
    z-index: 200;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hint-toast code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: #475569;
    font-size: 0.875rem;
}

.footer a {
    color: #2dd4bf;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-container {
        padding: 1rem;
    }
    
    .sidebar {
        position: static;
    }
    
    .lesson-card {
        padding: 1.5rem;
    }
    
    .lesson-title {
        font-size: 1.4rem;
    }
    
    .hint-toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
}