Spaces:
Running
Running
| /* ============================ | |
| Global & Base | |
| ============================ */ | |
| html, body, #root { | |
| margin: 0; | |
| padding: 0; | |
| overflow-x: hidden; /* prevent page-level horizontal scroll */ | |
| box-sizing: border-box; | |
| } | |
| *, | |
| *::before, | |
| *::after { | |
| box-sizing: inherit; | |
| } | |
| .App { | |
| text-align: center; | |
| } | |
| /* Root layout */ | |
| .ide-root { | |
| height: 100vh; | |
| width: 100vw; | |
| display: flex; | |
| flex-direction: column; | |
| font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; | |
| overflow: hidden; | |
| max-width: 100%; | |
| } | |
| /* Themes */ | |
| .ide-dark { | |
| background: #1e1e1e; | |
| color: #ddd; | |
| } | |
| .ide-light { | |
| background: #f5f5f5; | |
| color: #222; | |
| } | |
| /* ============================ | |
| Menubar | |
| ============================ */ | |
| .ide-menubar { | |
| height: 32px; | |
| display: flex; | |
| align-items: center; | |
| justify-content: space-between; | |
| padding: 0 10px; | |
| background: #252526; | |
| color: #eee; | |
| font-size: 13px; | |
| border-bottom: 1px solid #444; | |
| flex: 0 0 auto; | |
| } | |
| .ide-menubar-left, | |
| .ide-menubar-right { | |
| display: flex; | |
| align-items: center; | |
| gap: 8px; | |
| } | |
| .ide-logo { | |
| font-weight: 600; | |
| margin-right: 12px; | |
| } | |
| .ide-menubar button { | |
| margin-right: 4px; | |
| background: transparent; | |
| border: none; | |
| color: inherit; | |
| cursor: pointer; | |
| padding: 2px 6px; | |
| border-radius: 3px; | |
| font-size: 13px; | |
| } | |
| .ide-menubar button:hover { | |
| background: rgba(255, 255, 255, 0.08); | |
| } | |
| /* ============================ | |
| Body Layout | |
| ============================ */ | |
| .ide-body { | |
| flex: 1; | |
| display: flex; | |
| overflow: hidden; /* prevent children from creating page overflow */ | |
| min-height: 0; /* allow children to shrink (important for flex) */ | |
| max-width: 100%; | |
| } | |
| /* ============================ | |
| Sidebar (Explorer) | |
| ============================ */ | |
| .ide-sidebar { | |
| flex: 0 0 210px; /* fixed sidebar width */ | |
| min-width: 0; /* critical for preventing overflow from child */ | |
| width: 210px; | |
| background: #252526; | |
| color: #ccc; | |
| padding: 5px; | |
| border-right: 1px solid #444; | |
| overflow-y: auto; | |
| font-size: 14px; | |
| } | |
| .tree-item { | |
| padding: 4px 6px; | |
| cursor: pointer; | |
| user-select: none; | |
| border-radius: 3px; | |
| white-space: nowrap; | |
| overflow: hidden; | |
| text-overflow: ellipsis; | |
| } | |
| .tree-item:hover { | |
| background: #3a3d41; | |
| } | |
| /* ============================ | |
| Main (Editor + Output) | |
| ============================ */ | |
| .ide-main { | |
| flex: 1 1 auto; | |
| display: flex; | |
| flex-direction: column; | |
| position: relative; | |
| min-width: 0; /* CRITICAL: allow editor to shrink inside flex */ | |
| overflow: hidden; | |
| } | |
| /* Monaco wrapper */ | |
| .ide-editor-wrapper { | |
| flex: 1 1 auto; | |
| min-height: 0; | |
| min-width: 0; /* important for monaco inside flex */ | |
| overflow: hidden; | |
| } | |
| /* Bottom panels (output, stdin, problems) */ | |
| .ide-panels { | |
| background: #1e1e1e; | |
| border-top: 1px solid #444; | |
| padding: 6px; | |
| font-size: 13px; | |
| height: 28%; | |
| overflow: auto; | |
| min-height: 120px; | |
| box-sizing: border-box; | |
| max-width: 100%; | |
| } | |
| .ide-output { | |
| background: #000; | |
| color: #0f0; | |
| padding: 6px; | |
| min-height: 60px; | |
| max-height: 120px; | |
| overflow-y: auto; | |
| border-radius: 4px; | |
| font-family: "Consolas", monospace; | |
| font-size: 12px; | |
| white-space: pre-wrap; | |
| word-break: break-word; | |
| max-width: 100%; | |
| } | |
| .ide-input-box { | |
| width: 100%; | |
| margin-top: 4px; | |
| padding: 6px; | |
| background: #111; | |
| border: 1px solid #444; | |
| color: #eee; | |
| border-radius: 3px; | |
| font-size: 12px; | |
| box-sizing: border-box; | |
| } | |
| /* Problems panel */ | |
| .ide-problems-panel { | |
| margin-top: 6px; | |
| padding: 8px; | |
| background: #3c0000; | |
| color: #fff; | |
| border-left: 3px solid red; | |
| font-size: 12px; | |
| border-radius: 3px; | |
| overflow: auto; | |
| white-space: pre-wrap; | |
| word-break: break-word; | |
| } | |
| /* ============================ | |
| Terminal / XTerm container | |
| ============================ */ | |
| /* Ensure terminal fits container and doesn't push layout */ | |
| #terminal-container { | |
| width: 100% ; | |
| max-width: 100% ; | |
| box-sizing: border-box; | |
| overflow-x: auto; /* keep horizontal scroll inside terminal only */ | |
| height: 180px; | |
| background: #1e1e1e; | |
| border-top: 1px solid #333; | |
| border-radius: 4px; | |
| } | |
| /* Terminal content wrapper (if you have a wrapper class) */ | |
| .terminal-content { | |
| width: 100%; | |
| max-width: 100%; | |
| overflow-x: auto; | |
| white-space: pre-wrap; | |
| word-break: break-word; | |
| font-family: "Consolas", monospace; | |
| } | |
| /* ============================ | |
| Right AI Panel | |
| ============================ */ | |
| .ide-right-panel { | |
| flex: 0 0 280px; | |
| min-width: 0; | |
| width: 280px; | |
| border-left: 1px solid #444; | |
| background: #252526; | |
| padding: 8px; | |
| display: flex; | |
| flex-direction: column; | |
| gap: 8px; | |
| font-size: 13px; | |
| overflow: auto; | |
| } | |
| .ide-ai-header { | |
| font-weight: 600; | |
| margin-bottom: 4px; | |
| } | |
| .ide-ai-section { | |
| display: flex; | |
| flex-direction: column; | |
| gap: 4px; | |
| } | |
| .ide-ai-label { | |
| font-size: 12px; | |
| text-transform: uppercase; | |
| letter-spacing: 0.06em; | |
| opacity: 0.8; | |
| } | |
| /* AI instruction textarea */ | |
| .ide-agent-textarea { | |
| width: 100%; | |
| min-height: 80px; | |
| max-height: 160px; | |
| resize: vertical; | |
| padding: 6px; | |
| border-radius: 4px; | |
| border: 1px solid #444; | |
| background: #1e1e1e; | |
| color: #eee; | |
| font-family: Consolas, monospace; | |
| font-size: 12px; | |
| box-sizing: border-box; | |
| } | |
| /* AI buttons */ | |
| .ide-ai-buttons { | |
| display: flex; | |
| gap: 6px; | |
| } | |
| .ide-ai-buttons button { | |
| flex: 1; | |
| padding: 6px; | |
| font-size: 12px; | |
| border-radius: 4px; | |
| border: 1px solid #555; | |
| background: #0e639c; | |
| color: #fff; | |
| cursor: pointer; | |
| } | |
| .ide-ai-buttons button:hover { | |
| background: #1177bb; | |
| } | |
| /* AI explanation box */ | |
| .ide-explain { | |
| max-height: 180px; | |
| overflow-y: auto; | |
| padding: 6px; | |
| border-radius: 4px; | |
| background: #1e1e1e; | |
| border: 1px solid #444; | |
| font-size: 12px; | |
| color: #eee; | |
| font-family: Consolas, monospace; | |
| } | |
| /* ============================ | |
| AI Suggestions Popup | |
| ============================ */ | |
| .ai-popup { | |
| position: absolute; | |
| bottom: 35%; | |
| right: 5px; | |
| width: 230px; | |
| background: #333; | |
| border: 1px solid #444; | |
| border-radius: 6px; | |
| padding: 4px; | |
| animation: fadeIn 0.25s ease-in-out; | |
| font-size: 12px; | |
| z-index: 200; /* ensure it sits above other UI */ | |
| max-width: calc(100vw - 24px); | |
| box-sizing: border-box; | |
| } | |
| .ai-suggest { | |
| padding: 4px; | |
| cursor: pointer; | |
| } | |
| .ai-suggest:hover { | |
| background: #444; | |
| } | |
| /* ============================ | |
| Search Dialog | |
| ============================ */ | |
| .search-dialog { | |
| position: absolute; | |
| right: 10px; | |
| top: 50px; | |
| background: #333; | |
| padding: 10px; | |
| border: 1px solid #444; | |
| border-radius: 5px; | |
| z-index: 300; | |
| max-width: calc(100vw - 24px); | |
| box-sizing: border-box; | |
| } | |
| .search-dialog input { | |
| width: 200px; | |
| padding: 4px 6px; | |
| border-radius: 3px; | |
| border: 1px solid #555; | |
| background: #1e1e1e; | |
| color: #eee; | |
| } | |
| /* ============================ | |
| Context Menu | |
| ============================ */ | |
| .ide-context-menu { | |
| position: absolute; | |
| background: #333; | |
| color: #eee; | |
| border: 1px solid #555; | |
| border-radius: 5px; | |
| padding: 4px; | |
| z-index: 400; | |
| max-width: calc(100vw - 24px); | |
| box-sizing: border-box; | |
| } | |
| .ide-context-menu div { | |
| padding: 4px 8px; | |
| cursor: pointer; | |
| font-size: 13px; | |
| } | |
| .ide-context-menu div:hover { | |
| background: #555; | |
| } | |
| /* ============================ | |
| Progress / Spinner | |
| ============================ */ | |
| .ide-progress-wrap { | |
| height: 3px; | |
| background: transparent; | |
| width: 100%; | |
| position: relative; | |
| overflow: hidden; | |
| } | |
| .ide-progress { | |
| position: absolute; | |
| height: 3px; | |
| width: 30%; | |
| left: -30%; | |
| top: 0; | |
| background: linear-gradient(90deg, #0e9, #08f); | |
| animation: progress-slide 1.2s linear infinite; | |
| border-radius: 2px; | |
| } | |
| @keyframes progress-slide { | |
| 0% { left: -30%; width: 30%; } | |
| 50% { left: 35%; width: 40%; } | |
| 100% { left: 100%; width: 30%; } | |
| } | |
| /* ---------- small inline spinner (optional) ---------- */ | |
| .button-spinner { | |
| display: inline-block; | |
| width: 12px; | |
| height: 12px; | |
| border: 2px solid rgba(255,255,255,0.25); | |
| border-top-color: rgba(255,255,255,0.95); | |
| border-radius: 50%; | |
| animation: spin 0.8s linear infinite; | |
| margin-left: 6px; | |
| vertical-align: middle; | |
| } | |
| @keyframes spin { | |
| to { transform: rotate(360deg); } | |
| } | |
| /* ============================ | |
| Misc: Text wrapping & safety | |
| ============================ */ | |
| .ide-output, .ide-explain, .ide-problems-panel, .tree-item, .ai-popup, .ai-suggest { | |
| overflow-wrap: break-word; | |
| word-break: break-word; | |
| white-space: pre-wrap; | |
| } | |
| /* Buttons, inputs, selects must not exceed container */ | |
| button, input, textarea, select { | |
| max-width: 100%; | |
| box-sizing: border-box; | |
| } | |
| /* Final safety: hide any stray horizontal overflow */ | |
| #root, .ide-root, .ide-body, .ide-main { overflow-x: hidden; } | |
| /* ============================ | |
| 📱 Mobile / Tablet Responsive | |
| ============================ */ | |
| @media (max-width: 900px) { | |
| /* Stack layout vertically on small screens */ | |
| .ide-body { flex-direction: column; } | |
| /* Sidebar becomes top strip */ | |
| .ide-sidebar { | |
| width: 100%; | |
| flex: 0 0 auto; | |
| max-height: 22vh; | |
| border-right: none; | |
| border-bottom: 1px solid #444; | |
| } | |
| .ide-main { order: 2; min-height: 40vh; } | |
| .ide-editor-wrapper { height: 40vh; } | |
| /* Bottom panels adapt */ | |
| .ide-panels { height: auto; max-height: 26vh; } | |
| /* Right panel becomes bottom full width */ | |
| .ide-right-panel { | |
| width: 100%; | |
| order: 3; | |
| border-left: none; | |
| border-top: 1px solid #444; | |
| } | |
| .ai-popup { right: 8px; left: 8px; width: auto; max-width: calc(100vw - 16px); } | |
| .search-dialog { right: 8px; left: 8px; width: auto; } | |
| .ide-context-menu { max-width: 70vw; } | |
| } | |
| /* Small-screen tweak for very small devices */ | |
| @media (max-width: 420px) { | |
| .ide-menubar { font-size: 12px; padding: 0 6px; } | |
| .ide-ai-buttons button, .ide-menubar button { padding: 4px; font-size: 12px; } | |
| } | |