@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    background: #000000;
    color: #00ff00;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 2px solid #00ff00;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.title {
    font-size: 1.4em;
    letter-spacing: 2px;
    font-weight: bold;
}

.status-badge {
    border: 2px solid #00ff00;
    padding: 4px 12px;
    font-size: 0.8em;
    letter-spacing: 1px;
}

.header-right {
    display: flex;
    gap: 15px;
}

/* Main Layout */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 240px;
    border-right: 2px solid #00ff00;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.section-title {
    font-size: 0.9em;
    letter-spacing: 1px;
    margin-bottom: 10px;
    color: #00ff00;
}

.subsection {
    font-size: 0.75em;
    color: #00aa00;
    margin-bottom: 8px;
}

/* Controls */
.control-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.difficulty-control {
    background: #00ff00;
    color: #000000;
    padding: 10px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    font-family: inherit;
    font-size: 0.85em;
    letter-spacing: 1px;
    position: relative;
}

.difficulty-control::before {
    content: '≡';
    margin-right: 8px;
}

.difficulty-dropdown {
    display: none;
    background: #000000;
    border: 2px solid #00ff00;
    position: absolute;
    width: 100%;
    left: 0;
    top: 100%;
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
}

.difficulty-dropdown.active {
    display: block;
}

.difficulty-option {
    padding: 8px 10px;
    cursor: pointer;
    border-bottom: 1px solid #00ff00;
}

.difficulty-option:hover {
    background: #00ff00;
    color: #000000;
}

.checkbox-control {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px 0;
}

.checkbox-control input[type="checkbox"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #00ff00;
    background: #000000;
    cursor: pointer;
    position: relative;
}

.checkbox-control input[type="checkbox"]:checked::after {
    content: 'X';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #00ff00;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-control::before {
    content: '✕';
    font-size: 0.9em;
}

/* Slider */
.slider-container {
    margin-top: 10px;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.7em;
    margin-bottom: 8px;
}

input[type="range"] {
    width: 100%;
    height: 4px;
    background: #003300;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #00ff00;
    cursor: pointer;
    border: none;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #00ff00;
    cursor: pointer;
    border: none;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 10px;
}

.btn-terminal {
    flex: 1;
    padding: 8px;
    font-family: inherit;
    font-size: 0.75em;
    letter-spacing: 1px;
    cursor: pointer;
    border: 2px solid #00ff00;
    background: #000000;
    color: #00ff00;
    transition: all 0.2s;
}

.btn-terminal:hover {
    background: #00ff00;
    color: #000000;
}

.btn-terminal.active {
    background: #00ff00;
    color: #000000;
}

/* Terminal Log */
.terminal-log {
    border: 2px solid #00ff00;
    padding: 10px;
    font-size: 0.7em;
    min-height: 80px;
    background: #000000;
    overflow-y: auto;
}

.log-line {
    margin: 2px 0;
    color: #00ff00;
}

.log-line::before {
    content: '> ';
}

/* Maze Canvas Area */
.canvas-area {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
    position: relative;
}

.maze-wrapper {
    position: relative;
    display: inline-block;
}

.ball-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.9);
    padding: 15px;
    border: 2px solid #00ff00;
    align-self: flex-end;
    margin-bottom: 10px;
}

.ball-label {
    font-size: 0.7em;
    color: #00ff00;
    letter-spacing: 1px;
    text-align: center;
    display: flex;
}

.ball-circle {
    width: 8mm;
    height: 8mm;
    border-radius: 50%;
    background: #00ff00;
    border: 1px solid #00ff00;
}

.maze-info {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.7em;
    text-align: right;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px;
    border: 1px solid #00ff00;
}

.info-line {
    margin: 2px 0;
}

#mazeCanvas {
    max-width: 100%;
    height: auto;
    background: #000000;
    transition: filter 0.3s ease;
}

/* Raster mode effect */
#mazeCanvas.raster-mode {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    filter: contrast(1.2) brightness(0.95);
}

/* Buttons */
.btn-primary {
    padding: 10px 20px;
    font-family: inherit;
    font-size: 0.85em;
    letter-spacing: 1px;
    cursor: pointer;
    border: 2px solid #00ff00;
    background: #00ff00;
    color: #000000;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #000000;
    color: #00ff00;
    box-shadow: 0 0 10px #00ff00;
}

.btn-secondary {
    padding: 10px 20px;
    font-family: inherit;
    font-size: 0.85em;
    letter-spacing: 1px;
    cursor: pointer;
    border: 2px solid #00ff00;
    background: #000000;
    color: #00ff00;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #00ff00;
    color: #000000;
}

.btn-secondary:disabled {
    border-color: #003300;
    color: #003300;
    cursor: not-allowed;
}

.btn-secondary:disabled:hover {
    background: #000000;
    color: #003300;
}

/* Status Bar */
.status-bar {
    border-top: 2px solid #00ff00;
    padding: 8px 20px;
    font-size: 0.75em;
    letter-spacing: 1px;
    display: flex;
    justify-content: space-between;
}

.status-left {
    display: flex;
    gap: 30px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #000000;
}

::-webkit-scrollbar-thumb {
    background: #00ff00;
    border: 1px solid #000000;
}

::-webkit-scrollbar-thumb:hover {
    background: #00cc00;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    
    .header {
        flex-direction: column;
        gap: 10px;
    }
    
    .title {
        font-size: 1.2em;
    }
}

/* Checkpoint Popup */
.checkpoint-popup {
    position: absolute;
    background: #000000;
    border: 2px solid #00ff00;
    color: #00ff00;
    padding: 10px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    z-index: 1000;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 155px;
}

.checkpoint-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #00ff00;
    padding-bottom: 4px;
    font-weight: bold;
    font-size: 11px;
}

.checkpoint-popup-close {
    cursor: pointer;
    color: #ff0000;
    font-size: 14px;
    line-height: 1;
    font-weight: bold;
    padding: 0 4px;
}

.checkpoint-popup-close:hover {
    color: #ff3333;
}

.checkpoint-popup-btn {
    background: #000000;
    border: 1px solid #00ff00;
    color: #00ff00;
    padding: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 10px;
    text-align: left;
    transition: all 0.2s;
}

.checkpoint-popup-btn:hover:not(:disabled) {
    background: #00ff00;
    color: #000000;
}

.checkpoint-popup-btn:disabled {
    border-color: #004400;
    color: #004400;
    cursor: not-allowed;
}
