/* static/css/styles.css */

:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --text-color: #333;
    --bg-color: #f8f9fa;
    --card-bg: #fff;
    --border-color: #dee2e6;
    --code-bg: #f8f9fa;
    --footer-bg: #f8f9fa;
    --list-item-bg: #fff;
    --gradient-start: #eef5ff;
    --gradient-end: #f9fcff;
    --base-font-size: 16px;
    --line-spacing: 1.5;
    --transition-duration: 0.3s;
}

body {
    color: var(--text-color);
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: var(--base-font-size);
    line-height: var(--line-spacing);
    transition: all var(--transition-duration) ease;
}

footer {
    margin-top: auto;
    background-color: var(--footer-bg);
    color: var(--text-color);
}

.card {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

pre {
    border-radius: 5px;
    padding: 1rem;
    margin: 1rem 0;
    background-color: var(--code-bg);
    position: relative;
    overflow: hidden;
}

.sticky-top { z-index: 1025; }

/* Sidebar independent scroll with shadows */
.sidebar-card {
    overflow: hidden;
}

.sidebar-scroll {
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
    position: relative;
}

.sidebar-scroll.is-scrolling::before,
.sidebar-scroll.has-more::after {
    content: '';
    position: sticky;
    left: 0;
    right: 0;
    height: 12px;
    display: block;
    z-index: 1;
}

.sidebar-scroll.is-scrolling::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.08), rgba(0,0,0,0));
}

.sidebar-scroll.has-more::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.08), rgba(0,0,0,0));
}

/* Modern hero */
.hero-section {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    border: 1px solid var(--border-color);
}
.hero-visual { border-radius: 8px; background: var(--card-bg); }
.code-window { border: 1px solid #3c3c3c; border-radius: 8px; overflow: hidden; }
.code-window-header { background: #2d2d30; padding: 8px 12px; display: flex; gap: 6px; }
.code-window-header span { width: 10px; height: 10px; border-radius: 50%; background: #bbb; }
.code-window pre { border: 0; border-radius: 0; margin: 0; }

/* Banner code formatting - ensure proper left alignment and indentation */
.hero-visual .code-window pre {
    text-align: left;
    padding: 1rem;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 14px;
    line-height: 1.5;
    background-color: #1e1e1e;
    color: #d4d4d4;
    margin: 0;
    border: 0;
    border-radius: 0;
    overflow-x: auto;
}

.hero-visual .code-window code {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    background-color: transparent;
    color: inherit;
    padding: 0;
    border: 0;
    border-radius: 0;
}

/* Banner code always uses dark theme regardless of user preference */
.hero-visual .code-window pre[data-theme="dark"] {
    background-color: #1e1e1e !important;
    color: #d4d4d4 !important;
}

.hero-visual .code-window pre[data-theme="dark"] code {
    background-color: transparent !important;
    color: #d4d4d4 !important;
}

/* Enhanced syntax highlighting for all code blocks */
.hljs {
    display: block !important;
    overflow-x: auto !important;
    padding: 1em !important;
    background: #282c34 !important;
    color: #abb2bf !important;
}

/* Ensure all highlight.js elements are visible */
.hljs * {
    color: inherit !important;
}

/* Override any conflicting styles */
pre code.hljs {
    background: transparent !important;
    color: inherit !important;
}

/* Enhanced syntax highlighting colors for all code blocks (VS Code inspired) */
.hljs-keyword,
.hljs-selector-tag,
.hljs-built_in,
.hljs-name,
.hljs-tag {
    color: #569cd6 !important;
}

.hljs-string,
.hljs-title,
.hljs-section,
.hljs-attribute,
.hljs-literal,
.hljs-template-tag,
.hljs-template-variable,
.hljs-type,
.hljs-addition {
    color: #ce9178 !important;
}

.hljs-comment,
.hljs-quote,
.hljs-deletion,
.hljs-meta {
    color: #6a9955 !important;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-title,
.hljs-section,
.hljs-doctag,
.hljs-type,
.hljs-name,
.hljs-strong {
    font-weight: bold !important;
}

.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-attr {
    color: #b5cea8 !important;
}

.hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-name {
    color: #9cdcfe !important;
}

.hljs-operator,
.hljs-punctuation {
    color: #d4d4d4 !important;
}

.hljs-class .hljs-title,
.hljs-function .hljs-title {
    color: #dcdcaa !important;
}

.hljs-regexp,
.hljs-link {
    color: #d16969 !important;
}

.hljs-symbol,
.hljs-bullet,
.hljs-built_in,
.hljs-builtin-name,
.hljs-selector-id,
.hljs-selector-class {
    color: #4ec9b0 !important;
}

.hljs-meta,
.hljs-subst,
.hljs-symbol,
.hljs-symbol .hljs-string,
.hljs-link {
    color: #d16969 !important;
}

.hljs-attr {
    color: #9cdcfe !important;
}

.hljs-attribute {
    color: #9cdcfe !important;
}

.hljs-property {
    color: #9cdcfe !important;
}

.hljs-params {
    color: #d4d4d4 !important;
}

/* Dark theme specific overrides */
body.dark-theme .hljs {
    background: #1e1e1e !important;
    color: #d4d4d4 !important;
}

body.dark-theme .hljs-keyword,
body.dark-theme .hljs-selector-tag,
body.dark-theme .hljs-built_in,
body.dark-theme .hljs-name,
body.dark-theme .hljs-tag {
    color: #569cd6 !important;
}

body.dark-theme .hljs-string,
body.dark-theme .hljs-title,
body.dark-theme .hljs-section,
body.dark-theme .hljs-attribute,
body.dark-theme .hljs-literal,
body.dark-theme .hljs-template-tag,
body.dark-theme .hljs-template-variable,
body.dark-theme .hljs-type,
body.dark-theme .hljs-addition {
    color: #ce9178 !important;
}

body.dark-theme .hljs-comment,
body.dark-theme .hljs-quote,
body.dark-theme .hljs-deletion,
body.dark-theme .hljs-meta {
    color: #6a9955 !important;
}

body.dark-theme .hljs-number,
body.dark-theme .hljs-literal,
body.dark-theme .hljs-variable,
body.dark-theme .hljs-template-variable,
body.dark-theme .hljs-tag .hljs-attr {
    color: #b5cea8 !important;
}

body.dark-theme .hljs-variable,
body.dark-theme .hljs-template-variable,
body.dark-theme .hljs-tag .hljs-name {
    color: #9cdcfe !important;
}

body.dark-theme .hljs-operator,
body.dark-theme .hljs-punctuation {
    color: #d4d4d4 !important;
}

body.dark-theme .hljs-class .hljs-title,
body.dark-theme .hljs-function .hljs-title {
    color: #dcdcaa !important;
}

body.dark-theme .hljs-regexp,
body.dark-theme .hljs-link {
    color: #d16969 !important;
}

body.dark-theme .hljs-symbol,
body.dark-theme .hljs-bullet,
body.dark-theme .hljs-built_in,
body.dark-theme .hljs-builtin-name,
body.dark-theme .hljs-selector-id,
body.dark-theme .hljs-selector-class {
    color: #4ec9b0 !important;
}

body.dark-theme .hljs-attr,
body.dark-theme .hljs-attribute,
body.dark-theme .hljs-property {
    color: #9cdcfe !important;
}

/* Ensure code blocks in topic content have proper highlighting */
.topic-content .hljs {
    background: transparent !important;
}

.topic-content pre code.hljs {
    background: transparent !important;
    color: inherit !important;
}

/* Force syntax highlighting to work on all code elements */
pre code[class*="language-"] {
    color: inherit !important;
}

pre code[class*="language-"] * {
    color: inherit !important;
}

/* Ensure proper inheritance for all syntax elements */
.hljs *,
.hljs-keyword,
.hljs-string,
.hljs-comment,
.hljs-number,
.hljs-variable,
.hljs-operator,
.hljs-class,
.hljs-function,
.hljs-attr,
.hljs-attribute,
.hljs-property,
.hljs-params,
.hljs-regexp,
.hljs-symbol,
.hljs-built_in,
.hljs-builtin-name,
.hljs-selector-id,
.hljs-selector-class,
.hljs-selector-tag,
.hljs-name,
.hljs-tag,
.hljs-title,
.hljs-section,
.hljs-literal,
.hljs-template-tag,
.hljs-template-variable,
.hljs-type,
.hljs-addition,
.hljs-quote,
.hljs-deletion,
.hljs-meta,
.hljs-bullet,
.hljs-link,
.hljs-punctuation {
    color: inherit !important;
}

/* Additional fallback styles for better syntax highlighting */
.hljs-keyword,
.hljs-selector-tag,
.hljs-built_in,
.hljs-name,
.hljs-tag {
    color: #569cd6 !important;
    font-weight: bold !important;
}

.hljs-string,
.hljs-title,
.hljs-section,
.hljs-attribute,
.hljs-literal,
.hljs-template-tag,
.hljs-template-variable,
.hljs-type,
.hljs-addition {
    color: #ce9178 !important;
}

.hljs-comment,
.hljs-quote,
.hljs-deletion,
.hljs-meta {
    color: #6a9955 !important;
    font-style: italic !important;
}

.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-attr {
    color: #b5cea8 !important;
}

.hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-name {
    color: #9cdcfe !important;
}

.hljs-operator,
.hljs-punctuation {
    color: #d4d4d4 !important;
}

.hljs-class .hljs-title,
.hljs-function .hljs-title {
    color: #dcdcaa !important;
}

.hljs-regexp,
.hljs-link {
    color: #d16969 !important;
}

.hljs-symbol,
.hljs-bullet,
.hljs-built_in,
.hljs-builtin-name,
.hljs-selector-id,
.hljs-selector-class {
    color: #4ec9b0 !important;
}

.hljs-attr,
.hljs-attribute,
.hljs-property {
    color: #9cdcfe !important;
}

.hljs-params {
    color: #d4d4d4 !important;
}

/* Force syntax highlighting to override any conflicting styles */
pre code.hljs,
pre code[class*="language-"] {
    color: inherit !important;
    background: transparent !important;
}

pre code.hljs *,
pre code[class*="language-"] * {
    color: inherit !important;
}

/* Ensure banner code always has proper highlighting */
.hero-visual pre code.hljs,
.hero-visual pre code[class*="language-"] {
    color: #d4d4d4 !important;
    background: transparent !important;
}

.hero-visual pre code.hljs *,
.hero-visual pre code[class*="language-"] * {
    color: inherit !important;
}

/* Course cards */
.course-card { transition: transform .15s ease, box-shadow .15s ease; }
.course-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.08); }
.course-placeholder { height: 180px; background: #eef2f6; border-bottom: 1px solid var(--border-color); }

/* Feature cards */
.feature-card { border: 1px solid var(--border-color); border-radius: 8px; background: var(--card-bg); }

/* Back to top */
.back-to-top { position: fixed; right: 16px; bottom: 16px; border-radius: 50%; width: 44px; height: 44px; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(0,0,0,.15); }

/* Scroll progress */
#scrollProgress { position: fixed; top: 0; left: 0; height: 3px; background: var(--primary-color); width: 0; z-index: 2000; }

/* Reading progress inside topic card */
.reading-progress {
    position: relative;
    height: 3px;
    background: rgba(0,0,0,0.06);
}
.reading-progress-bar {
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--primary-color), #7ab8ea);
    transition: width .15s linear;
}

/* Result badge */
.result-badge { width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center; background: #eaf4ff; border: 1px solid var(--border-color); }
.result-badge span { font-size: 28px; font-weight: 700; color: #1e88e5; }

/* Code block enhancements */
.code-block-wrapper {
    margin: 1.5rem 0;
    border-radius: 0.375rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
}

.code-block-wrapper pre {
    margin: 0;
    border-radius: 0;
    border: none;
    background-color: var(--card-bg);
    padding: 1rem;
}

.code-block-wrapper code {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    display: block;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: var(--code-bg);
    border-bottom: 1px solid var(--border-color);
}

.code-language {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: var(--text-color);
}

.copy-button {
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-color);
}

.copy-button:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.code-container {
    display: flex;
    position: relative;
    overflow: hidden;
}

.line-numbers {
    display: flex;
    flex-direction: column;
    padding: 1rem 0.5rem;
    min-width: 2.5rem;
    text-align: right;
    background-color: var(--code-bg);
    color: #888;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9rem;
    user-select: none;
    border-right: 1px solid var(--border-color);
}

.line-numbers span {
    line-height: 1.5;
}

.code-container pre {
    margin: 0;
    border-radius: 0;
    flex-grow: 1;
    border: none;
    background-color: var(--card-bg);
}

.code-container code {
    padding: 0;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Styles for regular code blocks (fallback) */
pre[data-language] {
    padding-top: 2.5rem;
}

pre[data-language]::before {
    content: attr(data-language);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 0.5rem 1rem;
    background-color: var(--code-bg);
    border-bottom: 1px solid var(--border-color);
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: var(--text-color);
}

/* List styling */
.list-group-item {
    background-color: var(--list-item-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}

/* Active heading highlight for in-page anchors in sidebar (optional) */
.sidebar-topic-list a.active-heading {
    background-color: rgba(52, 152, 219, 0.08);
    border-left: 3px solid var(--primary-color);
}

/* Animation for progress tracking */
.progress-bar {
    transition: width 0.5s ease-in-out;
}

.topic-content {
    color: var(--text-color);
    font-size: var(--base-font-size);
    line-height: var(--line-spacing);
}

/* Topic content reveal animation */
.topic-content > * {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .4s ease, transform .4s ease;
}

.topic-content > *.reveal-in {
    opacity: 1;
    transform: translateY(0);
}

/* Mini ToC styling */
.mini-toc ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}
.mini-toc li { margin-bottom: .25rem; }
.mini-toc a {
    text-decoration: none;
    color: inherit;
    font-size: .95rem;
}
.mini-toc a:hover { color: var(--primary-color); }

/* Focus mode: hide sidebar on large screens, expand content */
.focus-mode .col-md-3 { display: none; }
.focus-mode .col-md-9 { width: 100%; flex: 0 0 100%; max-width: 100%; }

/* Markdown content styling */
.topic-content h1,
.topic-content h2,
.topic-content h3,
.topic-content h4,
.topic-content h5,
.topic-content h6 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.topic-content h2 {
    font-size: 1.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.topic-content h3 {
    font-size: 1.5rem;
}

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

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

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

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

.topic-content table th,
.topic-content table td {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
}

.topic-content table th {
    background-color: var(--bg-color);
}

.topic-content blockquote {
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    border-left: 4px solid var(--primary-color);
    background-color: var(--bg-color);
}

/* Basic code block styling */
pre {
    position: relative;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    margin: 1.5rem 0;
    padding: 1rem;
    overflow: auto;
}

pre code {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    display: block;
}

/* Code header with language */
pre::before {
    content: "code";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background-color: #e9ecef;
    padding: 0.5rem 1rem;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    border-bottom: 1px solid #dee2e6;
}

/* Disable pseudo-elements for code blocks inside wrapper */
.code-block-wrapper pre::before,
.code-block-wrapper pre::after {
    display: none;
}

/* Set language name from class */
pre.language-python::before {
    content: "python";
}
pre.language-javascript::before, pre.language-js::before {
    content: "javascript";
}
pre.language-html::before {
    content: "html";
}
pre.language-css::before {
    content: "css";
}
pre.language-bash::before, pre.language-shell::before {
    content: "bash";
}
pre.language-c::before {
    content: "c";
}
pre.language-cpp::before {
    content: "c++";
}
pre.language-java::before {
    content: "java";
}

/* Copy button */
pre::after {
    content: "Copy";
    position: absolute;
    top: 0.25rem;
    right: 1rem;
    background-color: transparent;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

/* Exclude copy button from banner code */
pre.no-copy-button::after {
    display: none;
}

pre:hover::after {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* Exclude hover effect from banner code */
pre.no-copy-button:hover::after {
    display: none;
}

/* Add padding to make room for the header */
pre {
    padding-top: 2.5rem !important;
}

/* Dark theme adjustments */
body.dark-theme pre {
    background-color: #282c34;
    border-color: #444;
}

body.dark-theme pre::before {
    background-color: #2c2c2c;
    border-color: #444;
    color: #f8f9fa;
}

body.dark-theme pre::after {
    border-color: #444;
    color: #f8f9fa;
}

/* Exclude copy button from banner code in dark theme */
body.dark-theme pre.no-copy-button::after {
    display: none;
}

body.dark-theme pre:hover::after {
    background-color: #5dade2;
    color: white;
    border-color: #5dade2;
}

/* Exclude hover effect from banner code in dark theme */
body.dark-theme pre.no-copy-button:hover::after {
    display: none;
}

/* Add to static/css/styles.css */

/* Line numbers for code blocks */
.code-container {
    display: flex;
    position: relative;
    overflow: hidden;
    margin: 1.5rem 0;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
}

.line-numbers {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    min-width: 2.5rem;
    text-align: right;
    background-color: var(--code-bg);
    color: #888;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9rem;
    user-select: none;
    border-right: 1px solid var(--border-color);
}

.line-number {
    padding: 0 0.5rem;
    line-height: 1.5;
}

.code-container pre {
    margin: 0;
    border-radius: 0;
    flex-grow: 1;
    border: none;
    padding-top: 1rem !important;
}

/* Dark theme adjustments */
body.dark-theme .line-numbers {
    background-color: #2c2c2c;
    color: #888;
    border-color: var(--border-color);
}

/* Course card styling */
.course-image-container {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 1rem;
}

.course-image {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.card .card-body {
    display: flex;
    flex-direction: column;
}

.card .card-title {
    margin-bottom: 1rem;
    align-self: anchor-center;
}

.card .card-text {
    flex-grow: 1;
    margin-bottom: 1rem;
    align-self: anchor-center;
}

.card .btn {
    margin: 0 auto;
}

/* Add this to static/css/styles.css */
.subtopic-list {
    margin-left: 20px;
    border-left: 2px solid var(--border-color);
}

.topic-parent {
    font-weight: 500;
}

.topic-child {
    padding-left: 15px;
    position: relative;
}

.topic-child:before {
    content: "└";
    position: absolute;
    left: 0;
    color: var(--border-color);
}

/* Tree view styles */
.topic-tree .subtopic-list {
    margin-left: 20px;
    border-left: 2px solid var(--border-color);
    padding-left: 15px;
}

.topic-tree .subtopic-item {
    position: relative;
    padding: 5px 0;
}

.topic-tree .subtopic-item:before {
    content: "└─";
    position: absolute;
    left: -15px;
    color: var(--border-color);
}

/* Indentation for sidebar */
.sidebar-topic-list .topic-parent {
    font-weight: 500;
}

.sidebar-topic-list .topic-child {
    padding-left: 20px;
    position: relative;
}

.sidebar-topic-list .topic-child:before {
    content: "└";
    position: absolute;
    left: 8px;
    color: var(--border-color);
}

pre[data-copied]::after {
    content: "Copied!";
    background-color: #28a745;
    color: white;
    border-color: #28a745;
}

/* Enhanced styling for copy button when clicked */
.copy-button.copied {
    background-color: #28a745;
    color: white;
    border-color: #28a745;
}


/* XP and Level display in navbar */
.xp-container {
    display: flex;
    align-items: center;
    height: 32px;
    margin-right: 10px;
}

/* XP and Level display in navbar */
.xp-container {
    display: flex;
    align-items: center;
    height: 32px;
    margin-right: 10px;
}

.level-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    margin-right: 8px;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.xp-bar-container {
    position: relative;
    width: 90px;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.xp-bar {
    height: 100%;
    background-color: #4CAF50;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.xp-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #525252;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Accessibility Features */
.high-contrast {
    --text-color: #000;
    --bg-color: #fff;
    --card-bg: #fff;
    --border-color: #000;
    --code-bg: #f0f0f0;
}

.high-contrast .card {
    border: 2px solid #000;
}

.high-contrast .btn {
    border: 2px solid #000;
}

.dyslexic-font {
    font-family: 'OpenDyslexic', 'Comic Sans MS', 'Arial', sans-serif;
    letter-spacing: 0.1em;
    word-spacing: 0.2em;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus indicators for accessibility */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skip to content link for screen readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}