/* ================= BASE THEME ================= */ :root { /* Primary colors */ --primary-color: #5e4b8b; --primary-light: #8a77b5; --primary-dark: #3b2e63; /* Section colors (default to primary) */ --section-color: var(--primary-color); --section-color-light: var(--primary-light); --section-color-dark: var(--primary-dark); --section-color-rgb: 94, 75, 139; /* Secondary colors */ --secondary-color: #444444; --secondary-dark: #222222; /* Text colors */ --text-color: #333333; --dark-text: #111111; --light-text: #666666; --editor-text: #d4d4d4; --white-text: #ffffff; /* Background colors */ --bg-color: #f8f7fc; --panel-bg: #ffffff; --code-bg: #f7f5fa; --editor-bg: #1e1e1e; --editor-highlight: #303030; /* Border colors */ --border-color: #e0e0e0; /* Status colors */ --info-color: #7a93fe; --success-color: #9b6dd4; --success-color-dark: #7c4dff; --success-color-light: #c9b8e8; --error-color: #cb6e75; --danger-color: #dc3545; /* Special colors */ --primary-bg-light: rgba(94, 75, 139, 0.05); --primary-bg-medium: rgba(94, 75, 139, 0.1); --primary-bg-instruction: rgba(125, 92, 203, 0.9); --success-bg-light: rgba(155, 109, 212, 0.15); --modal-bg: rgba(0, 0, 0, 0.5); /* Typography */ --font-main: "Inter", "Segoe UI", Roboto, sans-serif; --font-code: "JetBrains Mono", "Fira Code", monospace; /* Effects */ --shadow: 0 2px 8px rgba(0, 0, 0, 0.06); --shadow-modal: 0 4px 20px rgba(0, 0, 0, 0.15); /* Sizes */ --header-height: 50px; --sidebar-width: 280px; --border-radius-sm: 4px; --border-radius-md: 6px; --border-radius-lg: 8px; --spacing-xs: 0.5rem; --spacing-sm: 0.75rem; --spacing-md: 1rem; --spacing-lg: 1.5rem; --spacing-xl: 2rem; } /* ================= RESET ================= */ * { margin: 0; padding: 0; box-sizing: border-box; } /* ================= ACCESSIBILITY ================= */ .skip-link { position: absolute; top: -100%; left: 16px; padding: 8px 16px; background: var(--primary-dark); color: var(--white-text); text-decoration: none; border-radius: var(--border-radius-sm); z-index: 10000; transition: top 0.2s ease; } .skip-link:focus { top: 8px; } /* Focus styles - let browser defaults handle most cases */ /* Only enhance for our interactive elements */ /* ================= BASE STYLES ================= */ body { font-family: var(--font-main); background-color: var(--bg-color); color: var(--text-color); line-height: 1.5; overflow: hidden; } code, kbd { font-family: var(--font-code); } /* ================= APP CONTAINER ================= */ .app-container { display: flex; flex-direction: column; height: 100vh; overflow: hidden; } /* ================= HEADER ================= */ .header { display: flex; align-items: center; justify-content: space-between; height: var(--header-height); padding: 0 var(--spacing-md); background: var(--panel-bg); border-bottom: 1px solid var(--border-color); flex-shrink: 0; } .menu-toggle { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; background: none; border: none; cursor: pointer; padding: 4px; border-radius: var(--border-radius-sm); } .menu-toggle:hover { background: var(--primary-bg-light); } .header-level-pill { display: none; padding: 4px 12px; background: var(--primary-bg-light); border-radius: 16px; font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; margin-left: var(--spacing-sm); text-decoration: none; transition: background 0.2s, color 0.2s; } .header-level-pill:hover { background: var(--primary-bg-medium); color: var(--primary-color); } .header-module-name { font-weight: 600; color: var(--text-color); } .header-level { margin-left: 0.5em; } .header-left { display: flex; align-items: center; gap: var(--spacing-sm); } @media (min-width: 769px) { .header-level-pill { display: block; } .header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; } .header-left { justify-self: start; } .header .logo { justify-self: center; } .header-actions { justify-self: end; } } .hamburger-icon { position: relative; width: 18px; height: 2px; background-color: var(--text-color); border-radius: 1px; } .hamburger-icon::before, .hamburger-icon::after { content: ""; position: absolute; left: 0; width: 100%; height: 2px; background-color: var(--text-color); border-radius: 1px; } .hamburger-icon::before { top: -6px; } .hamburger-icon::after { top: 6px; } .logo { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; cursor: pointer; } .logo h1 { font-size: 1rem; font-weight: 800; color: var(--text-color); line-height: 1; display: flex; align-items: center; gap: 0.15rem; } .logo h1 .code-text { color: var(--primary-color); } .logo h1 .crispies-text { background: var(--primary-color); color: white; padding: 0.15rem 0.35rem; border-radius: 4px; letter-spacing: 0.05em; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15); } .help-toggle { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border-color); background: none; font-weight: bold; cursor: pointer; color: var(--light-text); transition: color 0.2s, border-color 0.2s; } .help-toggle:hover { border-color: var(--primary-color); color: var(--primary-color); } .header-actions { display: flex; align-items: center; gap: var(--spacing-sm); } /* ================= GAME LAYOUT ================= */ .game-layout { display: flex; flex: 1; min-height: 0; overflow: hidden; transition: transform 0.3s ease; } /* ================= LEFT PANEL ================= */ .left-panel { width: 50%; display: flex; flex-direction: column; border-right: 1px solid var(--border-color); background: var(--panel-bg); min-height: 0; } .instructions { padding: var(--spacing-md); border-bottom: 1px solid var(--border-color); max-height: calc(50vh - 60px); overflow-y: auto; } /* Smooth lesson transition */ #lesson-title, .lesson-description, .task-instruction { transition: opacity 0.1s ease; } .editor-section.transitioning #lesson-title, .editor-section.transitioning .lesson-description, .editor-section.transitioning .task-instruction { opacity: 0.3; } /* Loading fallback notice */ .loading-fallback { text-align: center; padding: 3rem 1rem; color: var(--light-text); animation: fadeIn 0.5s ease; } .loading-fallback p { margin-bottom: 1rem; } @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } .module-pill { display: inline-flex; align-items: center; gap: 0.5rem; background: var(--primary-bg-medium); color: var(--primary-color); padding: 4px 12px; border-radius: 16px; font-size: 0.8rem; font-weight: 600; min-width: 0; flex-shrink: 1; } .module-name { text-transform: uppercase; letter-spacing: 0.5px; } .module-pill .level-indicator { color: var(--primary-dark); font-weight: 500; opacity: 0.8; } .lesson-title-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: var(--spacing-sm); flex-wrap: wrap; } #lesson-title { font-size: 1.25rem; color: var(--primary-dark); margin: 0; } .share-btn { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; background: transparent; border: none; cursor: pointer; color: var(--light-text); border-radius: var(--border-radius-sm); transition: color 0.2s, background 0.2s; } .share-btn:hover { color: var(--primary-color); background: var(--primary-bg-light); } .share-btn svg { width: 16px; height: 16px; } .completion-badge { display: inline-block; padding: 0.15rem 0.5rem; background: linear-gradient(135deg, #9b59b6, #e040fb, #00bcd4, #7c4dff); color: white; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; border-radius: var(--border-radius-sm); vertical-align: middle; } .lesson-description { font-size: 0.95rem; line-height: 1.6; color: var(--text-color); margin-top: var(--spacing-lg); margin-bottom: var(--spacing-md); } .lesson-description kbd, .lesson-description code { background: var(--primary-bg-medium); padding: 2px 6px; border-radius: 3px; font-size: 0.85rem; } .lesson-description pre { background: var(--code-bg); padding: var(--spacing-md); border-radius: var(--border-radius-sm); overflow-x: auto; font-size: 0.85rem; margin: var(--spacing-sm) 0; } .task-instruction { background: var(--primary-bg-instruction); color: var(--white-text); padding: var(--spacing-sm) var(--spacing-md); border-radius: var(--border-radius-sm); font-size: 0.9rem; line-height: 1.6; } .task-instruction kbd, .task-instruction code { background: rgba(255, 255, 255, 0.25); padding: 2px 8px; border-radius: 4px; font-size: 0.9em; font-weight: 500; } /* ================= EDITOR SECTION ================= */ .editor-section { flex: 1; display: flex; flex-direction: column; min-height: 50vh; position: relative; } /* Playground mode - full height editor */ .editor-section.playground-mode { flex: 1; min-height: 0; } .code-editor { flex: 1; display: flex; flex-direction: column; min-height: 0; } .editor-header { display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-xs) var(--spacing-md); background: var(--code-bg); border-bottom: 1px solid var(--border-color); } .editor-label { font-size: 0.85rem; font-weight: 600; color: var(--light-text); } .editor-actions { display: flex; align-items: center; gap: var(--spacing-sm); } .editor-content { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--editor-bg); overflow: hidden; } /* CodeMirror container styles */ .editor-content .cm-editor { flex: 1; height: 100%; } .editor-content .cm-scroller { overflow: auto; } /* Legacy textarea (fallback) */ .code-input { flex: 1; width: 100%; padding: var(--spacing-md); background: var(--editor-bg); color: var(--editor-text); border: none; font-family: var(--font-code); font-size: 14px; line-height: 1.5; resize: none; outline: none; } .code-input::placeholder { color: #666; } /* ================= HINT AREA ================= */ .hint-area { position: absolute; bottom: 0; left: 0; right: 0; padding: var(--spacing-sm) var(--spacing-md); background: rgba(30, 30, 30, 0.9); backdrop-filter: blur(4px); z-index: 5; } .hint-area:empty { display: none; } .hint { display: flex; align-items: center; gap: var(--spacing-sm); padding: var(--spacing-xs) var(--spacing-sm); background: rgba(94, 75, 139, 0.3); border-left: 3px solid var(--primary-light); border-radius: var(--border-radius-sm); color: var(--editor-text); } .hint-progress { background: var(--primary-color); color: white; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; font-weight: bold; flex-shrink: 0; } .hint-message { font-size: 0.9rem; color: var(--editor-text); } .hint-message kbd, .hint-message code { background: rgba(255, 255, 255, 0.15); color: #fff; padding: 2px 6px; border-radius: 3px; font-size: 0.85rem; font-family: var(--font-code); } .hint-success { background: var(--success-bg-light); border-left-color: var(--success-color); } .hint-success .hint-progress { background: var(--success-color); } /* ================= RIGHT PANEL ================= */ .right-panel { width: 50%; display: flex; flex-direction: column; background: var(--bg-color); min-height: 0; } .preview-section { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; } /* Glow behind preview-wrapper when matched */ .preview-section.matched::before { content: ""; position: absolute; inset: var(--spacing-md); border-radius: var(--border-radius-md); background: conic-gradient(from var(--border-angle), #9b59b6, #e040fb, #00bcd4, #7c4dff, #9b59b6); filter: blur(30px); opacity: 0; animation: spin-glow 3s ease-out forwards; pointer-events: none; } .preview-header { display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-xs) var(--spacing-md) var(--spacing-md); background: transparent; } .preview-label { font-size: 0.85rem; font-weight: 600; color: var(--light-text); } .preview-wrapper { flex: 1; position: relative; background: var(--panel-bg); margin: var(--spacing-md); border-radius: var(--border-radius-md); box-shadow: var(--shadow); overflow: hidden; min-height: 0; border: 6px solid transparent; z-index: 1; } .preview-frame { width: 100%; height: 100%; padding: var(--spacing-xs); } .preview-frame iframe { width: 100%; height: 100%; border: none; border-radius: var(--border-radius-sm); } /* Expected Overlay (toggleable) */ .expected-overlay { position: absolute; inset: 0; background: var(--panel-bg); opacity: 0; pointer-events: none; transition: opacity 0.3s ease; display: flex; align-items: center; justify-content: center; } .expected-overlay.visible { opacity: 1; pointer-events: auto; } .expected-frame { width: 100%; height: 100%; padding: var(--spacing-xs); } .expected-frame iframe { width: 100%; height: 100%; border: none; border-radius: var(--border-radius-sm); } /* Success Match Animation - Rotating gradient border */ @property --border-angle { syntax: ""; initial-value: 0deg; inherits: false; } /* Persistent gradient border for completed lessons */ .preview-wrapper.completed-glow { border: 6px solid transparent; background: linear-gradient(var(--panel-bg), var(--panel-bg)) padding-box, conic-gradient(from 0deg, #9b59b6, #e040fb, #00bcd4, #7c4dff, #9b59b6) border-box; } .preview-wrapper.matched { --border-angle: 0deg; border: 6px solid transparent; background: linear-gradient(var(--panel-bg), var(--panel-bg)) padding-box, conic-gradient(from var(--border-angle), #9b59b6, #e040fb, #00bcd4, #7c4dff, #9b59b6) border-box; animation: spin-border 3s ease-out forwards; overflow: visible; } /* Animated CRISPY speech bubble with SVG tail */ .preview-wrapper.matched::after { content: var(--crispy-quote, "Crispyyyyyy!"); position: absolute; left: 55%; bottom: 0; transform: translateX(-50%) translateY(100%) scale(0.5); font-family: system-ui, -apple-system, sans-serif; font-size: 2rem; font-weight: 800; letter-spacing: 0.05em; color: white; background: linear-gradient(135deg, #9b59b6 0%, #e040fb 50%, #7c4dff 100%); padding: 1.25rem 2rem 1.75rem; z-index: 10; pointer-events: none; animation: crispy-bounce 2.7s ease-in-out 0.3s forwards; opacity: 0; white-space: nowrap; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2)); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 120' preserveAspectRatio='none'%3E%3Cpath d='M20,0 h160 a20,20 0 0 1 20,20 v60 a20,20 0 0 1 -20,20 h-65 l-15,20 l-15,-20 h-65 a20,20 0 0 1 -20,-20 v-60 a20,20 0 0 1 20,-20 z' fill='white'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 120' preserveAspectRatio='none'%3E%3Cpath d='M20,0 h160 a20,20 0 0 1 20,20 v60 a20,20 0 0 1 -20,20 h-65 l-15,20 l-15,-20 h-65 a20,20 0 0 1 -20,-20 v-60 a20,20 0 0 1 20,-20 z' fill='white'/%3E%3C/svg%3E"); -webkit-mask-size: 100% 100%; mask-size: 100% 100%; } @keyframes spin-border { 0% { --border-angle: 0deg; } 80% { --border-angle: -288deg; } 100% { --border-angle: -360deg; border-color: transparent; } } @keyframes spin-glow { 0% { --border-angle: 0deg; opacity: 0; } 10% { opacity: 0.8; } 80% { --border-angle: -288deg; opacity: 0.6; } 100% { --border-angle: -360deg; opacity: 0; } } /* Bowl smiley peek animation from bottom right corner */ .preview-wrapper.matched .preview-frame { position: relative; overflow: hidden; } .preview-wrapper.matched .preview-frame::before { content: ""; position: absolute; bottom: 0; left: 50%; width: max(200px, 50%); aspect-ratio: 1; background: url("/bowl.png") center/contain no-repeat; z-index: 5; pointer-events: none; animation: bowl-peek 3s ease-in-out forwards; transform: translateX(-50%) translateY(100%); } @keyframes bowl-peek { 0% { transform: translateX(-50%) translateY(100%); opacity: 0; } 20% { transform: translateX(-50%) translateY(25%); opacity: 1; } 35% { transform: translateX(-50%) translateY(30%); } 65% { transform: translateX(-50%) translateY(28%); } 100% { transform: translateX(-50%) translateY(100%); opacity: 0; } } @keyframes crispy-bounce { 0% { transform: translateX(-50%) translateY(100%) scale(0.5); opacity: 0; } 20% { transform: translateX(-50%) translateY(-180%) scale(1.1); opacity: 1; } 35% { transform: translateX(-50%) translateY(-170%) scale(1); } 65% { transform: translateX(-50%) translateY(-172%) scale(1); } 100% { transform: translateX(-50%) translateY(100%) scale(0.5); opacity: 0; } } /* ================= GAME CONTROLS ================= */ .game-controls { display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-md); background: var(--panel-bg); border-bottom: 1px solid var(--border-color); box-shadow: 0 10px 20px -10px rgba(0, 0, 0, 0.08); } /* ================= SIDEBAR ================= */ .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; z-index: 199; } .sidebar-backdrop.visible { opacity: 1; visibility: visible; } .sidebar-drawer { position: fixed; left: calc(-1 * var(--sidebar-width)); top: 0; width: var(--sidebar-width); height: 100vh; background: var(--panel-bg); box-shadow: var(--shadow-modal); transition: left 0.3s ease; z-index: 200; display: flex; flex-direction: column; overflow: hidden; } .sidebar-drawer.open { left: 0; } /* Shift main content when sidebar is open */ .app-container:has(.sidebar-drawer.open) .game-layout { transform: translateX(calc(var(--sidebar-width) * 0.8)); } .sidebar-header { display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-md); border-bottom: 1px solid var(--border-color); flex-shrink: 0; } .sidebar-header h3 { font-size: 1.1rem; color: var(--primary-dark); } .close-btn { width: 32px; height: 32px; border: none; background: none; font-size: 1.5rem; cursor: pointer; color: var(--light-text); border-radius: var(--border-radius-sm); } .close-btn:hover { background: var(--primary-bg-light); color: var(--primary-color); } .sidebar-section { padding: var(--spacing-md); border-bottom: 1px solid var(--border-color); } .sidebar-section:last-child { border-bottom: none; } /* Make the lessons nav section fill available space */ nav.sidebar-section { flex: 1; overflow-y: auto; min-height: 0; } .sidebar-section h4 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--light-text); margin-bottom: var(--spacing-sm); } /* Progress Display */ .progress-display { display: flex; flex-direction: column; gap: var(--spacing-xs); } .progress-bar { height: 8px; background: var(--border-color); border-radius: 4px; overflow: hidden; } .progress-fill { height: 100%; background: var(--success-color); border-radius: 4px; transition: width 0.3s ease; width: 0%; } .progress-text { font-size: 0.85rem; color: var(--light-text); } /* Module List in Sidebar */ .module-list { /* No max-height - parent nav.sidebar-section handles overflow */ } .module-container { margin-bottom: 4px; } .module-header { display: flex; align-items: center; padding: var(--spacing-xs) var(--spacing-sm); cursor: pointer; border-radius: var(--border-radius-sm); font-weight: 600; font-size: 0.9rem; transition: background 0.2s; } .module-header:hover { background: var(--primary-bg-light); } /* Native details/summary styling */ details.module-container { margin: 0; } summary.module-header { list-style: none; cursor: pointer; } summary.module-header::-webkit-details-marker { display: none; } summary.module-header::before { content: ""; display: block; flex-shrink: 0; width: 10px; height: 10px; margin-right: 8px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M3 1 L7 5 L3 9' stroke='%23666' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-size: contain; background-repeat: no-repeat; transition: transform 0.2s; } details.module-container[open] > summary.module-header::before { transform: rotate(90deg); } .module-header.completed::after { content: "✓"; margin-left: 8px; color: var(--success-color); } .lessons-container { margin-left: 16px; border-left: 2px solid var(--border-color); padding-left: 8px; } .lesson-list-item { padding: 6px 10px; border-radius: var(--border-radius-sm); cursor: pointer; font-size: 0.85rem; margin: 2px 0; transition: background 0.2s; } .lesson-list-item:hover { background: var(--primary-bg-light); } .lesson-list-item.active { background: var(--primary-bg-medium); font-weight: 600; } .lesson-list-item.completed::before { content: "✓"; margin-right: 6px; color: var(--success-color); } /* Sidebar focus styles - enhance visibility without overriding defaults */ .module-header:focus, .lesson-list-item:focus { background: var(--primary-bg-light); } /* Button reset for sidebar items (when converted to buttons) */ button.module-header, button.lesson-list-item { border: none; background: none; text-align: left; width: 100%; font-family: inherit; color: inherit; } /* ================= BUTTONS ================= */ .btn { padding: var(--spacing-xs) var(--spacing-md); border-radius: var(--border-radius-sm); border: 1px solid var(--border-color); background: var(--panel-bg); color: var(--text-color); cursor: pointer; font-family: var(--font-main); font-size: 0.9rem; transition: background 0.2s, color 0.2s, border-color 0.2s; } .btn:hover { background: var(--code-bg); } .btn img { width: 0.8rem; height: 0.8rem; margin-right: 0.3rem; } .btn-primary { background: var(--section-color, var(--primary-color)); color: var(--white-text); border-color: var(--section-color-dark, var(--primary-dark)); } .btn-primary:hover { background: var(--section-color-dark, var(--primary-dark)); } .btn-run { background: var(--secondary-color); color: var(--white-text); border-color: var(--secondary-dark); } .btn-run:hover { background: var(--secondary-dark); } .btn-run.success { background: var(--success-color); border-color: var(--success-color-dark); } .btn-small { padding: 4px 10px; font-size: 0.8rem; } .btn-icon { display: flex; align-items: center; justify-content: center; padding: 4px 8px; font-size: 1rem; min-width: 32px; background: transparent; color: var(--light-text); border: 1px solid var(--border-color); } .btn-icon:hover { background: var(--bg-color); color: var(--text-color); border-color: var(--primary-color); } .btn-icon img { width: 1rem; height: 1rem; margin: 0; display: block; } .editor-tools { display: flex; gap: 4px; } .btn-ghost { background: transparent; color: var(--light-text); border: 1px solid var(--border-color); } .btn-ghost:hover { background: var(--bg-color); color: var(--danger-color); border-color: var(--danger-color); } .btn-text { background: transparent; color: var(--light-text); border: none; font-size: 0.85rem; text-decoration: underline; padding: var(--spacing-xs) 0; } .btn-text:hover { background: transparent; color: var(--danger-color); } #reset-code-btn { background: var(--primary-color); color: white; border-color: var(--primary-color); } #reset-code-btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); } /* Hide Run button - live preview is stable */ #run-btn { display: none; } /* ================= TOGGLE SWITCH ================= */ /* Setting row (for label + control) */ .setting-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--spacing-sm); } .setting-label { font-size: 0.9rem; color: var(--text-color); } /* Language select */ .lang-select { padding: 6px 10px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: var(--panel-bg); color: var(--text-color); font-size: 0.85rem; cursor: pointer; min-width: 120px; } .lang-select:hover { border-color: var(--primary-color); } .lang-select:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2); } .toggle-switch { display: flex; align-items: center; cursor: pointer; margin-bottom: var(--spacing-sm); } .toggle-switch input { opacity: 0; width: 0; height: 0; } .toggle-slider { position: relative; display: inline-block; width: 36px; height: 20px; background: #ccc; border-radius: 20px; transition: background 0.3s; margin-right: 8px; flex-shrink: 0; } .toggle-slider::before { content: ""; position: absolute; height: 16px; width: 16px; left: 2px; bottom: 2px; background: white; border-radius: 50%; transition: transform 0.3s; } input:checked + .toggle-slider { background: var(--primary-color); } input:checked + .toggle-slider::before { transform: translateX(16px); } .toggle-label { font-size: 0.9rem; color: var(--text-color); } /* ================= DIALOG (Native HTML) ================= */ .dialog { border: none; border-radius: var(--border-radius-lg); box-shadow: var(--shadow-modal); padding: 0; width: 90%; max-width: 600px; max-height: 80vh; overflow-y: auto; background: var(--panel-bg); /* Ensure centering - native dialog should center, but explicit for safety */ margin: auto; position: fixed; inset: 0; height: fit-content; } .dialog::backdrop { background: var(--modal-bg); } .dialog-header { display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-md); border-bottom: 1px solid var(--border-color); } .dialog-header h3 { margin: 0; } .dialog-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--light-text); line-height: 1; padding: 0; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: background 0.2s, color 0.2s; } .dialog-close:hover { background: var(--primary-bg-light); color: var(--primary-color); } .dialog-content { padding: var(--spacing-lg); } .dialog-content h4 { margin-top: var(--spacing-md); margin-bottom: var(--spacing-xs); color: var(--dark-text); } .dialog-content h4:first-child { margin-top: 0; } .dialog-content p { margin-bottom: var(--spacing-md); } .dialog-content ul, .dialog-content ol { margin: 0 0 var(--spacing-md) 0; padding-left: var(--spacing-lg); } .dialog-content li { margin-bottom: var(--spacing-xs); } .dialog-content kbd { background: var(--code-bg); padding: 2px 6px; border-radius: var(--border-radius-sm); font-size: 0.85em; border: 1px solid var(--border-color); } .help-nav-links { font-size: 0.9rem; color: var(--light-text); padding: var(--spacing-sm) var(--spacing-md); background: var(--bg-color); border-radius: var(--border-radius-sm); margin-top: var(--spacing-sm); } .help-nav-links a { color: var(--primary-color); text-decoration: none; font-weight: 500; } .help-nav-links a:hover { text-decoration: underline; } .dialog-actions { display: flex; justify-content: flex-end; gap: var(--spacing-sm); margin-top: var(--spacing-lg); } /* Share Dialog */ .share-url-container { display: flex; gap: var(--spacing-sm); margin: var(--spacing-md) 0; } .share-url-input { flex: 1; padding: var(--spacing-sm); border: 1px solid var(--border-color); border-radius: var(--border-radius-sm); font-family: var(--font-code); font-size: 0.85rem; background: var(--code-bg); color: var(--text-color); } .share-url-input:focus { outline: none; border-color: var(--primary-color); } .copy-feedback { color: var(--success-color); font-size: 0.9rem; margin-top: var(--spacing-sm); } [dir="rtl"] .share-url-container { flex-direction: row-reverse; } /* Project Cards in Help Dialog */ .project-cards { display: flex; flex-direction: column; gap: var(--spacing-sm); margin-bottom: var(--spacing-md); } .project-card { display: block; padding: var(--spacing-md); background: var(--primary-bg-light); border-radius: var(--border-radius-md); border: 1px solid var(--primary-bg-medium); text-decoration: none; color: var(--text-color); transition: background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s; } .project-card:hover { background: var(--primary-bg-medium); border-color: var(--primary-color); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(94, 75, 139, 0.15); } .project-card strong { display: block; color: var(--primary-color); font-size: 1rem; margin-bottom: 4px; } .project-card span { font-size: 0.9rem; color: var(--light-text); line-height: 1.4; } /* ================= FOOTER ================= */ .app-footer { padding: var(--spacing-md); font-size: 0.7rem; color: var(--light-text); text-align: center; border-top: 1px solid var(--border-color); margin-top: auto; } .app-footer a { color: var(--primary-color); text-decoration: none; } /* ================= MAIN NAV ================= */ .main-nav { display: none; align-items: center; gap: var(--spacing-xs); } .nav-link { padding: 6px 12px; border-radius: var(--border-radius-sm); text-decoration: none; font-size: 0.85rem; font-weight: 500; color: var(--light-text); transition: background 0.2s, color 0.2s; } .nav-link:hover { background: var(--primary-bg-light); color: var(--text-color); } .nav-link.active { background: var(--primary-bg-medium); color: var(--primary-color); } .nav-link-ref { margin-left: 0.5rem; padding-left: 1rem; border-left: 1px solid var(--border-color); } @media (min-width: 769px) { .main-nav { display: flex; } } /* ================= LANDING PAGE ================= */ .landing-page { flex: 1; overflow-y: auto; background: var(--bg-color); } .landing-content { max-width: 900px; margin: 0 auto; padding: var(--spacing-lg); } .hero { text-align: center; padding: 3rem 1rem; } .hero-logo { margin-bottom: 1rem; } .hero h1 { font-size: 2.5rem; font-weight: 800; color: var(--text-color); line-height: 1.2; margin-bottom: 1rem; } .hero-highlight { color: var(--primary-color); } .hero-subtitle { font-size: 1.1rem; color: var(--light-text); max-width: 500px; margin: 0 auto 2rem; } .hero .cta-button { margin-top: 1rem; } /* Why It Works Section */ .why-it-works { padding: 3rem 1rem; text-align: center; } .why-it-works h2 { font-size: 1.75rem; color: var(--primary-dark); margin-bottom: 2rem; } .benefits-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--spacing-lg); text-align: left; } .benefit-card { background: var(--panel-bg); padding: var(--spacing-lg); border-radius: var(--border-radius-lg); box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s; } .benefit-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1); } .benefit-icon { width: 48px; height: 48px; color: var(--primary-color); margin-bottom: var(--spacing-md); } .benefit-card h3 { font-size: 1.1rem; color: var(--primary-dark); margin-bottom: var(--spacing-sm); } .benefit-card p { color: var(--light-text); line-height: 1.6; font-size: 0.95rem; } .benefit-card a { color: var(--primary-color); text-decoration: none; } .benefit-card a:hover { text-decoration: underline; } /* Learning Paths Section */ .learning-paths { padding: 2rem 1rem 3rem; text-align: center; } .learning-paths h2 { font-size: 1.75rem; color: var(--primary-dark); margin-bottom: 0; } /* Section Cards */ .section-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--spacing-lg); margin-top: 2rem; } .section-card { display: flex; flex-direction: column; align-items: center; padding: var(--spacing-lg); background: var(--panel-bg); border-radius: var(--border-radius-lg); box-shadow: var(--shadow); text-decoration: none; color: var(--text-color); transition: transform 0.2s, box-shadow 0.2s; } .section-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1); } .section-card-icon { width: 60px; height: 60px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.2rem; color: white; margin-bottom: var(--spacing-md); } .section-card h2, .section-card h3 { font-size: 1.25rem; margin-bottom: var(--spacing-xs); } .section-card p { font-size: 0.9rem; color: var(--light-text); text-align: center; margin-bottom: var(--spacing-sm); } .section-card-progress { font-size: 0.8rem; color: var(--primary-color); font-weight: 500; } .section-card-disabled { cursor: not-allowed; opacity: 0.7; position: relative; } .section-card-disabled:hover { transform: none; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); } .coming-soon-badge { display: inline-block; background: linear-gradient(135deg, #7c6f8a, #5e5168); color: white; font-size: 0.65rem; font-weight: 600; padding: 3px 8px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.5px; } .section-card-disabled .coming-soon-badge { position: absolute; top: 12px; right: 12px; } .topic-link-disabled { cursor: not-allowed; opacity: 0.6; } .topic-link-disabled .coming-soon-badge { margin-left: 8px; vertical-align: middle; } /* Landing About Section */ .landing-about { padding: 3rem 1rem; text-align: center; } .landing-about h2 { font-size: 1.75rem; color: var(--primary-dark); margin-bottom: 2rem; } .about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2rem; text-align: left; } .about-item { text-align: center; } .about-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; background: var(--primary-color); color: white; font-weight: 700; font-size: 1.1rem; border-radius: 50%; margin-bottom: 1rem; } .about-item h3 { font-size: 1rem; color: var(--primary-dark); margin-bottom: 0.5rem; } .about-item p { color: var(--light-text); line-height: 1.6; } /* Landing Features */ .landing-features { padding: 2rem 1rem; max-width: 800px; margin: 0 auto; } .feature-row { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; } .feature-text h3 { font-size: 1rem; color: var(--primary-dark); margin-bottom: 0.5rem; } .feature-text p { color: var(--light-text); line-height: 1.6; font-size: 0.95rem; } @media (max-width: 600px) { .feature-row { grid-template-columns: 1fr; gap: 1.5rem; } } /* Landing CTA */ .landing-cta { text-align: center; padding: 3rem 1rem; background: var(--panel-bg); border-radius: var(--border-radius-lg); margin-top: var(--spacing-lg); } .landing-cta h2 { font-size: 1.5rem; color: var(--primary-dark); margin-bottom: var(--spacing-sm); } .cta-button { display: inline-block; padding: 1rem 2.5rem; background: var(--primary-color); color: white; text-decoration: none; border-radius: var(--border-radius-md); font-weight: 600; font-size: 1.1rem; transition: background 0.2s, transform 0.2s, box-shadow 0.2s; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); } .cta-button:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); } .cta-sub { color: var(--light-text); font-size: 0.875rem; margin-top: 1rem; } /* ================= LANDING FOOTER ================= */ .landing-footer { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border-color); } .footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; } .footer-section h4 { font-size: 0.875rem; font-weight: 600; color: var(--text-color); margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.05em; } .footer-links { list-style: none; padding: 0; margin: 0; } .footer-links li { margin-bottom: 0.5rem; } .footer-links a { color: var(--light-text); text-decoration: none; font-size: 0.875rem; transition: color 0.2s; } .footer-links a:hover { color: var(--primary-color); } #footer-lesson-links { display: flex; gap: 2rem; } .footer-section-group { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; } .footer-section-group strong { margin-bottom: 0.5rem; } .footer-section-group strong a { color: var(--text-color); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; } .footer-section-group a { display: inline-block; color: #888; text-decoration: none; font-size: 0.7rem; font-weight: 500; background: rgba(0, 0, 0, 0.03); padding: 4px 10px; border-radius: 12px; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .footer-section-group a:hover { color: var(--primary-color); background: rgba(0, 0, 0, 0.06); } .footer-support p { color: var(--light-text); font-size: 0.875rem; margin-bottom: 1rem; } .footer-bottom { text-align: center; padding-top: 1.5rem; border-top: 1px solid var(--border-color); } .footer-bottom p { color: var(--light-text); font-size: 0.8rem; margin: 0; } .footer-bottom a { color: var(--light-text); } .footer-bottom a:hover { color: var(--primary-color); } @media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; } } @media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } } /* ================= SECTION PAGE ================= */ .section-page { flex: 1; overflow-y: auto; background: var(--bg-color); padding: var(--spacing-lg); } .section-hero { text-align: center; padding: 2rem 1rem; max-width: 600px; margin: 0 auto; } .section-hero h1 { font-size: 2rem; color: var(--primary-dark); margin-bottom: var(--spacing-xs); } .section-hero p { color: var(--light-text); margin-bottom: var(--spacing-md); } .section-progress-bar { max-width: 400px; margin: 0 auto; } .section-progress-bar .progress-bar { height: 8px; margin-bottom: var(--spacing-xs); } .section-content { max-width: 1200px; margin: 0 auto; } /* Section Intro - Educational Content (GitBook-style side-by-side) */ .section-intro { padding: 0 var(--spacing-md); } /* Section Overview - intro paragraph */ .section-overview { padding: 1.5rem 0 2rem; border-bottom: 1px solid var(--border-color); margin-bottom: 0.5rem; } .section-overview p { color: var(--text-color); line-height: 1.7; margin-bottom: 1rem; max-width: 85ch; } .section-overview p:last-child { margin-bottom: 0; } .section-overview strong { color: var(--primary-dark); } .section-overview code { background: var(--primary-bg-light); color: var(--primary-dark); padding: 0.1rem 0.35rem; border-radius: 4px; font-family: "JetBrains Mono", "Fira Code", Consolas, monospace; font-size: 0.85em; } /* Topic Row - side by side layout */ .topic-row { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; padding: 2rem 0; border-bottom: 1px solid var(--border-color); align-items: start; } .topic-row:last-child { border-bottom: none; } .topic-text h2 { font-size: 1.25rem; color: var(--primary-dark); margin: 0 0 0.75rem; } .topic-text h3 { font-size: 1rem; color: var(--primary-dark); margin: 0 0 0.5rem; } .topic-text p { color: var(--text-color); line-height: 1.6; margin: 0 0 1rem; } .topic-text p:last-child { margin-bottom: 0; } .topic-link { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 1.25rem; padding: 0.75rem 1.5rem; background: var(--section-color, var(--primary-color)); color: white; text-decoration: none; border-radius: var(--border-radius-md); font-size: 1rem; font-weight: 600; transition: background 0.2s, transform 0.2s, box-shadow 0.2s; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); } .topic-link:hover { background: var(--section-color-dark, var(--primary-dark)); transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); } .topic-link::after { content: "→"; transition: transform 0.2s; } .topic-link:hover::after { transform: translateX(3px); } /* Secondary reference link in topic sections */ .topic-ref { display: block; margin-top: 0.75rem; color: var(--light-text); font-size: 0.9rem; text-decoration: none; } .topic-ref:hover { color: var(--section-color, var(--primary-color)); text-decoration: underline; } /* See-also in section overviews */ .section-see-also { margin-top: var(--spacing-md); font-size: 0.9rem; color: var(--light-text); } .section-see-also a { color: var(--section-color, var(--primary-color)); text-decoration: none; } .section-see-also a:hover { text-decoration: underline; } /* Inline code in topic text */ .topic-text code { background: var(--primary-bg-light); color: var(--primary-dark); padding: 0.15rem 0.4rem; border-radius: 4px; font-family: "JetBrains Mono", "Fira Code", Consolas, monospace; font-size: 0.9em; } /* Code Examples */ .topic-code { position: sticky; top: 1rem; } .code-block { background: #0d1117; border-radius: var(--border-radius-md); border: 1px solid #30363d; overflow: hidden; } /* Fallback styles for pre/code (before CodeMirror initializes) */ .code-block pre { margin: 0; padding: 1rem; overflow-x: auto; } .code-block code { font-family: "JetBrains Mono", "Fira Code", Consolas, monospace; font-size: 0.8rem; line-height: 1.6; color: #e6edf3; white-space: pre; } /* CodeMirror styles within code blocks */ .code-block .cm-editor { background: transparent; } .code-block .cm-scroller { overflow-x: auto; } .code-caption { font-size: 0.75rem; color: var(--light-text); margin-top: 0.5rem; } /* Responsive: stack on mobile */ @media (max-width: 900px) { .topic-row { grid-template-columns: 1fr; gap: 1rem; } .topic-code { position: static; } } /* Module Grid */ .module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--spacing-md); max-width: 1000px; margin: 0 auto; } .module-card { display: block; padding: var(--spacing-md); background: var(--panel-bg); border-radius: var(--border-radius-md); box-shadow: var(--shadow); text-decoration: none; color: var(--text-color); border-left: 4px solid var(--primary-color); transition: transform 0.2s, box-shadow 0.2s; } .module-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); } .module-card h3 { font-size: 1rem; color: var(--primary-dark); margin-bottom: var(--spacing-xs); } .module-card-meta { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--light-text); } .module-card-progress { color: var(--success-color); font-weight: 500; } /* ================= REFERENCE PAGES ================= */ .reference-page { flex: 1; overflow-y: auto; background: var(--bg-color); } .reference-content { max-width: 900px; margin: 0 auto; padding: var(--spacing-lg); } .reference-nav { display: flex; flex-wrap: wrap; gap: var(--spacing-sm); padding: var(--spacing-md); background: var(--panel-bg); border-radius: var(--border-radius-md); margin-bottom: var(--spacing-lg); position: sticky; top: 0; z-index: 10; box-shadow: var(--shadow); } .ref-nav-link { padding: var(--spacing-xs) var(--spacing-sm); border-radius: var(--border-radius-sm); text-decoration: none; color: var(--text-color); font-size: 0.9rem; font-weight: 500; transition: background 0.2s, color 0.2s; } .ref-nav-link:hover { background: var(--hover-bg); } .ref-nav-link.active { background: var(--primary-color); color: white; } .reference-body h1 { font-size: 1.75rem; margin-bottom: var(--spacing-sm); color: var(--primary-dark); } .ref-intro { font-size: 1rem; color: var(--light-text); margin-bottom: var(--spacing-lg); line-height: 1.6; } .ref-section { margin-top: var(--spacing-xl); margin-bottom: var(--spacing-xl); } .ref-section:first-of-type { margin-top: 0; } .ref-section h2 { font-size: 1.2rem; margin-bottom: var(--spacing-md); color: var(--text-color); border-bottom: 2px solid var(--border-color); padding-bottom: var(--spacing-xs); } .ref-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; background: var(--panel-bg); border-radius: var(--border-radius-md); overflow: hidden; box-shadow: var(--shadow); } .ref-table thead { background: var(--hover-bg); } .ref-table th, .ref-table td { padding: var(--spacing-sm) var(--spacing-md); text-align: left; border-bottom: 1px solid var(--border-color); } .ref-table th { font-weight: 600; color: var(--text-color); } .ref-table tr:last-child td { border-bottom: none; } .ref-table tr:hover { background: var(--hover-bg); } .ref-table code { background: var(--code-bg); padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.85em; color: var(--primary-dark); } /* Collapsible table rows */ .ref-table-more { margin-top: -1px; } .ref-table-more summary { padding: var(--spacing-sm) var(--spacing-md); background: var(--hover-bg); cursor: pointer; font-size: 0.85rem; color: var(--light-text); border-radius: 0 0 var(--border-radius-md) var(--border-radius-md); list-style: none; text-align: center; } .ref-table-more summary::-webkit-details-marker { display: none; } .ref-table-more summary:hover { background: var(--border-color); color: var(--text-color); } .ref-table-more[open] summary { border-radius: 0; } .ref-table-continuation { border-radius: 0 0 var(--border-radius-md) var(--border-radius-md); margin-top: 0; } .ref-list { background: var(--panel-bg); border-radius: var(--border-radius-md); padding: var(--spacing-md) var(--spacing-md) var(--spacing-md) var(--spacing-xl); box-shadow: var(--shadow); } .ref-list li { padding: var(--spacing-xs) 0; line-height: 1.6; } .ref-list code { background: var(--code-bg); padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.85em; } /* Reference page code blocks */ .reference-body .code-block { margin: var(--spacing-md) 0; } /* Cross-reference links in reference pages */ .ref-see-also { margin-top: var(--spacing-lg); padding-top: var(--spacing-md); border-top: 1px solid var(--border-color); font-size: 0.9rem; color: var(--light-text); } .ref-see-also a { color: var(--primary-color); text-decoration: none; font-weight: 500; } .ref-see-also a:hover { text-decoration: underline; } /* Responsive reference tables */ @media (max-width: 600px) { .ref-table { font-size: 0.8rem; } .ref-table th, .ref-table td { padding: var(--spacing-xs) var(--spacing-sm); } .reference-nav { position: static; } .ref-nav-link { font-size: 0.8rem; } } /* ================= UTILITY ================= */ .hidden { display: none !important; } /* ================= RESPONSIVE ================= */ @media (max-width: 768px) { .game-layout { flex-direction: column; overflow-y: auto; } .left-panel, .right-panel { width: 100%; flex-shrink: 0; border-right: none; display: contents; } /* Mobile order: nav -> instructions -> preview -> editor */ .game-controls { order: 1; padding: var(--spacing-sm); } .instructions { order: 2; max-height: none; overflow-y: visible; } .preview-section { order: 3; display: flex; flex-direction: column; min-height: 50vh; } .preview-section .preview-header { order: 1; } .preview-section .preview-wrapper { order: 2; } .editor-section { order: 4; display: flex; flex-direction: column; min-height: 50vh; } .preview-wrapper { flex: 1; margin: var(--spacing-sm); min-height: 40vh; } .editor-content { flex: 1; min-height: 45vh; } .module-pill { flex: 1; margin: 0 var(--spacing-sm); justify-content: center; } .module-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .level-label { display: none; } .btn { padding: var(--spacing-xs) var(--spacing-sm); font-size: 0.85rem; } } @media (max-width: 480px) { .logo h1 { font-size: 0.9rem; } .logo img { width: 32px; } #lesson-title { font-size: 1.1rem; } .lesson-description { font-size: 0.9rem; } .task-instruction { font-size: 0.85rem; } .code-input { font-size: 13px; } } /* ================== RTL SUPPORT ================== */ /* RTL: Sidebar slides from right */ [dir="rtl"] .sidebar-drawer { left: auto; right: calc(-1 * var(--sidebar-width)); transition: right 0.3s ease; } [dir="rtl"] .sidebar-drawer.open { right: 0; } /* RTL: Content shifts to left when sidebar opens */ [dir="rtl"] .app-container:has(.sidebar-drawer.open) .game-layout { transform: translateX(calc(-1 * var(--sidebar-width) * 0.8)); } /* RTL: Editor tools */ [dir="rtl"] .editor-tools { flex-direction: row-reverse; } /* RTL: Navigation buttons */ [dir="rtl"] .nav-controls { flex-direction: row-reverse; } /* RTL: Hint layout */ [dir="rtl"] .hint { flex-direction: row-reverse; text-align: right; border-left: none; border-right: 3px solid var(--primary-light); } [dir="rtl"] .hint-success { border-right-color: var(--success-color); } /* RTL: Module list items */ [dir="rtl"] .module-header { flex-direction: row-reverse; } [dir="rtl"] .lesson-list button { text-align: right; } /* RTL: Lesson progress indicator */ [dir="rtl"] .lesson-list button::before { margin-left: var(--spacing-sm); margin-right: 0; } /* RTL: Content areas - use auto direction for mixed content */ [dir="rtl"] .lesson-description, [dir="rtl"] .task-instruction { direction: auto; unicode-bidi: plaintext; } /* RTL: Code editor always LTR */ [dir="rtl"] .editor-content, [dir="rtl"] .CodeMirror { direction: ltr; text-align: left; } /* RTL: Preview always LTR (code output) */ [dir="rtl"] .preview-wrapper, [dir="rtl"] #preview-area { direction: ltr; } /* RTL: Dialog close button */ [dir="rtl"] .dialog-close { left: var(--spacing-sm); right: auto; } /* RTL: Keep logo in LTR order */ [dir="rtl"] .logo { direction: ltr; } /* RTL: Swap left/right panels */ [dir="rtl"] .game-layout { flex-direction: row-reverse; } /* RTL: Left panel border flips to left side */ [dir="rtl"] .left-panel { border-right: none; border-left: 1px solid var(--border-color); } /* RTL: Lessons container indentation flips */ [dir="rtl"] .lessons-container { margin-left: 0; margin-right: 16px; border-left: none; border-right: 2px solid var(--border-color); padding-left: 0; padding-right: 8px; } /* RTL: Module header - chevron on right, text right-aligned */ [dir="rtl"] summary.module-header { justify-content: flex-end; text-align: right; } [dir="rtl"] summary.module-header::before { order: 1; margin-left: 8px; margin-right: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M7 1 L3 5 L7 9' stroke='%23666' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); } [dir="rtl"] details.module-container[open] > summary.module-header::before { transform: rotate(-90deg); } /* RTL: Lesson items - text right-aligned */ [dir="rtl"] .lesson-list-item { text-align: right; } /* RTL: Lesson checkmark on right */ [dir="rtl"] .lesson-list-item.completed::before { float: right; margin-left: 6px; margin-right: 0; } /* RTL: Module completed checkmark position (::after) */ [dir="rtl"] .module-header.completed::after { margin-left: 0; margin-right: 8px; } /* RTL: Lesson checkmark position */ [dir="rtl"] .lesson-list-item.completed::before { margin-left: 6px; margin-right: 0; } /* RTL: Header level pill */ [dir="rtl"] .header-level-pill { margin-left: 0; margin-right: var(--spacing-sm); } [dir="rtl"] .header-level { margin-left: 0; margin-right: 0.5em; } /* RTL: Toggle switch slider */ [dir="rtl"] .toggle-slider { margin-right: 0; margin-left: 8px; } [dir="rtl"] .preview-controls { flex-direction: row-reverse; } /* RTL: Lesson title row */ [dir="rtl"] .lesson-title-row { flex-direction: row-reverse; } /* RTL: Lists - bullets/numbers on right side */ [dir="rtl"] .lesson-description ul, [dir="rtl"] .lesson-description ol { padding-left: 0; padding-right: 1.5em; } [dir="rtl"] .lesson-description li { text-align: right; } /* RTL: Pre/code blocks stay LTR */ [dir="rtl"] pre, [dir="rtl"] code, [dir="rtl"] kbd { direction: ltr; text-align: left; } /* ================= SECTION COLOR CODING ================= */ /* CSS Section - Violet */ [data-section="css"] { --section-color: #7c4dff; --section-color-light: #a47fff; --section-color-dark: #5c35cc; --section-color-rgb: 124, 77, 255; } /* HTML Section - Raspberry */ [data-section="html"] { --section-color: #e91e63; --section-color-light: #f06292; --section-color-dark: #c2185b; --section-color-rgb: 233, 30, 99; } /* Tailwind Section - Cyan */ [data-section="tailwind"] { --section-color: #00bcd4; --section-color-light: #4dd0e1; --section-color-dark: #0097a7; --section-color-rgb: 0, 188, 212; } /* Apply section colors to nav links */ .nav-link[data-section="css"] { color: #7c4dff; } .nav-link[data-section="html"] { color: #e91e63; } .nav-link[data-section="tailwind"] { color: #00bcd4; } .nav-link[data-section="css"]:hover, .nav-link[data-section="css"].active { background: rgba(124, 77, 255, 0.1); color: #5c35cc; } .nav-link[data-section="html"]:hover, .nav-link[data-section="html"].active { background: rgba(233, 30, 99, 0.1); color: #c2185b; } .nav-link[data-section="tailwind"]:hover, .nav-link[data-section="tailwind"].active { background: rgba(0, 188, 212, 0.1); color: #0097a7; } /* Logo color coding based on section */ [data-section="css"] .code-text { color: #7c4dff; } [data-section="html"] .code-text { color: #e91e63; } [data-section="tailwind"] .code-text { color: #00bcd4; } /* Reference nav link colors */ .ref-nav-link[data-ref="css"], .ref-nav-link[data-ref="selectors"], .ref-nav-link[data-ref="flexbox"], .ref-nav-link[data-ref="grid"] { color: #7c4dff; } .ref-nav-link[data-ref="css"]:hover, .ref-nav-link[data-ref="css"].active, .ref-nav-link[data-ref="selectors"]:hover, .ref-nav-link[data-ref="selectors"].active, .ref-nav-link[data-ref="flexbox"]:hover, .ref-nav-link[data-ref="flexbox"].active, .ref-nav-link[data-ref="grid"]:hover, .ref-nav-link[data-ref="grid"].active { background: rgba(124, 77, 255, 0.15); color: #5c35cc; } .ref-nav-link[data-ref="html"] { color: #e91e63; } .ref-nav-link[data-ref="html"]:hover, .ref-nav-link[data-ref="html"].active { background: rgba(233, 30, 99, 0.15); color: #c2185b; } /* CodeMirror section color overrides */ body[data-section="css"] .cm-editor .cm-content { caret-color: #7c4dff !important; } body[data-section="css"] .cm-editor .cm-cursor, body[data-section="css"] .cm-editor .cm-dropCursor { border-left-color: #7c4dff !important; } body[data-section="css"] .cm-editor .cm-selectionBackground, body[data-section="css"] .cm-editor .cm-content ::selection { background-color: rgba(124, 77, 255, 0.25) !important; } body[data-section="css"] .cm-editor .cm-activeLine { background-color: rgba(124, 77, 255, 0.08) !important; } body[data-section="html"] .cm-editor .cm-content { caret-color: #e91e63 !important; } body[data-section="html"] .cm-editor .cm-cursor, body[data-section="html"] .cm-editor .cm-dropCursor { border-left-color: #e91e63 !important; } body[data-section="html"] .cm-editor .cm-selectionBackground, body[data-section="html"] .cm-editor .cm-content ::selection { background-color: rgba(233, 30, 99, 0.25) !important; } body[data-section="html"] .cm-editor .cm-activeLine { background-color: rgba(233, 30, 99, 0.08) !important; } body[data-section="tailwind"] .cm-editor .cm-content { caret-color: #00bcd4 !important; } body[data-section="tailwind"] .cm-editor .cm-cursor, body[data-section="tailwind"] .cm-editor .cm-dropCursor { border-left-color: #00bcd4 !important; } body[data-section="tailwind"] .cm-editor .cm-selectionBackground, body[data-section="tailwind"] .cm-editor .cm-content ::selection { background-color: rgba(0, 188, 212, 0.25) !important; } body[data-section="tailwind"] .cm-editor .cm-activeLine { background-color: rgba(0, 188, 212, 0.08) !important; } /* Code block border section colors */ body[data-section="css"] .code-block { border-color: rgba(124, 77, 255, 0.4); } body[data-section="html"] .code-block { border-color: rgba(233, 30, 99, 0.4); } body[data-section="tailwind"] .code-block { border-color: rgba(0, 188, 212, 0.4); } /* Section code block CodeMirror syntax highlighting overrides */ body[data-section="css"] .code-block .cm-editor .cm-line { color: #c9b8ff; } body[data-section="html"] .code-block .cm-editor .cm-line { color: #ffb8c9; } body[data-section="tailwind"] .code-block .cm-editor .cm-line { color: #b8f0ff; } /* Task instruction bubble section colors */ [data-section="css"] .task-instruction { background: rgba(124, 77, 255, 0.9); } [data-section="html"] .task-instruction { background: rgba(233, 30, 99, 0.9); } [data-section="tailwind"] .task-instruction { background: rgba(0, 188, 212, 0.9); } /* Section page header colors */ [data-section="css"] .section-hero h1 { color: #7c4dff; } [data-section="html"] .section-hero h1 { color: #e91e63; } [data-section="tailwind"] .section-hero h1 { color: #00bcd4; } /* Reference footer */ .reference-footer { text-align: center; padding: 2rem 1rem; margin-top: 3rem; border-top: 1px solid var(--border-color); color: var(--light-text); font-size: 0.9rem; } .reference-footer a { color: var(--section-color, var(--primary-color)); }