/* Lesson Container */
.lesson-container {
    display: flex;
    min-height: 100vh;
    background: #f8fafc;
}

/* Lesson Sidebar */
.lesson-sidebar {
    width: 280px;
    background: white;
    padding: 1.5rem;
    border-right: 1px solid #e2e8f0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.lesson-progress {
    margin-bottom: 2rem;
}

.lesson-progress h3 {
    margin-bottom: 1rem;
}

.lesson-title {
    font-weight: 600;
    margin-top: 0.5rem;
    color: var(--primary-color);
}

.lesson-modules {
    margin-top: 2rem;
}

.lesson-modules h4 {
    margin-bottom: 1rem;
    color: var(--text-light);
}

.lesson-modules ul {
    list-style: none;
}

.lesson-modules li {
    padding: 0.75rem;
    margin: 0.25rem 0;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s;
}

.lesson-modules li:hover {
    background: #f1f5f9;
}

.lesson-modules li.active {
    background: linear-gradient(to right, rgba(99,102,241,0.1), transparent);
    color: var(--primary-color);
    font-weight: 500;
    border-left: 3px solid var(--primary-color);
}

.lesson-modules li.completed {
    color: var(--success);
    text-decoration: line-through;
    opacity: 0.7;
}

/* Main Lesson Area */
.lesson-main {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    max-width: calc(100% - 280px);
}

.lesson-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.lesson-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-hint, .btn-skip {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s;
}

.btn-hint {
    background: #fef3c7;
    color: #92400e;
}

.btn-skip {
    background: #fee2e2;
    color: #b91c1c;
}

/* AI Tutor */
.ai-tutor-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.ai-avatar {
    text-align: center;
    min-width: 80px;
}

.avatar-icon {
    font-size: 3rem;
    margin-bottom: 0.25rem;
}

.ai-status {
    font-size: 0.75rem;
    color: var(--success);
    background: #dcfce7;
    padding: 0.25rem 0.5rem;
    border-radius: 50px;
}

.ai-message {
    flex: 1;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.ai-name {
    font-weight: 600;
    color: var(--primary-color);
}

.message-time {
    color: var(--text-light);
    font-size: 0.875rem;
}

.concept-explanation {
    margin: 1rem 0;
}

.example-box {
    background: #f8fafc;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    border-left: 4px solid var(--primary-color);
}

.example-box pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: 1rem 0;
}

/* Practice Area */
.practice-area {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

.challenge-description {
    background: #f1f5f9;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

.code-editor-container {
    margin: 1rem 0;
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.editor-header {
    background: #f1f5f9;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

.code-editor {
    width: 100%;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    border: none;
    resize: vertical;
    background: #1e293b;
    color: #e2e8f0;
}

.code-editor:focus {
    outline: none;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.btn-run {
    background: #059669;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s;
}

.btn-submit {
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s;
}

.btn-ask {
    background: #8b5cf6;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s;
}

/* Output Container */
.output-container {
    margin-top: 1rem;
    padding: 1rem;
    background: #1e293b;
    color: #e2e8f0;
    border-radius: var(--border-radius);
}

.output-container h4 {
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

/* Feedback Container */
.feedback-container {
    margin-top: 1rem;
    padding: 1rem;
    background: #f0f9ff;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.feedback-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.feedback-icon {
    font-size: 1.25rem;
}

.feedback-title {
    font-weight: 600;
    color: var(--primary-color);
}

/* Lesson Navigation */
.lesson-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

/* AI Assistant */
.ai-assistant {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 320px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    overflow: hidden;
    z-index: 1000;
}

.assistant-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.assistant-messages {
    height: 300px;
    overflow-y: auto;
    padding: 1rem;
    background: #f8fafc;
}

.message {
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    max-width: 85%;
}

.message.assistant {
    background: white;
    align-self: flex-start;
    margin-right: auto;
}

.message.user {
    background: var(--primary-color);
    color: white;
    align-self: flex-end;
    margin-left: auto;
}

.sender {
    font-weight: 600;
    margin-right: 0.5rem;
}

.assistant-input {
    display: flex;
    padding: 1rem;
    border-top: 1px solid #e2e8f0;
}

.assistant-input input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    margin-right: 0.5rem;
}

.assistant-input button {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
}

/* Quiz Styles */
.quiz-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.quiz-header {
    margin-bottom: 2rem;
}

.quiz-info {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: var(--border-radius);
}

.progress-indicator {
    display: flex;
    justify-content: space-between;
    margin: 2rem 0;
    padding: 1rem;
    background: #f8fafc;
    border-radius: var(--border-radius);
}

.progress-step {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.progress-step.active {
    background: var(--primary-color);
    color: white;
}

.progress-step.completed {
    background: var(--success);
    color: white;
}

.question-container {
    margin: 2rem 0;
}

.options-container {
    margin: 1.5rem 0;
}

.option {
    display: block;
    padding: 1rem;
    margin: 0.5rem 0;
    background: #f8fafc;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s;
}

.option:hover {
    background: #e2e8f0;
}

.option input[type="radio"] {
    margin-right: 1rem;
}

.question-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

/* Results Modal */
.results-content {
    max-width: 600px;
    text-align: center;
}

.results-summary {
    display: flex;
    gap: 2rem;
    margin: 2rem 0;
    justify-content: center;
    align-items: center;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: bold;
}

.result-details {
    text-align: left;
}

.result-details p {
    margin: 0.5rem 0;
}

.result-feedback {
    padding: 1.5rem;
    background: #f0fdf4;
    border-radius: var(--border-radius);
    margin: 2rem 0;
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
    .lesson-container {
        flex-direction: column;
    }
    
    .lesson-sidebar {
        position: static;
        width: 100%;
        height: auto;
    }
    
    .lesson-main {
        margin-left: 0;
        max-width: 100%;
    }
    
    .ai-assistant {
        width: 100%;
        bottom: 0;
        right: 0;
    }
    
    .progress-indicator {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .results-summary {
        flex-direction: column;
    }
}