.main-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-header h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 1rem;
}

.page-header p {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

.exercises-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #007bff;
    display: inline-block;
}

.exercises-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.exercise-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.exercise-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.exercise-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    flex: 1;
    margin-right: 1rem;
}

.exercise-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex: 1;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.expand-example-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.expand-example-btn:hover {
    background: #0056b3;
}

.action-buttons .download-link {
    background: #28a745;
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
    display: inline-block;
}

.action-buttons .download-link:hover {
    background: #218838;
}

.example-content {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    overflow: hidden;
}

.example-content.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    opacity: 0;
}

.example-content.expanded {
    max-height: none;
    opacity: 1;
}

.example-content h4 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.math-system {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
}

.matrix-example {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
}

.physics-equations {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    margin: 1rem 0;
}

.algorithm-analysis {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    margin: 1rem 0;
}

.equation {
    margin: 0.5rem 0;
    font-size: 1rem;
}

.solution-steps {
    margin-top: 1.5rem;
}

.step {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #fff;
    border-radius: 4px;
    border-left: 4px solid #007bff;
}

.matrix {
    font-family: "Courier New", monospace;
    background: #f1f3f4;
    padding: 0.8rem;
    border-radius: 4px;
    margin: 0.5rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
    text-align: center;
}

.operation {
    font-style: italic;
    color: #666;
    margin: 0.5rem 0;
    font-size: 0.9rem;
    text-align: center;
}

.final-answer {
    background: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 4px;
    font-weight: 600;
    margin-top: 1rem;
}

.practice-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #dee2e6;
}

.show-solution-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    margin: 1rem 0;
    transition: background-color 0.2s ease;
}

.show-solution-btn:hover {
    background: #0056b3;
}

.solution-hidden {
    background: #fff3cd;
    color: #856404;
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid #ffeaa7;
    margin-top: 1rem;
}

.detailed-solution {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #ffd700;
}

.exercise-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.exercise-type {
    background: #f8f9fa;
    color: #666;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.exercise-duration {
    color: #888;
    font-size: 0.9rem;
}

.difficulty-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.difficulty-badge.beginner {
    background: #d4edda;
    color: #155724;
}

.difficulty-badge.intermediate {
    background: #fff3cd;
    color: #856404;
}

.difficulty-badge.advanced {
    background: #f8d7da;
    color: #721c24;
}

.interactive-label {
    background: #e7f3ff;
    color: #0066cc;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.coming-soon {
    background: #f1f3f4;
    color: #666;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.download-link {
    background: #28a745;
    color: white;
    text-decoration: none;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.download-link:hover {
    background: #218838;
}

.subject-math {
    border-left: 4px solid #ff6b6b;
}

.subject-physics {
    border-left: 4px solid #4ecdc4;
}

.subject-cs {
    border-left: 4px solid #45b7d1;
}

.subject-geology {
    border-left: 4px solid #45b7d1;
}

.subject-literature {
    border-left: 4px solid #96ceb4;
}

.stats-bar {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.stat-item {
    flex: 1;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.25rem;
}

.search-container {
    text-align: center;
    margin-bottom: 2rem;
}

.search-box {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-box:focus {
    outline: none;
    border-color: #007bff;
}

.interactive {
    background: linear-gradient(135deg, #fff 0%, #f8f9ff 100%);
}

/* MathJax styling */
.MathJax {
    outline: 0;
}

.MathJax_Display {
    text-align: center !important;
    margin: 1em 0 !important;
}

/* Dark theme styles */
[data-theme="dark"] .page-header h1 {
    color: #f0f0f0;
}

[data-theme="dark"] .page-header p {
    color: #b0b0b0;
}

[data-theme="dark"] .section-title {
    color: #f0f0f0;
    border-bottom-color: #4dabf7;
}

[data-theme="dark"] .exercise-card {
    background: #2a2a2a;
    border-color: #404040;
}

[data-theme="dark"] .exercise-card:hover {
    background: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .exercise-title {
    color: #f0f0f0;
}

[data-theme="dark"] .exercise-description {
    color: #b0b0b0;
}

[data-theme="dark"] .expand-example-btn {
    background: #4dabf7;
    color: #000;
}

[data-theme="dark"] .expand-example-btn:hover {
    background: #339af0;
}

[data-theme="dark"] .action-buttons .download-link {
    background: #059669;
    color: white;
}

[data-theme="dark"] .action-buttons .download-link:hover {
    background: #047857;
}

[data-theme="dark"] .example-content {
    background: #1f1f1f;
    border: 1px solid #404040;
}

[data-theme="dark"] .example-content h4 {
    color: #f0f0f0;
}

[data-theme="dark"] .math-system,
[data-theme="dark"] .matrix-example,
[data-theme="dark"] .physics-equations,
[data-theme="dark"] .algorithm-analysis {
    background: #2a2a2a;
    border-color: #404040;
    color: #e0e0e0;
}

[data-theme="dark"] .step {
    background: #2a2a2a;
    border-left-color: #4dabf7;
    color: #e0e0e0;
}

[data-theme="dark"] .matrix {
    background: #333;
    color: #e0e0e0;
}

[data-theme="dark"] .operation {
    color: #b0b0b0;
}

[data-theme="dark"] .final-answer {
    background: #1a4a3a;
    color: #4ade80;
}

[data-theme="dark"] .solution-hidden {
    background: #2a2a1a;
    color: #fbbf24;
    border-color: #92400e;
}

[data-theme="dark"] .detailed-solution {
    border-top-color: #92400e;
}

[data-theme="dark"] .practice-section {
    border-top-color: #404040;
}

[data-theme="dark"] .show-solution-btn {
    background: #4dabf7;
    color: #000;
}

[data-theme="dark"] .show-solution-btn:hover {
    background: #339af0;
}

[data-theme="dark"] .exercise-meta {
    border-top-color: #404040;
}

[data-theme="dark"] .exercise-type {
    background: #404040;
    color: #b0b0b0;
}

[data-theme="dark"] .exercise-duration {
    color: #999;
}

[data-theme="dark"] .difficulty-badge.beginner {
    background: #1a4a3a;
    color: #4ade80;
}

[data-theme="dark"] .difficulty-badge.intermediate {
    background: #2a2a1a;
    color: #fbbf24;
}

[data-theme="dark"] .difficulty-badge.advanced {
    background: #4a1a1a;
    color: #fb7185;
}

[data-theme="dark"] .interactive-label {
    background: #1a365d;
    color: #63b3ed;
}

[data-theme="dark"] .coming-soon {
    background: #2a2a2a;
    color: #b0b0b0;
}

[data-theme="dark"] .download-link {
    background: #059669;
    color: white;
}

[data-theme="dark"] .download-link:hover {
    background: #047857;
}

[data-theme="dark"] .subject-math {
    border-left-color: #ff8a80;
}

[data-theme="dark"] .subject-physics {
    border-left-color: #64ffda;
}

[data-theme="dark"] .subject-cs {
    border-left-color: #40c4ff;
}

[data-theme="dark"] .subject-geology {
    border-left-color: #40c4ff;
}

[data-theme="dark"] .subject-literature {
    border-left-color: #b9f6ca;
}

[data-theme="dark"] .stats-bar {
    background: #2a2a2a;
    border: 1px solid #404040;
}

[data-theme="dark"] .stat-number {
    color: #4dabf7;
}

[data-theme="dark"] .stat-label {
    color: #b0b0b0;
}

[data-theme="dark"] .search-box {
    background: #2a2a2a;
    border-color: #404040;
    color: #e0e0e0;
}

[data-theme="dark"] .search-box:focus {
    border-color: #4dabf7;
}

[data-theme="dark"] .search-box::placeholder {
    color: #888;
}

[data-theme="dark"] .interactive {
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f2f 100%);
}

/* Dark theme MathJax styling */
[data-theme="dark"] .MathJax {
    color: #e0e0e0;
}

[data-theme="dark"] .MathJax_Display {
    color: #e0e0e0;
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }

    .exercises-grid {
        gap: 1rem;
    }

    .exercise-card {
        padding: 1rem;
    }

    .exercise-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .exercise-title {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }

    .example-content {
        padding: 1rem;
    }

    .example-content.collapsed {
        padding: 0;
    }

    .stats-bar {
        flex-direction: column;
        gap: 1rem;
    }

    .exercise-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .search-box {
        max-width: 100%;
    }

    .matrix {
        font-size: 0.8rem;
        overflow-x: auto;
    }

    .exercise-content {
        padding: 1rem;
    }

    .math-system,
    .matrix-example,
    .physics-equations,
    .algorithm-analysis {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.5rem;
    }

    .exercise-title {
        font-size: 1.1rem;
    }

    .math-system,
    .matrix-example,
    .physics-equations,
    .algorithm-analysis {
        font-size: 0.8rem;
        padding: 0.6rem;
    }

    .step {
        padding: 0.8rem;
    }

    .matrix {
        font-size: 0.7rem;
    }

    .MathJax {
        font-size: 0.9em !important;
    }

    .action-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .expand-example-btn,
    .action-buttons .download-link {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }
}
