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

/* --- THEME ROOT DEFINITIONS --- */
html[data-theme="dark"] {
    --bg-main: #050505;
    --bg-card: #0d0d0d;
    --bg-nav: #000000;
    --text-body: #ffffff;
    --text-dim: #88929b;
    --accent: #ff8c00;
    --accent-sky: #00e5ff;
    --hazard: #ff4444;
    --border: #ff8c0075;
    --ticker-card: rgba(255, 255, 255, 0.03);
}

html[data-theme="light"] {
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --bg-nav: #ffffff;
    --text-body: #0f172a;
    --text-dim: #64748b;
    --accent: #f97316;
    --accent-sky: #0284c7;
    --border: #e2e8f0;
    --hazard: #dc2626;
    --ticker-card: rgba(0, 0, 0, 0.03);
}

/* --- THE PHYSICAL GRID --- */
html, body, #app, .vision-container {
    height: 100vh !important;
    width: 100vw !important;
    overflow: hidden !important;
    margin: 0;
    padding: 0;
    font-family: 'JetBrains Mono', monospace !important;
    background-color: var(--bg-main);
    color: var(--text-body);
}

.vision-container {
    display: flex;
    flex-direction: column;
}

.hero-bar {
    flex: 0 0 80px;
    background: var(--bg-nav);
    display: flex;
    align-items: center;
    padding: 0 30px;
    border-bottom: 1px solid var(--border);
}

/* --- THE TRIPLE ARTERY TICKER --- */
.midas-ticker-container {
    flex: 0 0 auto;
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 0;
    -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
    mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}

.ticker-row {
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
}

.midas-ticker {
    display: flex;
    white-space: nowrap;
    will-change: transform;
}

.scroll-left {
    animation: ticker-scroll-left 150s linear infinite;
}

.scroll-right {
    animation: ticker-scroll-right 160s linear infinite;
}

.midas-ticker:hover {
    animation-play-state: paused;
}

.ticker-item {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    min-width: 170px;
    height: 40px;
    background: var(--ticker-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0 12px;
    margin-right: 12px;
}

.main-grid-area {
    flex: 1;
    display: flex;
    padding: 15px;
    gap: 15px;
    min-height: 0;
}

/* 4. Legend Ribbon (Fixed at bottom) */
.legend-ribbon {
    flex: 0 0 65px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: center;
    z-index: 10;
}

.legend-item {
    padding: 0 20px;
}

.legend-title {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    margin-bottom: 2px;
}

.legend-desc {
    font-size: 0.55rem;
    color: var(--text-dim);
    line-height: 1.2;
}

/* --- CARD INTERNALS --- */
.activity-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.guard-panel {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.card-header {
    background: rgba(128,128,128,0.05);
    border-bottom: 1px solid var(--border);
    padding: 8px 15px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

/* --- UTILITIES --- */
.text-terminal {
    color: #6dd688 !important;
}

.text-hazard {
    color: var(--hazard) !important;
}

.text-info {
    color: var(--accent-sky) !important;
}

.text-gain {
    color: #6dd688 !important;
    font-weight: 800;
}

.text-loss {
    color: var(--accent) !important;
    font-weight: 800;
}

.fw-900 {
    font-weight: 900;
}

.uppercase {
    text-transform: uppercase;
}

@keyframes ticker-scroll-left {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes ticker-scroll-right {
    0% {
        transform: translateX(-50%);
    }

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

*:focus {
    outline: none !important;
}


/* --- THE INDEX HUD BOXES (MATCHING TICKER CARDS) --- */
.index-box {
    background: var(--ticker-card); /* Matches the ticker/heatmap background */
    border: 1px solid var(--border); /* Matches the card borders */
    border-radius: 4px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px; /* Space between text and sparkline */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Ensure the label inside the box is prominent */
.index-label {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-body);
}

/* --- THE GUARD PANELS (MATCHING THEME) --- */
.guard-panel {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.gap-3-less {
    gap: 0.25rem !important
}


.version-tag {
    padding-left: 15px;
    font-size: 0.5em;
    opacity: 50%;
}



/* --- THE PHYSICAL GRID --- */
html, body, #app, .vision-container {
    height: 100vh !important;
    width: 100vw !important;
    overflow: hidden !important; /* Prevents the whole browser from scrolling */
    margin: 0;
    padding: 0;
    font-family: 'JetBrains Mono', monospace !important;
    background-color: var(--bg-main);
    color: var(--text-body);
}

.vision-container {
    display: flex;
    flex-direction: column;
}

/* 1. Hero Bar */
.hero-bar {
    flex: 0 0 80px;
    background: var(--bg-nav);
    display: flex;
    align-items: center;
    padding: 0 30px;
    border-bottom: 1px solid var(--border);
}

/* 2. Ticker Artery */
.midas-ticker-container {
    flex: 0 0 auto;
    /* ... rest of your ticker styles ... */
}

/* 3. Main Data Content (The Scrollable Area) */
.main-grid-area {
    flex: 1;
    display: flex;
    padding: 15px;
    gap: 15px;
    min-height: 0; /* CRITICAL: Allows the flex child to be smaller than its content */
}

.activity-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0; /* CRITICAL: Allows the card to stay within the grid area */
    overflow: hidden; /* Keeps the header fixed */
}

/* THE SCROLLABLE HUB */
.activity-body {
    flex: 1;
    overflow-y: auto; /* FORCES SCROLLBAR FOR TRADES */
    padding: 20px;
    display: flex;
    flex-direction: column;
}

    /* LION-GRADE SCROLLBAR (Sleek and Dark) */
    .activity-body::-webkit-scrollbar {
        width: 6px;
    }

    .activity-body::-webkit-scrollbar-track {
        background: var(--bg-main);
    }

    .activity-body::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: 10px;
    }

        .activity-body::-webkit-scrollbar-thumb:hover {
            background: var(--accent);
        }





/* --- PLACEHOLDER REFINEMENT --- */
.placeholder-msg {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
}

.letter-spacing-2 {
    letter-spacing: 2px;
}

/* Ensure icons are correctly sized */
.fs-1 {
    font-size: 3rem !important;
}

.fs-2 {
    font-size: 2rem !important;
}

/* Clean Artery Loading color */
.ticker-loading {
    width: 100%;
    text-align: center;
    padding: 30px;
    color: var(--text-dim);
    font-size: 0.75rem;
    letter-spacing: 3px;
    font-weight: 800;
}


/* --- THE HUNT HUD --- */
.hunt-hud-container {
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: radial-gradient(circle, rgba(255, 204, 0, 0.03) 0%, transparent 70%);
}

.radar-box {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 2rem;
}

.radar-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 10px rgba(255, 204, 0, 0.2));
}

.radar-ring-outer {
    fill: none;
    stroke: var(--accent);
    stroke-width: 0.5;
    opacity: 0.3;
}

.radar-ring-inner {
    fill: none;
    stroke: var(--accent);
    stroke-width: 0.5;
    opacity: 0.2;
}

.radar-axis {
    stroke: var(--accent);
    stroke-width: 0.2;
    opacity: 0.2;
}

/* The Rotating Sweep Effect */
.radar-scanner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: conic-gradient(from 0deg, transparent 0deg, rgba(255, 204, 0, 0.2) 360deg);
    border-radius: 50%;
    animation: rotate-radar 4s linear infinite;
}

@keyframes rotate-radar {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.hud-title-active {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 6px;
    color: var(--text-head);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.hud-stats {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.hud-ticker-msg {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-dim);
    letter-spacing: 3px;
    opacity: 0.6;
}

.hud-pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--text-terminal);
    border-radius: 50%;
    margin-left: 10px;
    box-shadow: 0 0 10px var(--text-terminal);
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.3;
        transform: scale(1.2);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}