/* ==========================================================================
   BACKTEST SIMULATOR COMPONENT STYLES (DARK MODE - BACKTEST.CSS)
   ========================================================================== */

/* --- CONTROLS & PANEL --- */
.backtest-controls {
    display: flex; 
    flex-wrap: wrap; 
    gap: 15px; 
    padding: 15px 20px; 
    background-color: var(--bg-header, #12161c); 
    border-bottom: 1px solid var(--border-color, #2b3139); 
    align-items: flex-end;
}

.input-group { 
    display: flex; 
    flex-direction: column; 
    gap: 5px; 
}

.input-group label { 
    font-size: 10px; 
    color: var(--text-muted, #787b86); 
    text-transform: uppercase; 
    font-weight: 600; 
}

.input-group input {
    background-color: var(--bg-main, #131722); 
    border: 1px solid var(--border-color, #2a2e39); 
    color: var(--text-primary, #d1d4dc);
    padding: 8px 12px; 
    border-radius: 4px; 
    font-size: 13px; 
    outline: none;
}

.input-group input:focus { 
    border-color: var(--color-yellow, #f0b90b); 
}

.btn-run {
    background-color: var(--color-yellow, #f0b90b); 
    color: #000000; 
    border: none; 
    padding: 9px 20px;
    border-radius: 4px; 
    font-weight: 700; 
    font-size: 13px; 
    cursor: pointer; 
    transition: 0.2s;
}

.btn-run:hover { 
    background-color: #d9a307; 
}

.btn-run:disabled {
    background-color: #2b3139 !important;
    color: var(--text-muted, #787b86) !important;
    cursor: not-allowed !important;
}

/* --- SLIDER ÐÒN B?Y BACKTEST --- */
.slim-slider-container {
    background: var(--bg-header, #12161c); 
    border: 1px solid var(--border-color, #2a2e39); 
    border-radius: 4px; 
    padding: 10px;
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    width: 220px; 
    flex-shrink: 0;
}

.slim-slider {
    -webkit-appearance: none; 
    width: 100%; 
    height: 3px;
    background: var(--border-color, #2a2e39); 
    border-radius: 2px; 
    outline: none; 
    transition: 0.2s;
}

.slim-slider::-webkit-slider-thumb {
    -webkit-appearance: none; 
    appearance: none;
    width: 14px; 
    height: 14px; 
    border-radius: 50%;
    background: var(--color-green, #0ecb81); 
    cursor: pointer;
    box-shadow: 0 0 6px rgba(14, 203, 129, 0.4);
}

.slim-slider:disabled::-webkit-slider-thumb {
    background: #474f59; 
    box-shadow: none; 
    cursor: not-allowed;
}

.slider-ticks {
    display: flex; 
    justify-content: space-between; 
    padding: 0 4px;
    font-size: 9px; 
    color: var(--text-muted, #787b86); 
    font-weight: 600; 
    margin-top: 2px;
}

.slider-ticks span { 
    cursor: pointer; 
}

.slider-ticks span:hover { 
    color: var(--text-primary, #ffffff); 
}

/* --- LOG TABLE & GRID --- */
.log-grid { 
    display: grid; 
    grid-template-columns: 1.2fr 0.8fr 1fr 1fr 1fr 1fr 3fr; 
    width: 100%; 
}

.log-table-container {
    max-height: 55vh; 
    overflow-y: auto;
    border-bottom: 1px solid var(--border-color, #2a2e39);
}

.log-table-container::-webkit-scrollbar { 
    width: 6px; 
}

.log-table-container::-webkit-scrollbar-track { 
    background: var(--bg-panel, #1e222d); 
}

.log-table-container::-webkit-scrollbar-thumb { 
    background: #2b3139; 
    border-radius: 3px; 
}

.log-table-container::-webkit-scrollbar-thumb:hover { 
    background: #474f59; 
}

.log-reason { 
    font-size: 11px; 
    color: var(--text-primary, #ffffff); 
    white-space: pre-wrap !important; 
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    line-height: 1.45;
    background: rgba(0, 0, 0, 0.3) !important;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--color-yellow, #f0b90b);
    margin-top: 4px;
    margin-bottom: 8px;
    width: 100%;
    word-break: break-word;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

/* --- BADGES --- */
.badge { 
    padding: 2px 6px; 
    border-radius: 3px; 
    font-size: 10px; 
    font-weight: 700; 
    display: inline-block; 
}

.badge.new { background: rgba(255, 208, 67, 0.15); color: var(--color-yellow, #f0b90b); }
.badge.filled { background: rgba(14, 203, 129, 0.15); color: var(--color-green, #0ecb81); box-shadow: 0 0 8px rgba(14, 203, 129, 0.3); }
.badge.canceled { background: rgba(255, 101, 117, 0.15); color: var(--color-red, #f6465d); box-shadow: 0 0 8px rgba(255, 101, 117, 0.3); }
.badge.success { background: rgba(14, 203, 129, 0.15); color: var(--color-green, #0ecb81); border: 1px solid rgba(14, 203, 129, 0.3); box-shadow: 0 0 8px rgba(14, 203, 129, 0.3); }
.badge.failed { background: rgba(255, 101, 117, 0.15); color: var(--color-red, #f6465d); border: 1px solid rgba(255, 101, 117, 0.3); box-shadow: 0 0 8px rgba(255, 101, 117, 0.3); }
.badge.warning { background: rgba(255, 208, 67, 0.15); color: var(--color-yellow, #f0b90b); border: 1px solid rgba(255, 208, 67, 0.3); box-shadow: 0 0 8px rgba(255, 208, 67, 0.3); }
.badge.skipped { background: rgba(120, 123, 134, 0.15); color: var(--text-muted, #787b86); border: 1px solid rgba(120, 123, 134, 0.3); }

/* --- CHECKPOINT & FUNDING CYCLE CARDS --- */
.checkpoint-report-card {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    background: #12161c;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #2b3139;
    text-align: left;
    margin-bottom: 15px;
}

.checkpoint-item { display: flex; flex-direction: column; gap: 2px; }
.checkpoint-label { font-size: 10px; color: var(--text-muted, #787b86); text-transform: uppercase; font-weight: 600; }
.checkpoint-val { font-size: 13px; font-weight: 700; color: #ffffff; }

.funding-card-block {
    background: rgba(19, 23, 34, 0.6) !important;
    backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
}

.funding-card-header {
    background: rgba(0, 0, 0, 0.3) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.fch-left { display: flex; align-items: center; gap: 12px; }
.fch-time { color: var(--color-yellow, #f0b90b); font-family: monospace; font-weight: bold; font-size: 13px; }
.fch-symbol { background: rgba(255, 208, 67, 0.15); color: var(--color-yellow, #f0b90b); border: 1px solid rgba(255, 208, 67, 0.3); padding: 2px 8px; border-radius: 4px; font-weight: 800; font-size: 12px; }
.fch-right { display: flex; align-items: center; gap: 16px; font-size: 12px; font-variant-numeric: tabular-nums; }
.fch-info-item { display: flex; align-items: center; gap: 6px; color: var(--text-muted, #787b86); }
.fch-info-item strong { color: #ffffff; }

.funding-card-body {
    display: flex !important;
    flex-direction: row !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
}

.fc-left-panel, .fc-right-panel {
    flex: 1 1 50% !important;
    min-width: 0 !important;
    max-width: 50% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}
