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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    padding: 40px 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Index Page Styles */
.index-page .container {
    max-width: 1200px;
}

.index-page header {
    background: #000000;
    color: white;
    padding: 40px;
    text-align: center;
}

.index-page header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.index-page header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.index-page .header-actions {
    margin-top: 20px;
}

.index-page .btn-cheat-sheet {
    font-size: 1.1em;
    padding: 14px 32px;
    background: #09A785;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(9, 167, 133, 0.3);
    transition: all 0.3s ease;
    display: inline-block;
}

.index-page .btn-cheat-sheet:hover {
    background: #077a63;
    box-shadow: 0 6px 16px rgba(9, 167, 133, 0.4);
    transform: translateY(-2px);
}

.index-page .ai-guidance-callout {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid #2196F3;
    margin: 30px 40px 15px 40px;
    padding: 25px;
    border-radius: 10px;
    display: flex;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
}

.index-page .ai-guidance-callout .callout-icon {
    font-size: 2.5em;
    flex-shrink: 0;
}

.index-page .ai-guidance-callout .callout-content {
    flex: 1;
}

.index-page .ai-guidance-callout h3 {
    color: #1976D2;
    margin-bottom: 12px;
    font-size: 1.3em;
}

.index-page .ai-guidance-callout p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #333;
}

.index-page .ai-guidance-callout .callout-examples {
    background: rgba(255, 255, 255, 0.7);
    padding: 20px;
    border-radius: 8px;
    margin-top: 15px;
}

.index-page .ai-guidance-callout .callout-examples p {
    margin-bottom: 10px;
    color: #1976D2;
    font-size: 0.95em;
}

.index-page .ai-guidance-callout .callout-examples ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.index-page .ai-guidance-callout .callout-examples li {
    margin-bottom: 8px;
    line-height: 1.5;
    color: #555;
}

.index-page .ai-guidance-callout .callout-examples code {
    background: rgba(33, 150, 243, 0.1);
    color: #1976D2;
    padding: 2px 6px;
}

.index-page .exercises-info-callout {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-left: 4px solid #4CAF50;
    margin: 30px 40px 15px 40px;
    padding: 25px;
    border-radius: 10px;
    display: flex;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.15);
}

.index-page .exercises-info-callout .callout-icon {
    font-size: 2.5em;
    flex-shrink: 0;
}

.index-page .exercises-info-callout .callout-content {
    flex: 1;
}

.index-page .exercises-info-callout h3 {
    color: #388E3C;
    margin-bottom: 12px;
    font-size: 1.3em;
}

.index-page .exercises-info-callout p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #333;
}

.index-page .exercises-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 40px 40px 40px;
}

.index-page .exercise-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.index-page .exercise-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #000000;
}

.index-page .exercise-card.bonus {
    border-color: #ffc107;
    background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
}

.index-page .exercise-number {
    font-size: 0.9em;
    color: #000000;
    font-weight: bold;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.index-page .exercise-card.bonus .exercise-number {
    color: #856404;
}

.index-page .exercise-title {
    font-size: 1.3em;
    font-weight: bold;
    color: #212529;
    margin-bottom: 15px;
}

.index-page .exercise-description {
    color: #6c757d;
    font-size: 0.95em;
    line-height: 1.5;
    margin-bottom: 15px;
}

.index-page .exercise-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.index-page footer {
    padding: 30px;
    background: #f8f9fa;
    color: #6c757d;
    border-top: 1px solid #e9ecef;
}

.index-page footer .footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.index-page footer .footer-text {
    margin: 0;
    font-weight: 500;
}

.index-page footer .footer-logo {
    height: 40px;
    width: auto;
}

/* Assignment Page Styles - Regular Exercises */
.assignment-page .container {
    max-width: 1200px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.assignment-page header {
    background: #000000;
    color: white;
    padding: 30px 40px;
}

.assignment-page header h1 {
    font-size: 2em;
    margin-bottom: 10px;
}

.assignment-page .content {
    padding: 40px;
}

.assignment-page .back-btn {
    display: inline-block;
    margin-bottom: 20px;
    padding: 10px 20px;
    background: #000000;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.3s;
}

.assignment-page .back-btn:hover {
    background: #333333;
}

.assignment-page .action-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.assignment-page .solution-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.assignment-page h2 {
    color: #000000;
    margin: 30px 0 15px 0;
    font-size: 1.5em;
}

.assignment-page ol,
.assignment-page ul {
    margin-left: 30px;
    margin-bottom: 20px;
}

.assignment-page li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.assignment-page .requirements {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #000000;
    margin-top: 20px;
}

.assignment-page .requirements h3 {
    color: #000000;
    margin-bottom: 15px;
}

.assignment-page .requirements ul {
    list-style: none;
    margin-left: 0;
}

.assignment-page .requirements li {
    padding-left: 25px;
    position: relative;
}

.assignment-page .requirements li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #000000;
    font-weight: bold;
}

/* Assignment Page Styles - Bonus Exercises */
.assignment-page.bonus {
    background: #f5f7fa;
}

.assignment-page.bonus header {
    background: #000000;
}

.assignment-page.bonus .bonus-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.3);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8em;
    margin-bottom: 10px;
}

.assignment-page.bonus .back-btn {
    background: #000000;
    color: white;
    font-weight: 500;
}

.assignment-page.bonus .back-btn:hover {
    background: #333333;
}

.assignment-page.bonus h2 {
    color: #000000;
}

.assignment-page.bonus .requirements {
    background: #f8f9fa;
    border-left: 4px solid #000000;
}

.assignment-page.bonus .requirements h3 {
    color: #000000;
}

.assignment-page.bonus .requirements li:before {
    color: #000000;
}

/* Common Elements */
code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.btn {
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-block;
}

.btn-primary {
    background: #000000;
    color: white;
}

.btn-primary:hover {
    background: #333333;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-solution {
    background: #09A785;
    color: white;
}

.btn-solution:hover {
    background: #077a63;
}

.btn-solution-code {
    background: #0080A1;
    color: white;
}

.btn-solution-code:hover {
    background: #006680;
}

/* Formula Boxes */
.formula {
    background: #fff3cd;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
}

.grade-scale {
    background: #e7f3ff;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.grade-scale ul {
    list-style: none;
    margin-left: 0;
}

.grade-scale li {
    padding-left: 0;
}

/* Solution Code Page Styles */
.solution-code-page .code-block {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin: 20px 0;
    overflow: hidden;
}

.solution-code-page .code-block-header {
    background: #000000;
    color: white;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.solution-code-page .code-block-header::before {
    content: "📄";
    font-size: 1.2em;
}

.solution-code-page .code-block-header.js::before {
    content: "📜";
}

.solution-code-page .code-content {
    padding: 0;
    overflow-x: auto;
    background: #2d2d2d;
}

.solution-code-page pre {
    margin: 0;
    padding: 20px;
    font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
    font-size: 0.9em;
    line-height: 1.6;
    white-space: pre;
    overflow-x: auto;
    background: transparent;
}

.solution-code-page code {
    background: transparent;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
}

.solution-code-page code[class*="language-"] {
    color: inherit;
}

.solution-code-page .solution-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* Cheat Sheet Page Styles */
.cheat-sheet-page .container {
    max-width: 1200px;
}

.cheat-sheet-page header {
    background: #000000;
    color: white;
    padding: 40px;
    text-align: center;
}

.cheat-sheet-page header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.cheat-sheet-page header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.cheat-sheet-page .content {
    padding: 40px;
}

.cheat-sheet-page .cheat-sheet-nav {
    margin-bottom: 30px;
}

.cheat-sheet-page .cheat-sheet-nav.bottom {
    margin-top: 40px;
    margin-bottom: 0;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.cheat-sheet-page .toc {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 40px;
    border-left: 4px solid #000000;
}

.cheat-sheet-page .toc h2 {
    color: #000000;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.cheat-sheet-page .toc ul {
    list-style: none;
    margin-left: 0;
}

.cheat-sheet-page .toc li {
    margin-bottom: 8px;
}

.cheat-sheet-page .toc a {
    color: #212529;
    text-decoration: none;
    transition: color 0.2s;
}

.cheat-sheet-page .toc a:hover {
    color: #000000;
    text-decoration: underline;
}

.cheat-sheet-page section {
    margin-bottom: 50px;
}

.cheat-sheet-page section h2 {
    color: #000000;
    font-size: 2em;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 3px solid #000000;
}

.cheat-sheet-page section h3 {
    color: #212529;
    font-size: 1.5em;
    margin-top: 30px;
    margin-bottom: 15px;
}

.cheat-sheet-page section h4 {
    color: #495057;
    font-size: 1.2em;
    margin-top: 20px;
    margin-bottom: 12px;
}

.cheat-sheet-page section p {
    line-height: 1.7;
    margin-bottom: 15px;
    color: #495057;
}

.cheat-sheet-page section ul,
.cheat-sheet-page section ol {
    margin-left: 25px;
    margin-bottom: 20px;
    line-height: 1.8;
}

.cheat-sheet-page section li {
    margin-bottom: 8px;
    color: #495057;
}

.cheat-sheet-page section a {
    color: #0080A1;
    text-decoration: none;
}

.cheat-sheet-page section a:hover {
    text-decoration: underline;
}

.cheat-sheet-page pre {
    background: #2d2d2d;
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid #e9ecef;
}

.cheat-sheet-page pre code {
    background: transparent;
    padding: 0;
    font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
    font-size: 0.9em;
    line-height: 1.6;
    color: inherit;
}

.cheat-sheet-page code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #d63384;
}

.cheat-sheet-page pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.cheat-sheet-page .back-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #000000;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.3s;
    font-weight: 500;
}

.cheat-sheet-page .back-btn:hover {
    background: #333333;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 20px 10px;
    }

    /* Index Page - Mobile */
    .index-page header {
        padding: 30px 20px;
    }

    .index-page header h1 {
        font-size: 1.8em;
    }

    .index-page header p {
        font-size: 1em;
    }

    .index-page .ai-guidance-callout,
    .index-page .exercises-info-callout {
        margin: 20px 15px;
        padding: 20px;
        flex-direction: column;
        gap: 15px;
    }

    .index-page .ai-guidance-callout .callout-icon,
    .index-page .exercises-info-callout .callout-icon {
        font-size: 2em;
        text-align: center;
    }

    .index-page .exercises-grid {
        grid-template-columns: 1fr;
        padding: 15px 20px 30px 20px;
        gap: 15px;
    }

    .index-page .exercise-card {
        padding: 20px;
    }

    .index-page footer {
        padding: 25px 20px;
    }

    .index-page footer .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .index-page footer .footer-logo {
        height: 35px;
    }

    /* Assignment Page - Mobile */
    .assignment-page header {
        padding: 25px 20px;
    }

    .assignment-page header h1 {
        font-size: 1.5em;
    }

    .assignment-page .content {
        padding: 25px 20px;
    }

    .assignment-page .action-buttons {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .assignment-page .back-btn {
        width: 100%;
        text-align: center;
    }

    .assignment-page .solution-buttons {
        width: 100%;
        flex-direction: column;
    }

    .assignment-page .solution-buttons .btn {
        width: 100%;
        text-align: center;
    }

    .assignment-page h2 {
        font-size: 1.3em;
    }

    .assignment-page ol,
    .assignment-page ul {
        margin-left: 20px;
    }

    /* Cheat Sheet Page - Mobile */
    .cheat-sheet-page header {
        padding: 30px 20px;
    }

    .cheat-sheet-page header h1 {
        font-size: 1.8em;
    }

    .cheat-sheet-page .content {
        padding: 25px 20px;
    }

    .cheat-sheet-page section h2 {
        font-size: 1.6em;
    }

    .cheat-sheet-page section h3 {
        font-size: 1.3em;
    }

    .cheat-sheet-page section h4 {
        font-size: 1.1em;
    }

    .cheat-sheet-page pre {
        padding: 15px;
        font-size: 0.85em;
    }

    .cheat-sheet-page .toc {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px 5px;
    }

    .container {
        border-radius: 8px;
    }

    /* Index Page - Small Mobile */
    .index-page header h1 {
        font-size: 1.5em;
    }

    .index-page .btn-cheat-sheet {
        font-size: 1em;
        padding: 12px 24px;
        width: 100%;
        display: block;
        text-align: center;
    }

    .index-page .ai-guidance-callout,
    .index-page .exercises-info-callout {
        margin: 15px 10px;
        padding: 15px;
    }

    .index-page .ai-guidance-callout h3,
    .index-page .exercises-info-callout h3 {
        font-size: 1.1em;
    }

    .index-page .exercises-grid {
        padding: 10px 15px 20px 15px;
    }

    .index-page footer {
        padding: 20px 15px;
    }

    .index-page footer .footer-logo {
        height: 30px;
    }

    /* Assignment Page - Small Mobile */
    .assignment-page header h1 {
        font-size: 1.3em;
    }

    .assignment-page .content {
        padding: 20px 15px;
    }

    /* Cheat Sheet Page - Small Mobile */
    .cheat-sheet-page header h1 {
        font-size: 1.5em;
    }

    .cheat-sheet-page .content {
        padding: 20px 15px;
    }

    .cheat-sheet-page section h2 {
        font-size: 1.4em;
    }

    .cheat-sheet-page section h3 {
        font-size: 1.2em;
    }

    .cheat-sheet-page pre {
        padding: 12px;
        font-size: 0.8em;
    }
}
