/* Base styles */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #ffffff;
    --dark-blue: #1a365d;
    --background-color: #f8f9fa;
    --text-color: #333;
    --light-gray: #ecf0f1;
    --dark-gray: #7f8c8d;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --code-bg: #f5f5f5;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--primary-color);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    margin-top: 2rem;
}

h3 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
}

p {
    margin-bottom: 1.5rem;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Header */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

header h1 {
    color: white;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--light-gray);
}

/* Navigation */
nav {
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
}

nav li {
    margin-right: 1rem;
}

nav a {
    display: block;
    padding: 1rem 0.5rem;
    font-weight: 500;
    color: var(--primary-color);
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

nav a:hover, nav a.active {
    color: var(--secondary-color);
    border-bottom: 3px solid var(--secondary-color);
    text-decoration: none;
}

/* Main content */
main {
    padding: 2rem 0;
}

section {
    margin-bottom: 3rem;
    padding: 2rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Interactive elements */
.interactive-element {
    background-color: var(--light-gray);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.toggle-button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.toggle-button:hover {
    background-color: var(--dark-blue);
}

.hidden-content {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    background-color: white;
    border-radius: 4px;
}

/* Code blocks */
pre, code {
    font-family: 'Courier New', Courier, monospace;
    background-color: var(--code-bg);
    border-radius: 4px;
}

code {
    padding: 0.2rem 0.4rem;
    font-size: 0.9rem;
}

pre {
    padding: 1rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    line-height: 1.4;
}

pre code {
    padding: 0;
    background-color: transparent;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
}

th {
    background-color: var(--light-gray);
    font-weight: 600;
}

/* Page navigation */
.page-navigation {
    display: flex;
    justify-content: space-between;
    margin: 2rem 0;
}

.next-button, .prev-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--secondary-color);
    color: white;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.next-button:hover, .prev-button:hover {
    background-color: var(--dark-blue);
    text-decoration: none;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

/* Responsive design */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
    }
    
    nav li {
        margin-right: 0;
    }
    
    nav a {
        padding: 0.5rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
}

/* Interactive elements */
.quiz-container {
    background-color: var(--light-gray);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.quiz-question {
    margin-bottom: 1rem;
    font-weight: 500;
}

.quiz-options {
    list-style: none;
    margin-bottom: 1rem;
}

.quiz-option {
    margin-bottom: 0.5rem;
    padding: 0.75rem;
    background-color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.quiz-option:hover {
    background-color: #e3e3e3;
}

.quiz-option.selected {
    background-color: var(--secondary-color);
    color: white;
}

.quiz-option.correct {
    background-color: var(--success-color);
    color: white;
}

.quiz-option.incorrect {
    background-color: var(--accent-color);
    color: white;
}

.quiz-feedback {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
    display: none;
}

.quiz-feedback.correct {
    background-color: rgba(39, 174, 96, 0.2);
    color: var(--success-color);
}

.quiz-feedback.incorrect {
    background-color: rgba(231, 76, 60, 0.2);
    color: var(--accent-color);
}

/* Code editor */
.code-editor {
    margin: 2rem 0;
}

.code-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px 8px 0 0;
}

.code-editor-content {
    background-color: #282c34;
    color: #abb2bf;
    padding: 1rem;
    border-radius: 0 0 8px 8px;
    overflow-x: auto;
}

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

.code-editor-button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.code-editor-button:hover {
    background-color: var(--dark-blue);
}

/* Progress tracker */
.progress-tracker {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 1000;
}

.progress-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: conic-gradient(var(--secondary-color) 0%, var(--light-gray) 0%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.progress-text {
    font-size: 0.9rem;
    font-weight: 600;
}

.progress-details {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 200px;
    background-color: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: none;
}

.progress-tracker:hover .progress-details {
    display: block;
}

.progress-step {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.progress-step-name {
    font-size: 0.9rem;
}

.progress-step-status {
    font-size: 0.9rem;
    font-weight: 600;
}

.progress-step-status.completed {
    color: var(--success-color);
}

.progress-step-status.current {
    color: var(--secondary-color);
}

.progress-step-status.pending {
    color: var(--dark-gray);
}

/* Learning outcomes */
.learning-outcomes {
    list-style: none;
    margin-bottom: 1.5rem;
}

.learning-outcomes li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.learning-outcomes li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}
