/* VT100 Terminal Styling */
/* MONOCHROME GREEN PHOSPHOR DISPLAY - 1990s VDU Style */
/* Target: ~130 columns x 80 rows */

:root {
    --terminal-green: #33ff33;
    --terminal-green-dim: #1a8a1a;
    --terminal-bg: #0a0a0a;
    --crt-glow: rgba(51, 255, 51, 0.1);
    --terminal-font-size: 14px;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    background: #000;
    font-family: 'VT323', monospace;
    color: var(--terminal-green);
}

/* Main Container - Split 50/50 */
.main-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* LEFT SIDE: Terminal (50%) - MONOCHROME */
.terminal-section {
    width: 50%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--terminal-bg);
    position: relative;
}

/* CRT Scanline Effect - Terminal Only */
.terminal-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 100;
}

/* CRT Vignette Effect */
.terminal-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        rgba(0, 0, 0, 0.4) 100%
    );
    pointer-events: none;
    z-index: 99;
}

/* VDU Terminal */
.vdu-terminal {
    flex: 1;
    display: flex;
    flex-direction: column;
    border: 3px solid var(--terminal-green);
    margin: 8px;
    box-shadow:
        0 0 20px var(--crt-glow),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background: var(--terminal-bg);
    border-bottom: 2px solid var(--terminal-green);
    font-size: 16px;
}

.terminal-title {
    color: var(--terminal-green);
    text-shadow: 0 0 8px var(--crt-glow);
    flex: 1;
    text-align: center;
}

.session-info {
    color: var(--terminal-green);
    min-width: 100px;
}

.terminal-toolbar {
    display: flex;
    gap: 4px;
}

.toolbar-btn {
    background: var(--terminal-bg);
    border: 1px solid var(--terminal-green);
    color: var(--terminal-green);
    font-family: 'VT323', monospace;
    font-size: 16px;
    width: 28px;
    height: 24px;
    cursor: pointer;
    text-shadow: 0 0 5px var(--crt-glow);
    transition: all 0.15s ease;
}

.toolbar-btn:hover {
    background: var(--terminal-green);
    color: var(--terminal-bg);
    box-shadow: 0 0 10px var(--crt-glow);
}

.toolbar-btn:active {
    transform: scale(0.95);
}

/* Terminal Content */
.terminal-content {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--terminal-bg);
    font-size: var(--terminal-font-size);
}

.output {
    line-height: 1.3;
    font-family: 'VT323', monospace;
}

/* ALL OUTPUT IS GREEN - NO COLORS */
.output-line {
    margin-bottom: 1px;
    word-wrap: break-word;
    white-space: pre-wrap;
    color: var(--terminal-green);
    text-shadow: 0 0 5px var(--crt-glow);
}

/* Dim text variant - still green */
.output-line.system {
    color: var(--terminal-green-dim);
}

/* No other color classes - everything is green */
.output-line.error,
.output-line.highlight,
.output-line.action {
    color: var(--terminal-green);
}

.terminal-input {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: var(--terminal-bg);
    border-top: 2px solid var(--terminal-green);
}

.prompt {
    color: var(--terminal-green);
    margin-right: 8px;
    text-shadow: 0 0 8px var(--crt-glow);
    font-size: var(--terminal-font-size);
}

#commandInput {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--terminal-green);
    font-family: 'VT323', monospace;
    font-size: var(--terminal-font-size);
    caret-color: var(--terminal-green);
    text-shadow: 0 0 5px var(--crt-glow);
}

#commandInput::placeholder {
    color: var(--terminal-green-dim);
}

/* RIGHT SIDE: Image Panel (50%) - FULL COLOR */
.image-section {
    width: 50%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #1a1a2e;
    border-left: 3px solid #333;
}

.image-header {
    padding: 12px 16px;
    background: linear-gradient(180deg, #2a2a4e 0%, #1a1a2e 100%);
    border-bottom: 2px solid #444;
    font-family: 'Arial', sans-serif;
    font-size: 14px;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.image-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #0f0f1a 100%);
}

.image-placeholder {
    text-align: center;
    color: #666;
    font-family: 'Arial', sans-serif;
}

.image-placeholder-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.image-placeholder-text {
    font-size: 16px;
    color: #555;
    margin-bottom: 10px;
}

.image-placeholder-subtext {
    font-size: 12px;
    color: #444;
}

.scene-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.scene-image.loaded {
    opacity: 1;
}

.image-metadata {
    padding: 12px 16px;
    background: linear-gradient(180deg, #1a1a2e 0%, #2a2a4e 100%);
    border-top: 2px solid #444;
    font-family: 'Arial', sans-serif;
    font-size: 12px;
    color: #888;
}

/* Player Sidebar - Hidden by default, shown in game */
.player-sidebar {
    position: absolute;
    top: 60px;
    right: 10px;
    width: 180px;
    background: rgba(10, 10, 10, 0.95);
    border: 2px solid var(--terminal-green);
    z-index: 200;
    display: none;
}

.sidebar-header {
    padding: 6px 10px;
    background: var(--terminal-bg);
    border-bottom: 1px solid var(--terminal-green-dim);
    font-size: 14px;
    text-align: center;
    color: var(--terminal-green);
}

.player-list {
    padding: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.player-item {
    padding: 4px 0;
    border-bottom: 1px solid var(--terminal-green-dim);
    color: var(--terminal-green);
}

.player-item:last-child {
    border-bottom: none;
}

.player-name {
    font-size: 14px;
    color: var(--terminal-green);
}

.player-status {
    font-size: 11px;
    color: var(--terminal-green-dim);
}

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

::-webkit-scrollbar-track {
    background: var(--terminal-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--terminal-green-dim);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--terminal-green);
}

/* Cursor blink animation */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Vertical Layout Mode - Terminal below art */
.main-container.layout-vertical {
    flex-direction: column-reverse;
}

.main-container.layout-vertical .terminal-section {
    width: 100%;
    height: 50%;
}

.main-container.layout-vertical .image-section {
    width: 100%;
    height: 50%;
    border-left: none;
    border-bottom: 3px solid #333;
}

/* Responsive - Stack on small screens */
@media (max-width: 1200px) {
    .main-container:not(.layout-vertical) {
        flex-direction: column;
    }

    .main-container:not(.layout-vertical) .terminal-section {
        width: 100%;
        height: 60%;
    }

    .main-container:not(.layout-vertical) .image-section {
        width: 100%;
        height: 40%;
        border-left: none;
        border-top: 3px solid #333;
    }
}

/* ASCII Art Styling */
.ascii-art {
    line-height: 1.1;
    color: var(--terminal-green);
}
