/* ==========================================================================
   MONARCH TPO TERMINAL - HIGH CONTRAST EDITION
   ========================================================================== */

/* --- 1. GLOBAL VARIABLES & RESET --- */
:root {
    /* Institutional Palette */
    --pro-bg: #0b0c10;        /* Deep Gunmetal */
    --pro-panel: #1f2833;     /* Panel Background */
    --pro-border: #45a29e;    /* Subtle Teal/Grey Border */
    --pro-gold: #D4AF37;      /* Monarch Gold */

    /* CHANGED: Forced White Text Variables */
    --pro-text: #ffffff;      /* Pure White */
    --pro-white: #ffffff;     /* Pure White */

    /* Typography */
    --font-main: 'Inter', sans-serif;
    --font-mono: 'Roboto Mono', monospace;
}

* { box-sizing: border-box; }

/* Utility Classes */
.hidden { display: none !important; }
.mono { font-family: var(--font-mono); }

/* --- 2. MAIN CONTAINER --- */
#tpo-view {
    font-family: var(--font-main);
    color: var(--pro-text);
    width: 100%;
    height: 750px;
    background: var(--pro-bg);
    position: relative;
    padding: 1rem;
    border: 1px solid #333;
    overflow: hidden;
}

/* --- 3. GRID LAYOUT SYSTEM --- */
#tpo-content {
    display: grid;
    grid-template-columns: 250px 1fr 250px;
    grid-template-rows: auto 1fr;
    gap: 1rem;
    height: 100%;
}

/* --- 4. HEADER SECTION --- */
.pro-header {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--pro-gold);
    padding-bottom: 0.75rem;
    margin-bottom: 0.5rem;
}

.pro-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--pro-white);
    text-transform: uppercase;
}

.pro-ticker-tape {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--pro-white); /* Forced White */
}

/* --- 5. SIDEBAR PANELS --- */
.hud-sidebar-left,
.hud-sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
}

/* Update this in tpo.css */
.pro-panel {
    background: var(--pro-panel);
    border: 1px solid #2c3e50;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 4px;
    position: relative;
    min-height: 80px;
    flex-shrink: 0; /* ADD THIS: Prevents squishing */
    height: auto;   /* ADD THIS: Allows natural expansion */
}

/* Gold Accent Line on Left */
.pro-panel::before {
    content: '';
    position: absolute;
    left: 0; top: 10px; bottom: 10px;
    width: 3px;
    background-color: var(--pro-gold);
    opacity: 0.5;
}

.pro-label {
    font-size: 0.7rem;
    color: #ffffff; /* CHANGED: Forced White (was #888) */
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
    opacity: 0.8; /* Slight dim to distinguish from values, but still white */
}

.pro-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--pro-white);
}

/* --- 6. UNIFIED INTELLIGENCE BOXES (Directive & Narrative) --- */
/* Update this in tpo.css */
.tactic-panel,
.analyst-card {
    margin-top: auto;
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid var(--pro-gold);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.05);
    padding: 1rem;
    border-radius: 4px;
    position: relative;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex-shrink: 0; /* ADD THIS: Prevents squishing */
    height: auto;   /* ADD THIS: Allows natural expansion */
}

.tactic-panel::before,
.analyst-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background-color: var(--pro-gold);
    opacity: 1;
}

/* Text Styling inside the boxes */
.tactic-text,
.analyst-text {
    font-family: var(--font-main);
    font-size: 0.75rem;
    line-height: 1.5;
    color: #ffffff; /* CHANGED: Forced White (was #c9d1d9) */
}

/* Strong Tags (THESIS/ACTION labels) */
.tactic-text strong,
.analyst-text strong {
    display: inline-block;
    color: var(--pro-gold);
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    margin-right: 4px;
}

/* --- 7. CHART AREA --- */
.pro-chart-area {
    background-color: #151b24;
    border: 1px solid #333;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    min-height: 400px;
    border-radius: 4px;
}

/* --- 8. LOADING SCREEN --- */
#tpo-loader {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--pro-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.pro-spinner {
    width: 40px; height: 40px;
    border: 3px solid #333;
    border-top: 3px solid var(--pro-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-text {
    margin-top: 15px;
    font-size: 0.75rem;
    color: #ffffff; /* CHANGED: Forced White (was #888) */
    letter-spacing: 1px;
    text-transform: uppercase;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* ==========================================================================
   9. RESPONSIVE MEDIA QUERIES
   ========================================================================== */

@media screen and (max-width: 1024px) {
    #tpo-view {
        height: auto;
        overflow-y: visible;
        padding: 0.5rem;
    }

    #tpo-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        gap: 1rem;
    }

    .pro-header { order: 1; }
    .pro-chart-area { order: 2; height: 500px; }

    .hud-sidebar-left {
        order: 3;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    .tactic-panel { grid-column: 1 / -1; }

    .hud-sidebar-right {
        order: 4;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    .analyst-card { grid-column: 1 / -1; }
}

@media screen and (max-width: 768px) {
    .pro-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .pro-ticker-tape {
        width: 100%;
        justify-content: space-between;
        font-size: 0.85rem;
    }

    .pro-chart-area {
        height: 350px;
        min-height: 300px;
    }

    .hud-sidebar-left,
    .hud-sidebar-right {
        grid-template-columns: 1fr;
    }

    .pro-value { font-size: 1rem; }
    .pro-label { font-size: 0.65rem; }
}

/* TPO Terminal Styling */
.pro-container {
    background-color: #0b0c10;
    color: #c9d1d9;
    font-family: 'Inter', -apple-system, sans-serif;
}

.hidden { display: none !important; }

.pro-spinner {
    border: 3px solid rgba(212, 175, 55, 0.1);
    border-top: 3px solid #D4AF37;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.pro-value { font-family: 'Roboto Mono', monospace; font-size: 1.1rem; font-weight: 700; }
.pro-value-large { font-family: 'Roboto Mono', monospace; font-size: 1.5rem; font-weight: 800; }
.gold-text { color: #D4AF37; }
.white-text { color: #ffffff; }

.narrative-body {
    font-size: 13px;
    line-height: 1.6;
    transition: opacity 0.3s ease;
}

.tactic-body {
    font-size: 13px;
    font-weight: 600;
    color: #D4AF37;
    border-left: 2px solid #D4AF37;
    padding-left: 10px;
}