/* Main application styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
}

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

header {
    background: #2c3e50;
    color: white;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

header h1 {
    margin: 0;
    text-align: center;
}

.course-nav {
    text-align: center;
    margin-bottom: 2rem;
}

.course-nav a {
    display: inline-block;
    padding: 8px 16px;
    margin: 4px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s;
}

.course-nav a:hover {
    background: #2980b9;
}

.content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-size: 1.05em;
}

.section {
    margin-bottom: 3rem;
}

.section h2 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.question {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ecf0f1;
}

.question:last-child {
    border-bottom: none;
}

.question h3 {
    color: #34495e;
    margin-bottom: 1rem;
    position: relative;
}

.anchor-link {
    position: absolute;
    left: -30px;
    top: 0;
    color: #3498db;
    text-decoration: none;
    font-weight: normal;
    opacity: 0;
    transition: opacity 0.2s;
}

.question:hover .anchor-link {
    opacity: 1;
}

.anchor-link:hover {
    text-decoration: none;
}

.question-content {
    color: #555;
}

.question-content img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.question-content > pre {
    background: #f4f4f4;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
}

.inline-code {
    background: #f4f4f4;
    padding: 2px 4px;
    border-radius: 2px;
    font-family: 'Monaco', 'Consolas', monospace;
}

.highlight {
    background: #f8f8f8;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.highlight pre {
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

.question-content a {
    color: #3498db;
    text-decoration: none;
}

.question-content a:hover {
    text-decoration: underline;
}

.question-meta {
    margin-top: 1rem;
    text-align: right;
}

.edit-link {
    color: #95a5a6;
    text-decoration: none;
    font-size: 0.85em;
    font-style: italic;
}

.edit-link:hover {
    color: #3498db;
    text-decoration: underline;
}

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

.course-link {
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: transform 0.2s, box-shadow 0.2s;
}

.course-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.course-link a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.course-link h3 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 1.2em;
}

.course-description {
    color: #666;
    font-size: 0.9em;
}

.table-of-contents {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.table-of-contents ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.table-of-contents li {
    margin-bottom: 0.5rem;
}

.table-of-contents a {
    color: #3498db;
    text-decoration: none;
}

.table-of-contents a:hover {
    text-decoration: underline;
}

footer {
    text-align: center;
    padding: 2rem 0;
    color: #7f8c8d;
    border-top: 1px solid #ecf0f1;
    margin-top: 3rem;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    .content {
        padding: 1rem;
    }
    .course-links {
        grid-template-columns: 1fr;
    }
}