/* prototype.rs - Rust Terminal Emulator */

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

:root {
    --bg-terminal: #0D1117;
    --surface-panel: #161B22;
    --text-primary: #C9D1D9;
    --text-muted: #6B7280;
    --text-sidebar: #8B949E;
    --success-green: #A8D8A0;
    --warning-amber: #FFD166;
    --error-coral: #FF6B6B;
    --rust-orange: #F74C00;
    --link-blue: #58A6FF;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-terminal);
    color: var(--text-primary);
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.6;
    tab-size: 4;
    overflow-x: hidden;
}

/* =====================
   TERMINAL LAYOUT
   ===================== */
.terminal-wrap {
    display: flex;
    min-height: 100vh;
}

.terminal-main {
    flex: 1;
    padding: 40px 40px 120px;
    max-width: 900px;
}

/* =====================
   BOOT SEQUENCE
   ===================== */
.boot-sequence {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ascii-title {
    font-family: 'Fira Code', monospace;
    font-size: clamp(0.5rem, 1.2vw, 0.9rem);
    color: var(--success-green);
    line-height: 1.2;
    margin-bottom: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: pre;
    overflow-x: auto;
}

.ascii-title.visible {
    opacity: 1;
}

.rust-orange {
    color: var(--rust-orange);
}

.boot-info {
    margin-bottom: 24px;
}

.boot-line {
    font-size: 14px;
    color: var(--text-muted);
    min-height: 1.5em;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.boot-line.visible {
    opacity: 1;
}

.ferris-art {
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.3;
    margin-bottom: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: pre;
}

.ferris-art.visible {
    opacity: 1;
}

/* =====================
   PROMPTS & CURSORS
   ===================== */
.prompt {
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 700;
}

.prompt-user {
    color: var(--success-green);
}

.prompt-sep {
    color: var(--text-primary);
}

.prompt-path {
    color: var(--link-blue);
}

.prompt-dollar {
    color: var(--text-primary);
    margin-left: 2px;
    margin-right: 8px;
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: var(--success-green);
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.cmd-text {
    color: var(--text-primary);
    font-weight: 400;
}

/* =====================
   COMMAND SECTIONS
   ===================== */
.cmd-section {
    margin-bottom: 48px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cmd-section.revealed {
    opacity: 1;
}

.section-break {
    font-size: 14px;
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 24px;
    margin-top: 16px;
}

.cmd-output {
    padding-left: 0;
    margin-top: 12px;
    opacity: 0;
    transition: opacity 0.3s ease 0.3s;
}

.cmd-section.revealed .cmd-output {
    opacity: 1;
}

/* Output status indicators */
.output-status {
    font-weight: 700;
    margin-bottom: 16px;
    padding: 4px 0;
}

.output-status.success {
    color: var(--success-green);
}

.output-status.warning {
    color: var(--warning-amber);
}

.output-status.error {
    color: var(--error-coral);
}

.output-body {
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 400;
    font-size: 15px;
}

.output-comment {
    color: var(--text-muted);
    font-style: italic;
    font-size: 14px;
    margin-bottom: 8px;
}

/* Warning/Error blocks with gutter */
.warning-block,
.error-block {
    margin: 12px 0;
    padding: 12px 16px;
    border-radius: 0;
    font-size: 14px;
}

.warning-block {
    border-left: 3px solid var(--warning-amber);
    background: rgba(255, 209, 102, 0.05);
}

.error-block {
    border-left: 3px solid var(--error-coral);
    background: rgba(255, 107, 107, 0.05);
}

.gutter-line {
    white-space: pre;
    line-height: 1.8;
}

.gutter-num {
    color: var(--text-muted);
    display: inline-block;
    width: 2em;
    text-align: right;
    margin-right: 4px;
}

.gutter-pipe {
    color: var(--link-blue);
    margin-right: 4px;
}

.code-text {
    color: var(--text-primary);
}

.gutter-line.hint .code-text {
    color: var(--warning-amber);
}

.error-block .gutter-line.hint .code-text {
    color: var(--error-coral);
}

/* =====================
   BUILD PROGRESS
   ===================== */
.build-progress {
    margin-bottom: 16px;
}

.progress-label {
    font-size: 14px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--surface-panel);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: var(--success-green);
    transition: width 2s ease;
}

.progress-fill.complete {
    width: 100%;
}

.final-status {
    font-size: 16px;
}

/* =====================
   CARGO.TOML SIDEBAR
   ===================== */
.cargo-sidebar {
    display: none;
    width: 280px;
    background: var(--surface-panel);
    padding: 24px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-left: 1px solid rgba(201, 209, 217, 0.1);
    font-size: 13px;
    color: var(--text-sidebar);
    opacity: 0;
    transform: translateX(280px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.cargo-sidebar.visible {
    opacity: 1;
    transform: translateX(0);
}

@media (min-width: 1100px) {
    .cargo-sidebar {
        display: block;
    }
}

.sidebar-header {
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 20px;
    font-size: 14px;
}

.toml-section {
    margin-bottom: 20px;
}

.toml-heading {
    color: var(--link-blue);
    font-weight: 700;
    margin-bottom: 8px;
}

.toml-pair {
    color: var(--text-sidebar);
    line-height: 1.8;
}

.toml-string {
    color: var(--success-green);
}

.toml-version {
    transition: color 0.3s ease;
}

/* =====================
   FIXED BOTTOM PROMPT
   ===================== */
.bottom-prompt {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: var(--surface-panel);
    border-top: 1px solid rgba(201, 209, 217, 0.1);
    display: flex;
    align-items: center;
    padding: 0 40px;
    z-index: 100;
    font-size: 14px;
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 768px) {
    .terminal-main {
        padding: 24px 16px 100px;
    }

    .bottom-prompt {
        padding: 0 16px;
    }

    .ascii-title {
        font-size: 0.45rem;
    }
}
