:root {
    --bg-color: #101010;
    --surface-color: #1e1e1e;
    --module-bg-color: #252525;
    --primary-color: #03dac6;
    --primary-variant-color: #018786;
    --secondary-color: #bb86fc;
    --info-color: #ffc107;
    --text-color: #e0e0e0;
    --text-color-light: #a0a0a0;
    --correct-color: #4caf50;
    --incorrect-color: #f44336;
    --surface-light: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.05);
    --font-family: 'Google Sans', 'Roboto', sans-serif;
    --border-radius: 16px;
    --container-padding: 3rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at top right, rgba(3, 218, 198, 0.05), transparent 40%), 
                      radial-gradient(circle at bottom left, rgba(187, 134, 252, 0.05), transparent 50%);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.back-home-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background-color: var(--surface-color);
    color: var(--text-color-light);
    padding: 0.7rem 1.2rem;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-family: var(--font-family);
    font-weight: 500;
    border: 1px solid var(--surface-light);
    transition: all 0.2s ease;
}
.back-home-btn:hover {
    background-color: var(--surface-light);
    color: var(--text-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.container {
    width: 100%;
    max-width: 800px;
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--surface-light);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.view {
    display: none;
    padding: var(--container-padding);
    animation: fadeInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.view.active { display: block; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; opacity: 0; }

.btn {
    font-family: var(--font-family);
    padding: 0.9rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.25s ease;
    background-color: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.btn-primary { color: var(--primary-color); border-color: var(--primary-color); }
.btn-primary:hover { background-color: var(--primary-color); color: var(--bg-color); }
.btn-secondary { color: var(--secondary-color); border-color: var(--secondary-color); }
.btn-secondary:hover { background-color: var(--secondary-color); color: var(--bg-color); }
.btn-info { color: var(--info-color); border-color: var(--info-color); }
.btn-info:hover { background-color: var(--info-color); color: var(--bg-color); }
.btn-subtle { color: var(--text-color-light); border-color: var(--surface-light); font-weight: 400; }
.btn-subtle:hover { background-color: var(--surface-light); color: var(--text-color); transform: translateY(0); box-shadow: none; }
.btn-full { width: 100%; margin-top: 1.5rem; background-color: var(--primary-color); color: var(--bg-color); font-size: 1.1rem; font-weight: 700; }
.btn-full:hover { background-color: var(--primary-variant-color); border-color: var(--primary-variant-color); }

.view-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; gap: 1.5rem; }
.main-header { text-align: left; }
h1 { font-size: 2.8rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--text-color); }
.subtitle { font-size: 1.1rem; color: var(--text-color-light); max-width: 600px; line-height: 1.5; }
#show-checklist-btn { padding: 0.5rem 1rem; font-size: 0.9rem; }

.settings-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    background-color: var(--module-bg-color);
    border-radius: var(--border-radius);
    margin-bottom: 2.5rem;
    border: 1px solid var(--border-light);
}
#toggle-extended-btn {
    flex-shrink: 0;
}
.toggle-description {
    font-size: 0.85rem;
    color: var(--text-color-light);
    flex-grow: 1;
}

.module-section {
    background-color: var(--module-bg-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-light);
    transition: all 0.4s ease;
}
.module-section:hover { border-color: var(--surface-light); }
.module-section h2 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--surface-light);
    color: var(--secondary-color);
    font-weight: 700;
    letter-spacing: 0.5px;
}
.theme-block { margin-bottom: 2rem; }
.theme-block:last-of-type { margin-bottom: 1.5rem; }
.theme-block h3 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}
.theme-block h3::before {
    content: '•';
    color: var(--primary-color);
    margin-right: 10px;
    font-size: 1.5em;
    line-height: 0.8;
}
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding-left: 1.2rem;
}
.module-divider {
    border: none;
    height: 1px;
    background-color: var(--surface-light);
    margin: 1.5rem 0;
    opacity: 0.5;
}

#intro-title { color: var(--primary-color); font-size: 2rem; font-weight: 700; }
#intro-text { font-size: 1.15rem; color: var(--text-color); line-height: 1.8; margin-bottom: 2.5rem; }
#intro-text h2, #intro-text h3 { margin-top: 1.5rem; margin-bottom: 0.5rem; }
#intro-text h2 { color: var(--primary-color); font-size: 1.3rem; }
#intro-text h3 { color: var(--secondary-color); font-size: 1.1rem; }
#intro-text ul { padding-left: 1.5rem; margin-top: 0.5rem; }

#quiz-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; }
#quiz-progress-container { flex-grow: 1; height: 10px; background-color: var(--surface-light); border-radius: 5px; overflow: hidden; }
#quiz-progress-bar { width: 0%; height: 100%; background: linear-gradient(90deg, var(--primary-variant-color), var(--primary-color)); transition: width 0.4s ease; }
#question-text { font-size: 1.5rem; line-height: 1.5; text-align: center; margin-bottom: 2.5rem; color: var(--text-color); font-weight: 500; }
#answer-options { display: flex; flex-direction: column; gap: 1rem; }

.answer-btn, .tf-btn { padding: 1.2rem; background-color: transparent; border: 1px solid var(--surface-light); color: var(--text-color-light); border-radius: var(--border-radius); text-align: left; font-size: 1.05rem; cursor: pointer; transition: all 0.2s; display: block; width: 100%; }
.answer-btn:hover:not([disabled]), .tf-btn:hover:not([disabled]) { border-color: var(--secondary-color); background-color: rgba(187, 134, 252, 0.1); color: var(--text-color); }
.answer-btn.correct, .tf-btn.correct { background-color: var(--correct-color); border-color: var(--correct-color); color: #fff; font-weight: 500; }
.answer-btn.incorrect, .tf-btn.incorrect { background-color: var(--incorrect-color); border-color: var(--incorrect-color); color: #fff; font-weight: 500; }
.answer-btn:disabled, .tf-btn:disabled { cursor: not-allowed; opacity: 0.7; }
.tf-container { display: flex; gap: 1rem; }
.tf-btn { text-align: center; }

.drawing-task-container {
    text-align: center;
    padding: 2rem;
    border: 1px dashed var(--surface-light);
    border-radius: var(--border-radius);
    background-color: var(--module-bg-color);
}
.drawing-task-container p { font-size: 1.1rem; line-height: 1.6; color: var(--text-color-light); margin-bottom: 1.5rem; }
.drawing-task-container code { background-color: var(--bg-color); padding: 0.2rem 0.5rem; border-radius: 6px; font-family: monospace; color: var(--primary-color); }
.drawing-task-container .btn { margin-top: 1rem; }

#quiz-footer { margin-top: 2rem; text-align: center; min-height: 90px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#feedback-text { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.5rem; display: block; }
#feedback-text.correct { color: var(--correct-color); }
#feedback-text.incorrect { color: var(--incorrect-color); }
#feedback-tip { font-size: 1rem; color: var(--text-color-light); margin-bottom: 1.5rem; font-style: italic; max-width: 600px; }
#next-question-btn { padding: 1rem 3rem; font-size: 1.1rem; }

.results-content { text-align: center; display: flex; flex-direction: column; align-items: center; width: 100%; }
.results-content .view-header { width: 100%; justify-content: center; margin-bottom: 2rem; }
.results-content h2 { font-size: 2.5rem; color: var(--primary-color); margin: 0; text-align: center; }
.result-chart { width: 180px; height: 180px; margin: 0 auto 2rem; display: block; }
.circular-chart { display: block; width: 100%; height: 100%; }
.circle-bg { fill: none; stroke: var(--surface-light); stroke-width: 3; }
.circle { fill: none; stroke: var(--correct-color); stroke-width: 3; stroke-linecap: round; transition: stroke-dasharray 1s ease-out; }
.percentage-text { fill: var(--text-color); font-size: 0.6em; text-anchor: middle; font-weight: 700; }
#result-score { font-size: 1.4rem; margin-bottom: 0.8rem; font-weight: 500; text-align: center; width: 100%; display: block; color: var(--text-color); }
#result-motivation { font-size: 1.1rem; color: var(--text-color-light); max-width: 600px; margin: 0 auto 2rem; text-align: center; line-height: 1.5; width: 100%; display: block; }
#feedback-details { text-align: left; width: 100%; max-width: 600px; margin: 2rem auto 0; padding-top: 2rem; border-top: 1px solid var(--surface-light); }
#feedback-details h3 { color: var(--incorrect-color); margin-bottom: 1.5rem; text-align: center; font-weight: 700; }
#feedback-list { list-style: none; }
#feedback-list li { background-color: rgba(244, 67, 54, 0.1); padding: 1rem; border-radius: 8px; margin-bottom: 0.8rem; border-left: 4px solid var(--incorrect-color); }
#feedback-list li b { color: var(--incorrect-color); display: block; margin-bottom: 0.3rem; }
.results-actions { display: flex; justify-content: center; gap: 1rem; margin-top: 2.5rem; flex-wrap: wrap; width: 100%; }
.results-actions .btn { padding: 1rem 2rem; min-width: 160px; }

.hidden { display: none !important; }
.modal { position: fixed; z-index: 200; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.85); backdrop-filter: blur(5px); display: flex; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.3s ease; pointer-events: none;}
.modal:not(.hidden) { opacity: 1; pointer-events: auto;}
.modal-content { background-color: var(--surface-color); padding: 2.5rem; border: 1px solid var(--surface-light); width: 90%; max-width: 700px; border-radius: var(--border-radius); position: relative; transform: scale(0.95); transition: transform 0.3s ease; box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
.modal:not(.hidden) .modal-content { transform: scale(1); }
.modal-content h2 { color: var(--primary-color); }
.close-btn { color: var(--text-color-light); position: absolute; top: 1.5rem; right: 1.5rem; font-size: 2rem; font-weight: bold; cursor: pointer; line-height: 1; }
.close-btn:hover { color: var(--primary-color); }
#checklist-content { margin-top: 2rem; max-height: 60vh; overflow-y: auto; padding-right: 1rem; }
.checklist-module { margin-bottom: 2.5rem; }
.checklist-module:last-of-type { margin-bottom: 0; }
.checklist-module h3 { font-size: 1.2rem; font-weight: 700; color: var(--secondary-color); margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--surface-light); letter-spacing: 0.5px; }
.checklist-module ul { list-style: none; padding: 0; }
.checklist-module li { font-size: 1rem; color: var(--text-color-light); padding: 1rem 1rem 1rem 2.5rem; position: relative; border-bottom: 1px solid var(--border-light); transition: background-color 0.2s ease; line-height: 1.5; }
.checklist-module li:last-child { border-bottom: none; }
.checklist-module li:hover { background-color: var(--surface-light); color: var(--text-color); }
.checklist-module li::before { content: '✓'; position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--correct-color); font-weight: 700; font-size: 1.2rem; }

@media (max-width: 768px) {
    body { padding: 0; align-items: flex-start; }
    .container { padding: 0; min-height: 100vh; border-radius: 0; border: none; box-shadow: none; }
    .view { padding: 1.5rem; }
    h1 { font-size: 2rem; }
    .module-section { padding: 1.5rem; }
    .results-actions { flex-direction: column-reverse; }
    .results-actions .btn { width: 100%; }
    .back-home-btn { top: 10px; left: 10px; padding: 0.5rem 1rem; font-size: 0.9rem; }
    .settings-bar { flex-direction: column; align-items: flex-start; text-align: left; }
    .toggle-description { margin-top: 0.5rem; }
}

/* --- Coding Practice Styles --- */
.code-snippet {
    background-color: #1e1e1e;
    border: 1px solid var(--surface-light);
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 1.1rem;
    color: #d4d4d4;
    margin-bottom: 1.5rem;
    text-align: left;
    line-height: 2;
    position: relative;
}

.code-input {
    background-color: #2d2d2d;
    border: 1px solid var(--primary-color);
    color: #fff;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 1.1rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    width: 120px;
    text-align: center;
    outline: none;
    transition: all 0.2s;
    display: inline-block;
    vertical-align: middle;
}

.code-input:focus {
    box-shadow: 0 0 0 2px rgba(3, 218, 198, 0.3);
}

.code-input.correct {
    border-color: var(--correct-color);
    background-color: rgba(76, 175, 80, 0.1);
    color: var(--correct-color);
}

.code-input.incorrect {
    border-color: var(--incorrect-color);
    background-color: rgba(244, 67, 54, 0.1);
    color: var(--incorrect-color);
}

.code-area {
    width: 100%;
    height: 120px;
    background-color: #1e1e1e;
    border: 1px solid var(--surface-light);
    color: var(--primary-color);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 1.1rem;
    padding: 1rem;
    border-radius: 8px;
    resize: none;
    outline: none;
}

.code-area:focus {
    border-color: var(--primary-color);
}

#check-input-btn {
    margin-top: 1rem;
    width: 100%;
}