
@font-face {
    font-family: "ArialBlackCustom";
    src: url("../fonts/arial-black.ttf") format("truetype");
    font-weight: 900;
    font-style: normal;}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #000000;
    color: #ffffff;
    overflow: hidden;
    width: 100vw;
    height: 100vh;}

.d-none { display: none !important; }
.d-block { display: block !important; }
.is-faded { opacity: 0.4 !important; }

.txt-white { color: #ffffff !important; }
.txt-gray { color: #aaaaaa !important; }
.txt-cyan { color: #00ffff !important; }
.txt-orange { color: #ff8c00 !important; }
.txt-magenta { color: #ff00ff !important; }
.txt-yellow { color: #ffff00 !important; }
.txt-green { color: #00ff00 !important; }
.txt-red { color: #ff4444 !important; }
.txt-bold { font-weight: bold !important; }
.txt-neutral { color: #cccccc !important; }

#app-container {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
    padding: 15px;
    width: 100vw;
    height: 100vh;
    background-color: #000000;}

.window {
    display: flex;
    flex-direction: column;
    background: #111111;
    border: 1px solid #333333;
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
    height: 100%;
    min-width: 0;}

.window.is-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    border-radius: 0;
    border: none;
    box-shadow: none;}

.window-header {
    flex: 0 0 41px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0d0d0d;
    padding: 10px 15px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #333333;
    height: 41px;
    position: relative;}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px; 
    margin-left: 12px;}

.menu-container {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
    padding: 10px 0;}

.window-title {
    font-size: 14px;
    font-weight: 600;
    color: #f0f0f0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);}

.fullscreen-mode-text {
    display: none;
    font-size: 14px;
    font-weight: 600;
    color: #f0f0f0;}

.window.is-fullscreen .fullscreen-mode-text { display: inline; }

.window-controls { display: flex; align-items: center; gap: 10px; }

.btn-menu {
    background: transparent;
    border: 1px solid #ffffff;
    border-radius: 4px;
    color: #ffffff;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    padding: 0 10px;
    margin-left: 8px; 
    line-height: 1;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;}

.btn-menu:hover { background: #222; opacity: 0.8; }

.btn-restore {
    display: none;
    background: transparent;
    border: 1px solid #CCCCCC;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    font-size: 10px;
    font-weight: bold;
    line-height: 1;
    padding: 4px 8px;
    transition: all 0.2s ease;}

.window.is-fullscreen .btn-restore,
.window.is-scanner-mode .btn-restore { display: block; }

.btn-restore:hover {
    background: #FFFFFF;
    color: #000000;
    box-shadow: 0 2px 8px rgba(36, 94, 219, 0.4);}

.menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; 
    background-color: rgba(10, 10, 10, 0.98);
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.8);
    padding: 0;
    min-width: 170px;
    border-radius: 6px;
    border: 1px solid #333;}

.menu-dropdown::before { content: ''; position: absolute; top: -20px; left: -20px; right: -20px; height: 20px; }
.menu-container:hover .menu-dropdown { display: block; }

.menu-divider { border-top: 1px solid #333; margin: 4px 0; }

.menu-item {
    padding: 10px 15px;
    margin: 4px 8px;
    background: #1a1a1a;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid #333;
    border-radius: 3px;
    color: #eee;
    transition: background 0.2s;}

.menu-item:hover { background: #222; }

.menu-item.active-item[data-display="curve"] { border-left: 3px solid #00ffff; }
.menu-item.active-item[data-display="scanner"] { border-left: 3px solid #ff00ff; }
.menu-item.active-item[data-mode="yield"] { border-left: 3px solid #00ff00; }
.menu-item.active-item[data-mode="price"] { border-left: 3px solid #ffb366; }

.menu-item.trigger-butterfly { border-left: 3px solid #009999; }
.menu-item.trigger-timetravel { border-left: 3px solid #cccc00; }
.menu-item.trigger-matrix { border-left: 3px solid #ff3333; }
.menu-item.trigger-volcurve { border-left: 3px solid #9900ff; }
.menu-item.trigger-export { border-left: 3px solid #28a745; }

.info-bubble {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 2px;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
    opacity: 1; 
    visibility: visible;
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    pointer-events: none;}

.info-bubble::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;}

.window.hide-tips .info-bubble,
.window-header:has(.menu-container:hover) .info-bubble,
.window.is-fullscreen .info-bubble {
    opacity: 0 !important;
    visibility: hidden !important;
    display: none;}

.window-body { flex: 1; display: flex; flex-direction: column; overflow: hidden; width: 100%; }

.chart-container { flex: 1; width: 100%; padding: 15px; position: relative; overflow: hidden; }
.chart-draw-area { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; }

.chart-logo {
    position: absolute;
    bottom: 12%; 
    right: 4%;
    font-family: ArialBlackCustom, Arial, sans-serif;
    font-size: 12px;
    color: #CCCCCC;
    pointer-events: none; 
    font-weight: bold;
    z-index: 100;}

.window.is-scanner-mode .chart-logo { bottom: 20%; right: 3%; display: block; }
.logo-matrix { bottom: 8%; right: 80%; }
.tool-overlay .logo-butterfly { bottom: 7%; right: 2%; }
.logo-timetravel, .logo-volcurve { bottom: 7%; right: 5%; }

.table-container {
    flex: none;
    width: 100%;
    border-top: 1px solid #333333;
    overflow-x: auto;
    overflow-y: auto;
    background-color: #000000;}

.window.is-scanner-mode .chart-container { flex: 0 0 280px; min-height: 280px; padding: 0; }
.window.is-scanner-mode .table-container { flex: 1; max-height: none; overflow-y: auto; }

.gauge-wrapper { display: flex; align-items: center; justify-content: space-between; font-size: 10px; color: #888; width: 120px; margin: 0 auto; }
.gauge-minmax { flex: 0 0 30px; text-align: center; }
.gauge-container { flex: 1; height: 10px; background: #222; border-radius: 5px; position: relative; margin: 0 6px; border: 1px solid #444; }
.gauge-bar { height: 100%; background: linear-gradient(90deg, #00bfff, #ff8c00); border-radius: 4px; width: 100%; opacity: 0.5; }
.gauge-marker { position: absolute; left: var(--gauge-left, 50%); top: -3px; bottom: -3px; width: 4px; background: #fff; border: 1px solid #000; border-radius: 2px; box-shadow: 0 0 4px rgba(255,255,255,0.8); transform: translateX(-50%); z-index: 5; }

svg { width: 100%; height: 100%; display: block; }
.scanner-chart-canvas { width: 100%; height: 100%; }
.grid-line { stroke: #2a2a2a; stroke-width: 1; }
.axis-text { fill: #ffffff; font-size: 10px; text-anchor: middle; }
.axis-text-y { text-anchor: end; }
.line-current { fill: none; stroke-width: 2; }
.line-previous { fill: none; stroke-width: 1.5; stroke-dasharray: 4 4; }

.chart-dot, .chart-dot-prev { stroke-width: 1.5; transition: all 0.15s ease; pointer-events: none; }
.chart-dot.is-hovered, .chart-dot-prev.is-hovered { r: 6px; fill: #111111 !important; stroke-width: 2px !important; }

.theme-tona .line-current { stroke: #ffff00; }
.theme-tona .line-previous { stroke: #ff3333; }
.theme-tona .chart-dot { fill: #ffff00; stroke: #1e1e1e; }
.theme-tona .chart-dot.is-hovered { stroke: #ffff00 !important; }
.theme-tona .chart-dot-prev { fill: #ff3333; stroke: #1e1e1e; }
.theme-tona .chart-dot-prev.is-hovered { stroke: #ff3333 !important; }
.theme-tona .date-current-label, .theme-tona .color-current { color: #ffff00; }
.theme-tona .color-previous { color: #ff3333; }
.theme-tona .info-bubble { background-color: #ffff00; color: #000; }
.theme-tona .info-bubble::before { border-color: transparent transparent #ffff00 transparent; }

.draggable-tooltip {
    position: absolute;
    top: var(--tooltip-top, 50px);
    left: var(--tooltip-left, 180px);
    background-color: rgba(0, 0, 0, 0.95);
    border: 1px solid #ffffff;
    border-radius: 6px;
    padding: 8px 15px;
    font-size: 12px;
    z-index: 500;
    cursor: move;
    box-shadow: 0 4px 20px rgba(0,0,0,1);
    pointer-events: auto;
    user-select: none;}

.tooltip-header { font-weight: bold; border-bottom: 1px solid #444444; padding-bottom: 4px; margin-bottom: 4px; color: #ffffff; }

.data-table {
    width: 100%;
    min-width: max-content; 
    border-collapse: collapse;
    font-size: 13px; 
    font-weight: 500;
    text-align: center;
    background-color: #000;
    color: #ccc;
    table-layout: auto;}

.data-table th, .data-table td { padding: 4px 6px; border: 1px solid #333; white-space: nowrap; }
.data-table th { background-color: #111; color: #fff; font-weight: bold; position: sticky; top: 0; border-bottom: 2px solid #444; cursor: pointer; user-select: none; z-index: 20; }
.cell-highlight { background-color: #333 !important; color: #fff !important; }
.data-table td.date-cell, .data-table th.date-cell { background: #000; font-weight: bold; border-right: 1px solid #444; text-align: center; vertical-align: middle; width: auto; }
.date-current-label { display: inline-block; text-align: center; font-size: 12px; font-weight: bold; margin: 0; padding: 4px 6px; }
.date-select { display: inline-block; background-color: transparent; border: none; padding: 4px 6px; margin: 0 auto; font-size: 12px; font-weight: bold; cursor: pointer; text-align: center; text-align-last: center; }

.scanner-top-bar { display: none; position: relative; align-items: center; padding: 10px 10px 0 10px; background-color: transparent; }
.window.is-scanner-mode .scanner-top-bar { display: flex; }
.scanner-chart-title { position: absolute; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: bold; color: #ccc; text-transform: uppercase; }
.scanner-controls-wrap { margin-left: auto; display: flex; gap: 4px; }

.scanner-btn, .tool-bot-btn {
    background: transparent;
    border: 1px solid #ffffff;
    color: #ffffff;
    font-size: 9px;
    padding: 3px 8px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px;}
	
.scanner-btn:hover, .tool-bot-btn:hover { background: #222; }
.scanner-btn.active, .tool-bot-btn.active { background: #ffffff; color: #000; font-weight: bold; }

.scanner-table {
    width: 100%;
    min-width: max-content;
    border-collapse: collapse;
    font-size: 13px; 
    font-weight: 500;
    text-align: center;
    background-color: #000;
    color: #ccc;
    table-layout: auto;}

.scanner-table th, .scanner-table td { padding: 6px 12px; border: 1px solid #333; white-space: nowrap; }
.scanner-table th { background-color: #111; color: #fff; font-weight: bold; position: sticky; top: 0; border-bottom: 2px solid #444; user-select: none; z-index: 20; }
.scanner-table th:first-child, .scanner-table td:first-child { background: #000; font-weight: bold; border-right: 1px solid #444; }
.scanner-table tr { cursor: default; }

.col-sticky, .cell-sticky { position: sticky; left: 0; }
.cell-sticky { background: #000; border-right: 1px solid #333; font-weight: bold; color: #ccc; cursor: pointer; z-index: 15; }

.alert-high { background-color: #ffb366; color: #000000; font-weight: bold; }
.alert-medium { background-color: #ffcccc; color: #cc0000; font-weight: bold; }
.alert-low { color: #ff8c00; font-weight: bold; }

.scanner-table td.alert-high .txt-gray,
.scanner-table td.alert-medium .txt-gray {
    color: #000000 !important;}

.help-tip { position: relative; cursor: help; border-bottom: 1px dotted #888; }
.help-tip:hover::after {
    content: attr(data-title);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 5px;
    background-color: rgba(0, 0, 0, 0.95);
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 12px; 
    font-weight: normal;
    white-space: nowrap;
    z-index: 999999;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.8);}

.scanner-mini-chart {
    position: fixed;
    top: var(--mc-top, 0px);
    left: var(--mc-left, 0px);
    width: 213px; 
    height: 133px; 
    background-color: rgba(0, 0, 0, 0.95);
    border: 1px solid #666;
    border-radius: 4px;
    padding: 5px;
    z-index: 10000;
    pointer-events: none;
    display: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.8);}

.scanner-mini-chart.visible { display: block; }
.mini-chart-inner { position: relative; height: calc(100% - 15px); width: 100%; }
.mini-chart-title { color: #ccc; font-size: 10px; text-align: center; margin-bottom: 2px; font-weight: bold; text-transform: uppercase; }

.vol-vals-container, .scan-vals-container { font-size: 13px; color: #e0e0e0; margin-bottom: 8px; }
.tt-header-text { font-size: 14px; font-weight: normal; color: #ffffff; }
.tt-header-val { font-size: 14px; color: #fc9936; font-weight: bold; }
.tt-body-text { font-size: 13px; }
.toggle-dataset, .toggle-tool-curve { cursor: pointer; user-select: none; }

.tool-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    color: #ffffff;}

.tool-header {
    flex: 0 0 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background-color: #111111;
    border-bottom: 1px solid #333333;}

.tool-header-left { display: flex; align-items: center; gap: 15px; }
.tool-title { font-size: 14px; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,0.5); color: #ffffff; }

.tool-select-group { display: flex; align-items: center; gap: 8px; background: #000; padding: 4px 10px; border-radius: 4px; border: 1px solid #333; }
.tool-select-label { font-size: 12px; color: #888; }
.tool-select { background: #111; color: #fff; border: 1px solid #444; border-radius: 3px; padding: 4px; font-size: 12px; font-weight: bold; outline: none; cursor: pointer; }

.tool-btn-close {
    background: linear-gradient(180deg, #d32f2f 0%, #b71c1c 100%);
    border: 1px solid #8e0000;
    border-radius: 4px;
    color: #ffffff;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    padding: 6px 12px;
    transition: all 0.2s ease;}
	
.tool-btn-close:hover { background: linear-gradient(180deg, #f44336 0%, #d32f2f 100%); }

.tool-body { flex: 1; display: flex; flex-direction: column; overflow: hidden; padding: 15px; gap: 15px; }
.tool-body-padded, .tool-body-dark { background: #080808; padding: 20px; }

.tool-charts-wrapper-flex {
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    position: relative; 
    min-height: 0; 
    border: 1px solid #333; 
    border-radius: 6px; 
    padding: 10px;}

.chart-inner-wrapper { flex: 1; position: relative; min-height: 0; width: 100%; }
.tool-chart-top { flex: 2; position: relative; min-height: 0; }
.tool-chart-bottom { flex: 1.8; position: relative; min-height: 0; border-top: 1px dashed #333; padding-top: 25px; }

.tool-bot-controls { position: absolute; top: 8px; right: 10px; display: flex; gap: 4px; z-index: 20; }

.tool-sync-line {
    position: absolute; top: 0; bottom: 0; width: 1px;
    background-color: transparent; border-left: 1px dashed rgba(255, 255, 255, 0.3);
    pointer-events: none; display: none; z-index: 10;
    left: var(--sync-left, 0px);}

.tool-table-container { flex: 0 0 18%; overflow-y: auto; border: 1px solid #333; border-radius: 6px; background: #000; }
.tool-table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: center; }
.tool-table th { background-color: #111; color: #fff; font-weight: bold; position: sticky; top: 0; padding: 8px; border-bottom: 2px solid #444; border-right: 1px solid #333; z-index: 5; }
.tool-table td { padding: 6px 8px; border: 1px solid #222; color: #ccc; white-space: nowrap; }
.tool-table tr:hover td { background-color: #1a1a1a; }

.tool-draggable-tooltip {
    position: absolute;
    top: var(--tool-tooltip-top, 20px); left: var(--tool-tooltip-left, 20px);
    background-color: rgba(0, 0, 0, 0.95);
    border: 1px solid #555; border-radius: 6px; padding: 10px 15px; font-size: 12px;
    z-index: 500; cursor: move; box-shadow: 0 4px 20px rgba(0,0,0,1);
    pointer-events: auto; user-select: none; display: block;}

.tool-tooltip-header { font-weight: bold; border-bottom: 1px solid #444; padding-bottom: 5px; margin-bottom: 5px; color: #fff; font-size: 13px; text-align: center; }
.tool-tooltip-row { display: flex; justify-content: space-between; margin-bottom: 4px; gap: 15px; }

.custom-legend {
    position: absolute; top: 25px; left: 50%; transform: translateX(-50%);
    display: flex; justify-content: center; align-items: center; gap: 25px;
    padding: 8px 15px; background: rgba(17, 17, 17, 0.85); border-radius: 6px;
    border: 1px solid #333; z-index: 100; backdrop-filter: blur(4px);}
	
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: #ddd; cursor: pointer; user-select: none; transition: opacity 0.2s; }
.legend-item:hover { opacity: 0.8; }
.legend-marker { width: 16px; height: 4px; border-radius: 2px; display: inline-block; }
.marker-today { background: #00ffff; }
.marker-1w { background: transparent; border-bottom: 3px dashed #ff8c00; }
.marker-1m { background: transparent; border-bottom: 3px dotted #ff00ff; }
.marker-max { background: #888888; }

.matrix-container {
    flex: 1;
    overflow: auto;
    background: #000;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 10px;
    display: block;}

.matrix-table {
    border-collapse: collapse;
    font-size: 12px;
    text-align: center;
    width: 100%;}

.matrix-table th, .matrix-table td {
    border: 1px solid #222;
    padding: 8px 12px;
    min-width: 60px;}

.matrix-table th { background-color: #111; color: #fff; position: sticky; z-index: 10; }
.matrix-table th.matrix-corner { background-color: #000; border: none; z-index: 20; }
.matrix-table th.col-header { top: 0; border-bottom: 2px solid #444; }
.matrix-table th.row-header { left: 0; border-right: 2px solid #444; }

.matrix-table td {
    color: #fff;
    font-weight: bold;
    transition: transform 0.1s;
    cursor: default;}

.matrix-table td:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(0,0,0,0.8);
    z-index: 5;
    position: relative;
    border: 1px solid #fff;}

.matrix-cell { background-color: var(--cell-bg, transparent); }
.matrix-empty { background-color: #000 !important; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #666; }

.custom-date-select-container { position: relative; display: inline-block; cursor: pointer; text-align: center; }
.custom-date-selected { padding: 4px 6px; font-size: 12px; font-weight: bold; color: #ff3333; display: flex; align-items: center; justify-content: center; gap: 6px; }
.custom-date-options { position: fixed; left: var(--date-dropdown-left, 0px); bottom: var(--date-dropdown-bottom, 0px); transform: translateX(-50%); z-index: 99999; background: #000; border: 1px solid #444; max-height: 250px; overflow-y: auto; min-width: 140px; padding: 4px 0; border-radius: 4px; box-shadow: 0 -4px 12px rgba(0,0,0,0.5); }
.custom-date-option { padding: 6px 20px; font-size: 12px; color: #fff; text-align: center; cursor: pointer; transition: background 0.2s; }
.custom-date-option:not(.txt-gray):hover { background: #222; }
.custom-date-option.txt-gray { color: #666 !important; cursor: default; }
.custom-date-selected span { font-size: 8px; position: relative; top: 1px; }

.menu-item.funding-view[data-funding-view="curve"] {
    border-left: 3px solid #00ffff;}

.menu-item.funding-view[data-funding-view="stress"] {
    border-left: 3px solid #ff3333;}

.menu-item.funding-view[data-funding-view="drivers"] {
    border-left: 3px solid #ffb366;}

.menu-item.funding-view[data-funding-view="dislocation"] {
    border-left: 3px solid #9900ff;}

.menu-item.funding-view[data-funding-view="timetravel"] {
    border-left: 3px solid #cccc00;}

.menu-item.trigger-funding-export {
    border-left: 3px solid #28a745;}
