﻿/* ============================================================
   legacy-coder.css — Runtime support styles for Skulpt/CodeMirror
   Only keeps styles needed by the Python runtime (canvas, turtle,
   pygame, output sinks). All layout/tab/editor styling is handled
   by the React app's code-studio.css.
   ============================================================ */

/* Hidden textarea used by CodeMirror.fromTextArea */
.pythonCode {
    display: none;
}

/* Runtime output sinks — kept hidden, the React app renders output */
.csuk-ide-hidden-output {
    display: none;
}

/* Turtle graphics window */
.csuk-turtle-window {
    position: fixed;
    top: 100px;
    left: 100px;
    width: 620px;
    height: 520px;
    background: #fff;
    border: 1px solid #aaa;
    z-index: 9999;
}

/* Pygame window */
.csuk-pg-window {
    position: fixed;
    top: 80px;
    left: 120px;
    z-index: 9999;
    background: #000;
}

/* Matplotlib window */
.csuk-mpl-window {
    position: fixed;
    top: 80px;
    left: 120px;
    z-index: 9999;
    background: #fff;
    border: 1px solid #ccc;
}

/* Runtime canvas containers */
#mycanvas {
    position: relative !important;
    overflow: hidden !important;
    width: 100%;
    height: 100%;
    min-height: 300px;
}

#mycanvas > canvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

#myturtlecanvas {
    flex: 0 0 auto;
    width: 100%;
    overflow: hidden;
    position: relative;
}

#turtleoutput, #pygameoutput {
    flex: 1 1 auto;
    overflow-y: auto;
    margin: 0;
    padding: 10px;
    background: #000;
    color: #fff;
    font-family: monospace;
    white-space: pre-wrap;
}

/* HTML output iframe */
iframe.htmloutput {
    margin: 0;
    height: 100%;
    width: 100%;
    background-color: white;
}

/* Modal overlays (used by legacy reference drawer) */
.csuk-ref-canvas {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.csuk-ref-canvas.active {
    opacity: 1;
    pointer-events: auto;
}

.csuk-ref-canvas-content {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 80%;
    max-width: 1200px;
    background: #fff;
    transform: translateX(100%);
    transition: transform 0.35s ease;
    box-shadow: -5px 0 20px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}

.csuk-ref-canvas.active .csuk-ref-canvas-content {
    transform: translateX(0);
}

.csuk-ref-close {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: #d9534f;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.1s ease;
}

.csuk-ref-close:hover {
    background: #c9302c;
    transform: scale(1.05);
}

.csuk-ref-close:active {
    transform: scale(0.95);
}
