/* ============================================================
   OSKAR.TERMINAL — Bloomberg / MetaTrader Aesthetic
   ============================================================ */

:root {
    --bg:       #000000;
    --bg-panel: #0a0a0a;
    --amber:    #fb8b1e;
    --blue:     #0068ff;
    --green:    #4af6c3;
    --red:      #ff4444;
    --dim:      #555555;
    --text:     #cccccc;
    --border:   #222222;
    --font:     'JetBrains Mono', 'Consolas', 'Courier New', monospace;
}

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

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 12px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

/* ---- App Grid ---- */
.app {
    display: grid;
    grid-template-rows: 30px 1fr 22px;
    grid-template-columns: 60fr 40fr;
    height: 100vh;
    width: 100vw;
    gap: 1px;
    background: var(--border);
}

/* ---- Header Bar ---- */
.header {
    grid-column: 1 / -1;
    background: #0d0d0d;
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    white-space: nowrap;
}
.header-title {
    color: var(--amber);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.header-meta {
    color: var(--dim);
    font-size: 10px;
}
.header-sep {
    color: var(--border);
    font-size: 10px;
}
.header-label {
    color: var(--blue);
    font-size: 11px;
    font-weight: 500;
}
.header-right {
    margin-left: auto;
    display: flex;
    gap: 12px;
    align-items: center;
}
.header-loc {
    color: var(--dim);
    font-size: 10px;
    letter-spacing: 0.5px;
}
.header-time {
    color: var(--green);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    min-width: 70px;
    text-align: right;
}

/* ---- Status Bar ---- */
.status-bar {
    grid-column: 1 / -1;
    background: #0d0d0d;
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 20px;
    border-top: 1px solid var(--border);
    font-size: 10px;
    overflow: hidden;
    white-space: nowrap;
}
.status-item {
    color: var(--dim);
}
.status-item.ok {
    color: var(--green);
}
.status-item.amber {
    color: var(--amber);
}
.status-right {
    margin-left: auto;
    color: var(--dim);
    font-size: 10px;
}

/* ---- Terminal Pane (Left) ---- */
.terminal-pane {
    background: var(--bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}
.terminal-output {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 14px 4px 14px;
    scrollbar-width: thin;
    scrollbar-color: #333 #000;
}
.terminal-output::-webkit-scrollbar {
    width: 6px;
}
.terminal-output::-webkit-scrollbar-track {
    background: #000;
}
.terminal-output::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}
.terminal-input-row {
    display: flex;
    align-items: center;
    padding: 6px 14px 10px 14px;
    border-top: 1px solid var(--border);
    background: #050505;
    flex-shrink: 0;
}
.prompt {
    color: var(--amber);
    font-weight: 700;
    margin-right: 8px;
    white-space: nowrap;
    font-size: 12px;
}
.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 12px;
    caret-color: var(--amber);
    line-height: 1.45;
}
.terminal-input::placeholder {
    color: #333;
}

/* ---- Output Lines ---- */
.output-line {
    white-space: pre-wrap;
    word-break: break-all;
    min-height: 1em;
}
.blog-image-row {
    margin: 8px 0 10px;
    white-space: normal;
}
.blog-inline-image {
    display: block;
    max-width: min(100%, 560px);
    max-height: 320px;
    object-fit: contain;
    border: 1px solid var(--border);
    background: #050505;
}
.blog-image-meta {
    margin-top: 4px;
    font-size: 10px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.cmd-echo {
    color: var(--dim);
    margin-top: 8px;
}
.cmd-echo .prompt-echo {
    color: var(--amber);
    font-weight: 700;
}

/* ---- Segment Color Classes ---- */
.amber  { color: var(--amber); }
.blue   { color: var(--blue); }
.green  { color: var(--green); }
.red    { color: var(--red); }
.dim    { color: var(--dim); }
.text   { color: var(--text); }
.bold   { font-weight: 700; }
.white  { color: #ffffff; }
.amber-bold { color: var(--amber); font-weight: 700; }
.blue-bold  { color: var(--blue); font-weight: 700; }
.green-bold { color: var(--green); font-weight: 700; }

/* ---- Chart Pane (Right) ---- */
.chart-pane {
    background: var(--bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Top half: Command output / info area */
.chart-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    min-height: 0;
}

/* Bottom half: Always-running candlestick chart */
.chart-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.chart-header {
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.chart-header-title {
    color: var(--amber);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 1px;
}
.chart-header-sub {
    color: var(--dim);
    font-size: 10px;
    margin-top: 2px;
}
.chart-price-row {
    display: flex;
    gap: 14px;
    align-items: baseline;
    margin-top: 4px;
}
.chart-price {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.chart-change {
    font-size: 12px;
    font-weight: 500;
}
.chart-body {
    flex: 1;
    overflow: hidden;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.chart-live-body {
    justify-content: flex-end;
}
.chart-row {
    white-space: pre;
    line-height: 1.25;
    font-size: 11px;
}
.chart-footer {
    padding: 6px 14px;
    border-top: 1px solid var(--border);
    font-size: 10px;
    color: var(--dim);
    display: flex;
    gap: 16px;
    flex-shrink: 0;
}
.chart-footer-item {
    color: var(--dim);
}
.chart-footer-val {
    color: var(--text);
    font-weight: 500;
}

/* ---- Quote Board Mode ---- */
.quote-table {
    width: 100%;
    padding: 8px 14px;
    overflow-y: auto;
    flex: 1;
}
.quote-row {
    display: flex;
    padding: 4px 0;
    border-bottom: 1px solid #111;
    font-size: 11px;
    align-items: center;
}
.quote-row.header-row {
    color: var(--dim);
    font-size: 10px;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
    margin-bottom: 2px;
}
.quote-ticker {
    width: 60px;
    font-weight: 700;
    color: var(--amber);
}
.quote-name {
    flex: 1;
    color: var(--dim);
    font-size: 10px;
    padding-right: 8px;
}
.quote-price {
    width: 70px;
    text-align: right;
    font-weight: 500;
}
.quote-chg {
    width: 75px;
    text-align: right;
    font-weight: 500;
}
.quote-pct {
    width: 65px;
    text-align: right;
}
.quote-status {
    width: 90px;
    text-align: right;
    font-size: 10px;
    font-weight: 700;
}

/* ---- Scanline Overlay (subtle retro CRT effect) ---- */
.app::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
    z-index: 9999;
}

/* ---- Cursor Blink ---- */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
.terminal-input {
    animation: none;
}

/* ---- Selection ---- */
::selection {
    background: var(--amber);
    color: #000;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .app {
        grid-template-columns: 1fr;
        grid-template-rows: 30px 1fr 1fr 22px;
    }
    .chart-pane {
        border-top: 1px solid var(--border);
    }
}

/* Mobile: hide right pane completely for cleaner UX */
@media (max-width: 768px) {
    .app {
        grid-template-columns: 1fr;
        grid-template-rows: 30px 1fr 22px;
    }
    .chart-pane {
        display: none;
    }
}
