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

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

body {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    background: #0a0a0a;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(0, 255, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(255, 255, 0, 0.1) 0%, transparent 50%);
    height: 100vh;
    overflow: hidden;
    color: #00ff00;
    position: relative;
}

/* CRT Monitor Effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 255, 0, 0.03) 2px,
            rgba(0, 255, 0, 0.03) 4px);
    pointer-events: none;
    z-index: 1000;
}

/* Scanline Effect */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(transparent 50%,
            rgba(0, 255, 0, 0.02) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 1001;
    animation: scanlines 0.1s linear infinite;
}

@keyframes scanlines {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(4px);
    }
}

.container {
    display: flex;
    height: 100vh;
    gap: 2px;
    background: #000;
    border: 3px solid #00ff00;
    border-radius: 8px;
    margin: 10px;
    box-shadow:
        0 0 20px rgba(0, 255, 0, 0.5),
        inset 0 0 20px rgba(0, 255, 0, 0.1);
    position: relative;
}

.container::before {
    content: 'NEXUS AI SYSTEM v1.0';
    position: absolute;
    top: -25px;
    left: 10px;
    color: #00ff00;
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
}

/* Left Pane */
.left-pane {
    width: 350px;
    background: #001100;
    color: #00ff00;
    padding: 20px;
    overflow-y: auto;
    border-right: 2px solid #00ff00;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 255, 0, 0.1);
}

/* Right Pane Settings */
.right-pane-settings {
    width: 350px;
    background: #001100;
    color: #00ff00;
    padding: 20px;
    overflow-y: auto;
    border-left: 2px solid #00ff00;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 255, 0, 0.1);
}

/* Dial field styling */
.dial-field {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.dial-field label {
    color: #00ff00;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-family: 'Orbitron', monospace;
}

.dial-field label .range {
    display: block;
    font-size: 10px;
    color: #00ffff;
    opacity: 0.7;
    margin-top: 2px;
}

.dial-field>div {
    display: flex;
    justify-content: center;
}

/* NexusUI dial canvas styling */
#speechVoiceDial canvas,
#speechSpeedDial canvas,
#speechReverbDial canvas,
#speechFormantDial canvas,
#speechPitchDial canvas,
#speechExpressionDial canvas,
#speechVolumeDial canvas,
#speechArticulateDial canvas {
    border-radius: 10px;
    border: 2px solid #00ff00;
    box-shadow:
        0 0 15px rgba(0, 255, 0, 0.3),
        inset 0 0 10px rgba(0, 255, 0, 0.1);
    background: #000;
}

/* Speech controls (reset button) */
.speech-controls {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.speech-controls button {
    padding: 8px 16px;
    background: #000;
    color: #ff0000;
    border: 2px solid #ff0000;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Orbitron', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

.speech-controls button:hover {
    background: #110000;
    border-color: #ff6666;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.8);
}

.control-section h3 {
    color: #00ffff;
    margin-bottom: 20px;
    font-size: 1.2em;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    border-bottom: 2px solid #00ff00;
    padding-bottom: 10px;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.8);
    position: relative;
}

.control-section h3::before {
    content: '>>> ';
    color: #00ff00;
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #00ff00;
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #00ff00;
    border-radius: 4px;
    background: #000;
    color: #00ff00;
    font-size: 14px;
    font-family: 'Share Tech Mono', monospace;
    transition: all 0.3s ease;
    box-shadow:
        inset 0 0 10px rgba(0, 255, 0, 0.1),
        0 0 5px rgba(0, 255, 0, 0.3);
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow:
        inset 0 0 15px rgba(0, 255, 255, 0.2),
        0 0 10px rgba(0, 255, 255, 0.5);
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.8);
}

.input-group textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

.input-group textarea#preprompt {
    color: #ffff00;
    text-shadow: 0 0 5px rgba(255, 255, 0, 0.8);
}

.prompt-presets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.prompt-presets button {
    padding: 8px 10px;
    background: #000;
    color: #ffff00;
    border: 2px solid #ffff00;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Orbitron', monospace;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 0 8px rgba(255, 255, 0, 0.25);
}

.prompt-presets button:hover {
    background: #111100;
    border-color: #ffffff;
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.45);
    text-shadow: 0 0 8px rgba(255, 255, 0, 0.9);
}

.prompt-note {
    margin: -2px 0 10px 0;
    color: #00ffff;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    line-height: 1.35;
    text-shadow: 0 0 4px rgba(0, 255, 255, 0.65);
}

.input-group button {
    margin-top: 8px;
    padding: 10px 20px;
    background: #000;
    color: #00ff00;
    border: 2px solid #00ff00;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow:
        0 0 10px rgba(0, 255, 0, 0.3),
        inset 0 0 10px rgba(0, 255, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.input-group button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 0, 0.3), transparent);
    transition: left 0.5s ease;
}

.input-group button:hover:not(:disabled)::before {
    left: 100%;
}

.input-group button:hover:not(:disabled) {
    background: #001100;
    border-color: #00ffff;
    box-shadow:
        0 0 20px rgba(0, 255, 255, 0.5),
        inset 0 0 20px rgba(0, 255, 255, 0.2);
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
}

.input-group button:disabled {
    background: #000;
    border-color: #333;
    color: #333;
    cursor: not-allowed;
    box-shadow: none;
}

.status-indicators {
    margin-top: 20px;
    padding: 15px;
    background: #000;
    border: 2px solid #00ff00;
    border-radius: 4px;
    box-shadow:
        inset 0 0 10px rgba(0, 255, 0, 0.1),
        0 0 5px rgba(0, 255, 0, 0.3);
}

.status-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-family: 'Share Tech Mono', monospace;
}

.status-item:last-child {
    margin-bottom: 0;
}

.status-label {
    font-weight: 600;
    color: #00ff00;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-value {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 2px;
    font-size: 11px;
    font-family: 'Orbitron', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-value.connected {
    background: #001100;
    color: #00ff00;
    border: 1px solid #00ff00;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.8);
}

.status-value.disconnected {
    background: #110000;
    color: #ff0000;
    border: 1px solid #ff0000;
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.8);
}

.direct-serial {
    margin-top: 20px;
    padding: 15px;
    background: #000;
    border: 2px solid #00ffff;
    border-radius: 4px;
    box-shadow:
        inset 0 0 10px rgba(0, 255, 255, 0.1),
        0 0 5px rgba(0, 255, 255, 0.3);
}

.direct-serial h4 {
    color: #00ffff;
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.8);
    border-bottom: 1px solid #00ffff;
    padding-bottom: 5px;
}

.direct-serial .input-group {
    margin-bottom: 0;
}

.direct-serial textarea {
    background: #000;
    color: #00ffff;
    border: 2px solid #00ffff;
    font-family: 'Share Tech Mono', monospace;
    box-shadow:
        inset 0 0 10px rgba(0, 255, 255, 0.1),
        0 0 5px rgba(0, 255, 255, 0.3);
    resize: none;
}

.direct-serial textarea:focus {
    border-color: #ffffff;
    box-shadow:
        inset 0 0 15px rgba(255, 255, 255, 0.2),
        0 0 10px rgba(255, 255, 255, 0.5);
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.8);
}

.direct-serial button {
    background: #000;
    color: #00ffff;
    border: 2px solid #00ffff;
    font-family: 'Orbitron', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.direct-serial button:hover:not(:disabled) {
    background: #001111;
    border-color: #ffffff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

.direct-serial button:disabled {
    background: #000;
    border-color: #333;
    color: #333;
    box-shadow: none;
}

.audio-test {
    margin-top: 20px;
    padding: 15px;
    background: #000;
    border: 2px solid #ffff00;
    border-radius: 4px;
    box-shadow:
        inset 0 0 10px rgba(255, 255, 0, 0.1),
        0 0 5px rgba(255, 255, 0, 0.3);
}

.audio-test h4 {
    color: #ffff00;
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    text-shadow: 0 0 5px rgba(255, 255, 0, 0.8);
    border-bottom: 1px solid #ffff00;
    padding-bottom: 5px;
}

.audio-test button {
    background: #000;
    color: #ffff00;
    border: 2px solid #ffff00;
    font-family: 'Orbitron', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 16px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.3);
    transition: all 0.3s ease;
}

.audio-test button:hover {
    background: #111100;
    border-color: #ffffff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.8);
}

.serial-options {
    margin-top: 20px;
    padding: 15px;
    background: #000;
    border: 2px solid #ff6600;
    border-radius: 4px;
    box-shadow:
        inset 0 0 10px rgba(255, 102, 0, 0.1),
        0 0 5px rgba(255, 102, 0, 0.3);
}

.serial-options h4 {
    color: #ff6600;
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    text-shadow: 0 0 5px rgba(255, 102, 0, 0.8);
    border-bottom: 1px solid #ff6600;
    padding-bottom: 5px;
}

.serial-options .input-group {
    margin-bottom: 0;
}

.serial-options select {
    background: #000;
    color: #ff6600;
    border: 2px solid #ff6600;
    font-family: 'Share Tech Mono', monospace;
    box-shadow:
        inset 0 0 10px rgba(255, 102, 0, 0.1),
        0 0 5px rgba(255, 102, 0, 0.3);
}

.serial-options select:focus {
    border-color: #ffffff;
    box-shadow:
        inset 0 0 15px rgba(255, 255, 255, 0.2),
        0 0 10px rgba(255, 255, 255, 0.5);
    text-shadow: 0 0 5px rgba(255, 102, 0, 0.8);
}

.system-messages {
    margin-top: 20px;
    padding: 15px;
    background: #000;
    border: 2px solid #00ff00;
    border-radius: 4px;
    box-shadow:
        inset 0 0 10px rgba(0, 255, 0, 0.1),
        0 0 5px rgba(0, 255, 0, 0.3);
}

.system-messages h4 {
    color: #00ffff;
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.8);
    border-bottom: 1px solid #00ff00;
    padding-bottom: 5px;
}

.system-log {
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    line-height: 1.4;
}

.system-log p {
    margin: 0 0 5px 0;
    color: #00ff00;
    text-shadow: 0 0 3px rgba(0, 255, 0, 0.6);
    word-wrap: break-word;
}

.system-log p:last-child {
    margin-bottom: 0;
}

.system-log p.error {
    color: #ff0000;
    text-shadow: 0 0 3px rgba(255, 0, 0, 0.6);
}

.system-log p.success {
    color: #00ff00;
    text-shadow: 0 0 3px rgba(0, 255, 0, 0.6);
}

.system-log p.info {
    color: #00ffff;
    text-shadow: 0 0 3px rgba(0, 255, 255, 0.6);
}

/* Right Pane */
.right-pane {
    flex: 1;
    background: #000;
    color: #00ff00;
    display: flex;
    flex-direction: column;
    border-left: 2px solid #00ff00;
    box-shadow: inset 0 0 20px rgba(0, 255, 0, 0.1);
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    background: #001100;
    color: #00ff00;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border-bottom: 2px solid #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.chat-header h2 {
    font-size: 1.5em;
    color: #00ffff;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
    position: relative;
}

.chat-header h2::after {
    content: ' code v. 1.0';
    color: #00ff00;
    font-size: 0.8em;
}

.chat-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.chat-controls button,
.chat-controls a {
    min-height: 38px;
    padding: 8px 16px;
    background: #000;
    color: #ff0000;
    border: 2px solid #ff0000;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-family: 'Orbitron', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

.chat-controls .help-button {
    width: 38px;
    height: 38px;
    padding: 0;
    color: #00ffff;
    border-color: #00ffff;
    font-size: 18px;
    line-height: 1;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.chat-controls .source-button {
    width: 38px;
    height: 38px;
    padding: 0;
    color: #00ff00;
    border-color: #00ff00;
    font-size: 13px;
    line-height: 1;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.chat-controls button:hover,
.chat-controls a:hover {
    background: #110000;
    border-color: #ff6666;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.8);
}

.chat-controls .help-button:hover {
    background: #001111;
    border-color: #ffffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
    text-shadow: 0 0 6px rgba(0, 255, 255, 0.9);
}

.chat-controls .source-button:hover {
    background: #001100;
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
    text-shadow: 0 0 6px rgba(0, 255, 0, 0.9);
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #000;
    font-family: 'Share Tech Mono', monospace;
}

.message {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 4px;
    max-width: 80%;
    word-wrap: break-word;
    border: 1px solid;
    position: relative;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
}

.message.user-message {
    background: #001100;
    color: #00ff00;
    border-color: #00ff00;
    margin-left: auto;
    text-align: right;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
}

.message.user-message::before {
    content: 'USER: ';
    color: #00ffff;
    font-weight: bold;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.message.assistant-message {
    background: #000;
    color: #00ff00;
    border-color: #00ffff;
    margin-right: auto;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
    position: relative;
}

.message.assistant-message.typing::after {
    content: '█';
    color: #00ffff;
    animation: blink 1s infinite;
    font-weight: bold;
}

.message.assistant-message::before {
    content: 'NEXUS: ';
    color: #00ffff;
    font-weight: bold;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: blink 1.5s infinite;
}

.message.system-message {
    background: #000;
    color: #ffff00;
    border-color: #ffff00;
    text-align: center;
    margin: 0 auto;
    max-width: 90%;
    box-shadow: 0 0 15px rgba(255, 255, 0, 0.3);
}

.message.system-message::before {
    content: 'SYSTEM: ';
    color: #ffff00;
    font-weight: bold;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.message p {
    margin: 0;
    line-height: 1.5;
    text-shadow: 0 0 5px currentColor;
}

.typing-indicator {
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

.chat-input-container {
    background: #001100;
    padding: 20px;
    border-top: 2px solid #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.chat-input-container .input-group {
    margin-bottom: 10px;
}

.chat-input-container textarea {
    background: #000;
    color: #00ff00;
    border: 2px solid #00ff00;
    resize: none;
    font-family: 'Share Tech Mono', monospace;
    box-shadow:
        inset 0 0 10px rgba(0, 255, 0, 0.1),
        0 0 5px rgba(0, 255, 0, 0.3);
}

.chat-input-container textarea:focus {
    border-color: #00ffff;
    box-shadow:
        inset 0 0 15px rgba(0, 255, 255, 0.2),
        0 0 10px rgba(0, 255, 255, 0.5);
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.8);
}

.chat-input-container button {
    background: #000;
    color: #00ff00;
    border: 2px solid #00ff00;
    margin-left: 10px;
    padding: 12px 24px;
    font-size: 14px;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
    transition: all 0.3s ease;
}

.chat-input-container button:hover:not(:disabled) {
    background: #001100;
    border-color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
}

.chat-input-container button:disabled {
    background: #000;
    border-color: #333;
    color: #333;
    box-shadow: none;
}

.input-options {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.input-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #00ff00;
    font-size: 12px;
    font-family: 'Share Tech Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.input-options label:hover {
    color: #00ffff;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.8);
}

.input-options input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #00ff00;
    cursor: pointer;
}

.help-modal[hidden] {
    display: none;
}

.help-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.86);
}

.help-dialog {
    width: min(760px, 100%);
    max-height: min(86vh, 820px);
    overflow: hidden;
    background: #000;
    color: #00ff00;
    border: 2px solid #00ffff;
    border-radius: 4px;
    box-shadow:
        0 0 25px rgba(0, 255, 255, 0.45),
        inset 0 0 18px rgba(0, 255, 255, 0.12);
}

.help-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    background: #001100;
    border-bottom: 2px solid #00ffff;
}

.help-header h2 {
    color: #00ffff;
    font-family: 'Orbitron', monospace;
    font-size: 18px;
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.8);
}

.help-close {
    width: 36px;
    height: 36px;
    background: #000;
    color: #ff0000;
    border: 2px solid #ff0000;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    transition: all 0.3s ease;
}

.help-close:hover {
    background: #110000;
    border-color: #ff6666;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
}

.help-content {
    max-height: calc(min(86vh, 820px) - 70px);
    overflow-y: auto;
    padding: 18px;
    font-family: 'Share Tech Mono', monospace;
    line-height: 1.45;
}

.help-content section {
    padding: 14px 0;
    border-bottom: 1px solid rgba(0, 255, 255, 0.35);
}

.help-content section:first-child {
    padding-top: 0;
}

.help-content section:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.help-content h3 {
    color: #ffff00;
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    margin-bottom: 8px;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(255, 255, 0, 0.8);
}

.help-content p,
.help-content li {
    font-size: 13px;
    color: #00ff00;
    text-shadow: 0 0 4px rgba(0, 255, 0, 0.6);
}

.help-content p {
    margin-bottom: 8px;
}

.help-content p:last-child {
    margin-bottom: 0;
}

.help-content ol {
    margin: 0 0 8px 20px;
}

.help-content li {
    margin-bottom: 6px;
}

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

::-webkit-scrollbar-track {
    background: #000;
    border: 1px solid #00ff00;
}

::-webkit-scrollbar-thumb {
    background: #00ff00;
    border-radius: 2px;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

::-webkit-scrollbar-thumb:hover {
    background: #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        margin: 5px;
    }

    .left-pane {
        width: 100%;
        height: 40vh;
    }

    .right-pane {
        height: 60vh;
    }

    .chat-header {
        align-items: flex-start;
        gap: 12px;
        padding: 14px;
    }

    .chat-header h2 {
        font-size: 1.1em;
    }

    .chat-controls {
        flex-shrink: 0;
    }

    .chat-controls button,
    .chat-controls a {
        padding: 8px 10px;
        font-size: 10px;
    }

    .chat-controls .help-button {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }

    .chat-controls .source-button {
        width: 34px;
        height: 34px;
        font-size: 12px;
    }

    .help-modal {
        padding: 10px;
    }

    .container::before {
        font-size: 10px;
    }
}

/* Additional Retro Effects */
.container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(0, 255, 0, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* Glitch Effect for Headers */
.chat-header h2:hover {
    animation: glitch 0.3s ease-in-out;
}

@keyframes glitch {
    0% {
        transform: translate(0);
    }

    20% {
        transform: translate(-2px, 2px);
    }

    40% {
        transform: translate(-2px, -2px);
    }

    60% {
        transform: translate(2px, 2px);
    }

    80% {
        transform: translate(2px, -2px);
    }

    100% {
        transform: translate(0);
    }
}
