/* Base styles */
:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --accent-color: #e67e22;
    --light-gray: #f5f5f5;
    --dark-gray: #333333;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: var(--dark-gray);
    background-color: var(--white);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

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

code {
    font-family: 'Fira Code', monospace;
    background-color: var(--light-gray);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
}

pre {
    background-color: var(--light-gray);
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

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

/* Header */
header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo h1 {
    font-size: 1.8rem;
    margin-bottom: 0;
}

.logo span {
    color: var(--primary-color);
}

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

nav ul li {
    margin-left: 2rem;
}

nav ul li a {
    color: var(--dark-gray);
    font-weight: 600;
}

nav ul li a:hover {
    color: var(--primary-color);
}

/* Hero section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
}

/* Level selector */
.level-selector {
    padding: 3rem 0;
    background-color: var(--white);
}

.level-selector h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.level-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.level-tab {
    background-color: var(--light-gray);
    border: none;
    padding: 1rem 2rem;
    margin: 0 0.5rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 5px;
}

.level-tab:hover {
    background-color: #e0e0e0;
}

.level-tab.active {
    background-color: var(--primary-color);
    color: var(--white);
}

.level-description {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--light-gray);
    padding: 2rem;
    border-radius: 5px;
}

.level-info {
    display: none;
}

.level-info.active {
    display: block;
}

/* Content section */
.content {
    padding: 3rem 0;
    background-color: var(--light-gray);
}

.content-wrapper {
    display: flex;
    gap: 2rem;
}

.sidebar {
    flex: 0 0 300px;
}

.main-content {
    flex: 1;
    background-color: var(--white);
    padding: 2rem;
    border-radius: 5px;
    box-shadow: var(--shadow);
}

.toc-container {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 5px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 100px;
}

.toc {
    display: none;
}

.toc.active {
    display: block;
}

.toc ul {
    list-style: none;
    margin-left: 1rem;
}

.toc li {
    margin-bottom: 0.5rem;
}

.content-area {
    display: none;
}

.content-area.active {
    display: block;
}

/* Interactive demo */
.interactive-demo {
    padding: 3rem 0;
    background-color: var(--white);
}

.interactive-demo h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.demo-container {
    max-width: 900px;
    margin: 0 auto;
}

.demo-controls {
    margin-bottom: 2rem;
}

textarea#demo-input {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Open Sans', sans-serif;
    font-size: 1rem;
    min-height: 100px;
    resize: vertical;
    margin-bottom: 1rem;
}

button#demo-button {
    background-color: var(--accent-color);
    color: var(--white);
    border: none;
    padding: 0.8rem 2rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 5px;
    transition: var(--transition);
}

button#demo-button:hover {
    background-color: #d35400;
}

.visualization-container {
    background-color: var(--light-gray);
    border-radius: 5px;
    height: 300px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.demo-output {
    background-color: var(--light-gray);
    padding: 1.5rem;
    border-radius: 5px;
}

#demo-result {
    min-height: 100px;
}

/* Quiz section */
.quiz-section {
    padding: 3rem 0;
    background-color: var(--light-gray);
}

.quiz-section h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.quiz-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--white);
    padding: 2rem;
    border-radius: 5px;
    box-shadow: var(--shadow);
}

.quiz {
    display: none;
}

.quiz.active {
    display: block;
}

.quiz-question {
    margin-bottom: 2rem;
}

.quiz-options {
    list-style: none;
}

.quiz-option {
    padding: 1rem;
    margin-bottom: 0.5rem;
    background-color: var(--light-gray);
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
}

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

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

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

.quiz-feedback.correct {
    background-color: var(--secondary-color);
    color: var(--white);
}

.quiz-feedback.incorrect {
    background-color: #e74c3c;
    color: var(--white);
}

/* Resources section */
.resources {
    padding: 3rem 0;
    background-color: var(--white);
}

.resources h2 {
    text-align: center;
    margin-bottom: 2rem;
}

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

.resource-card {
    background-color: var(--light-gray);
    padding: 1.5rem;
    border-radius: 5px;
    box-shadow: var(--shadow);
}

.resource-card h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.resource-card ul {
    list-style: none;
}

.resource-card li {
    margin-bottom: 0.5rem;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        flex: 0 0 auto;
        margin-bottom: 2rem;
    }
    
    .toc-container {
        position: static;
    }
    
    .level-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .level-tab {
        margin: 0.5rem 0;
        width: 80%;
    }
    
    .resources-grid {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.content-area.active, 
.level-info.active, 
.quiz.active {
    animation: fadeIn 0.5s ease-in-out;
}

/* Markdown content styling */
.content-area h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.content-area h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    color: var(--secondary-color);
}

.content-area p {
    margin-bottom: 1rem;
}

.content-area ul, 
.content-area ol {
    margin-bottom: 1rem;
    margin-left: 2rem;
}

.content-area blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin-bottom: 1rem;
    color: #666;
}

.content-area img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 1rem 0;
}

.content-area table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.content-area th, 
.content-area td {
    padding: 0.5rem;
    border: 1px solid #ddd;
}

.content-area th {
    background-color: var(--light-gray);
}
