
/* 
================================================================================
   FOKUS PRO // STATS MODULE v4.0 (Redesigned)
   - 2-Column Overview Cards
   - Chart Controls
   - SVG Chart Styling
================================================================================ 
*/

:root {
    --st-bg-dark: #02040a;
    --st-bg-panel: #0d1628; /* Solid Fallback */
    --st-bg-panel-glass: rgba(13, 22, 40, 0.9);
    
    --st-lvl-1: #10b981; 
    --st-lvl-2: #f59e0b; 
    --st-lvl-3: #ec4899;
    
    --st-font-mono: 'JetBrains Mono', monospace;
}

/* --- SCROLL LOCKING --- */
body.modal-open-lock {
    overflow: hidden !important;
    position: fixed; /* Hard Lock */
    width: 100%;
}

/* --- MAIN CONTAINERS --- */
.stats-section-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0; margin: 20px 0 15px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.ssh-title {
    font-size: 0.8rem; font-weight: 800; letter-spacing: 1px; color: #94a3b8;
    display: flex; align-items: center; gap: 8px;
}
.ssh-title i { color: var(--st-lvl-1); }
.ssh-decor { width: 40px; height: 3px; background: rgba(255,255,255,0.1); border-radius: 2px; }

/* REMOVED FILTER BAR STYLES (Performance Scope deleted) */

/* --- LEVEL CARDS --- */
.level-stats-grid { display: flex; flex-direction: column; gap: 15px; }

.level-stat-card {
    background: var(--st-bg-panel); /* Solid color to ensure visibility */
    background: linear-gradient(145deg, rgba(13, 22, 40, 0.95) 0%, rgba(5, 10, 20, 0.95) 100%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px; padding: 20px;
    position: relative; overflow: hidden;
    cursor: pointer; transition: transform 0.2s;
    min-height: 120px; display: flex; flex-direction: column;
}
.level-stat-card:active { transform: scale(0.98); }

.lsc-glow {
    position: absolute; top: -50px; right: -50px; width: 150px; height: 150px;
    border-radius: 50%; filter: blur(50px); opacity: 0.15; pointer-events: none;
}
.lvl-1 .lsc-glow { background: var(--st-lvl-1); }
.lvl-2 .lsc-glow { background: var(--st-lvl-2); }
.lvl-3 .lsc-glow { background: var(--st-lvl-3); }

.lsc-content { display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 2; margin-bottom: 15px; }
.lsc-info { display: flex; flex-direction: column; gap: 5px; }

.lsc-badge { 
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; 
    border-radius: 4px; background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.1); 
}
.lsc-badge-dot { width: 8px; height: 8px; border-radius: 50%; }
.lvl-1 .lsc-badge-dot { background: var(--st-lvl-1); box-shadow: 0 0 5px var(--st-lvl-1); }
.lvl-2 .lsc-badge-dot { background: var(--st-lvl-2); box-shadow: 0 0 5px var(--st-lvl-2); }
.lvl-3 .lsc-badge-dot { background: var(--st-lvl-3); box-shadow: 0 0 5px var(--st-lvl-3); }

.lsc-badge-text { font-family: var(--st-font-mono); font-size: 0.7rem; font-weight: 700; color: white; }
.lsc-label { font-size: 0.7rem; color: #94a3b8; margin-top: 2px; }

.lsc-value-block { text-align: right; }
.lsc-value { font-family: var(--st-font-mono); font-size: 1.8rem; font-weight: 800; color: white; line-height: 1; }
.lsc-unit { font-size: 0.6rem; color: #64748b; display: block; font-weight: 700; letter-spacing: 1px; margin-top: 4px; }

.lsc-footer {
    display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid rgba(255,255,255,0.05); padding-top: 10px;
    font-size: 0.7rem; color: #94a3b8; font-weight: 600;
}

/* --- MODALS (FIXED & ROBUST) --- */
.st-modal-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: flex-end; /* Mobile Bottom Sheet */
    justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
    touch-action: none; /* Prevent scroll on backdrop */
}
.st-modal-overlay.active { opacity: 1; pointer-events: auto; }

.st-modal-card {
    background: #0b1120;
    width: 100%; max-width: 600px;
    height: 80vh; 
    border-radius: 20px 20px 0 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.8);
    display: flex; flex-direction: column;
    transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.st-modal-overlay.active .st-modal-card { transform: translateY(0); }

.st-modal-header {
    padding: 15px 20px; border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(255,255,255,0.02);
}
.st-mh-title-group { display: flex; flex-direction: column; }
.st-mh-super { font-size: 0.6rem; letter-spacing: 1px; font-weight: 800; color: var(--st-lvl-1); text-transform: uppercase; }
.st-mh-title { font-size: 1.1rem; color: white; font-weight: 800; }

.st-btn-close {
    width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05); color: white; display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}

.st-modal-body {
    flex: 1; overflow-y: auto; padding: 0; background: #02040a;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

/* Empty State */
.st-empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 60px 20px; text-align: center; height: 100%;
    color: var(--c-text-dim);
}
.st-empty-icon { font-size: 3rem; margin-bottom: 20px; opacity: 0.3; }
.st-empty-text { font-family: var(--st-font-mono); font-size: 0.8rem; }


/* --- NEW: SUMMARY CARD IN REPORT --- */
.st-summary-container {
    padding: 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.st-summary-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 15px;
}
.st-summary-box {
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; padding: 15px; display: flex; flex-direction: column;
    align-items: center; text-align: center;
}
.st-sum-label { font-size: 0.65rem; color: #64748b; font-weight: 700; letter-spacing: 1px; margin-bottom: 5px; }
.st-sum-val { font-family: var(--st-font-mono); font-size: 1.4rem; font-weight: 800; color: white; }
.st-sum-sub { font-size: 0.6rem; color: #475569; margin-top: 2px; }

/* Large Gauge Area */
.st-gauge-box {
    grid-column: 1 / -1; 
    display: flex; align-items: center; justify-content: space-between;
    padding: 15px 20px;
    background: rgba(16, 185, 129, 0.05); border: 1px solid rgba(16, 185, 129, 0.15);
}
.st-gauge-left { display: flex; flex-direction: column; }
.st-gauge-title { font-size: 0.75rem; color: var(--st-lvl-1); font-weight: 800; letter-spacing: 1px; }
.st-gauge-big { font-size: 2rem; font-weight: 800; color: white; font-family: var(--st-font-mono); line-height: 1; margin-top: 5px; }
.st-gauge-icon { font-size: 2rem; color: var(--st-lvl-1); opacity: 0.8; }


/* --- NEW: DRILL LIST ITEMS (DATA CHIPS) --- */
.st-drill-list {
    display: flex; flex-direction: column; gap: 12px; padding: 20px;
}

.st-drill-item {
    display: grid; grid-template-columns: auto 1fr auto 20px; gap: 15px; align-items: center;
    padding: 15px; 
    background: rgba(255,255,255,0.02); 
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    cursor: pointer; transition: all 0.2s;
    position: relative; overflow: hidden;
}
.st-drill-item:active { transform: scale(0.98); background: rgba(255,255,255,0.05); }

/* Left Border Indicator */
.st-drill-item::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--c-text-dim); transition: 0.3s;
}
.st-drill-item:hover::before { background: var(--st-lvl-1); }

.st-di-rank {
    font-family: var(--st-font-mono); font-size: 0.9rem; color: #475569; font-weight: 700;
    width: 30px; text-align: center;
}
.st-di-info { display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.st-di-title { font-size: 0.9rem; font-weight: 700; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-di-meta { font-size: 0.65rem; color: #64748b; font-family: var(--st-font-mono); display: flex; gap: 8px; }

.st-di-val-group { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 60px; }
.st-di-val { font-family: var(--st-font-mono); font-size: 1.1rem; font-weight: 800; color: white; }
.st-di-bar-bg { width: 100%; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; }
.st-di-bar-fill { height: 100%; background: var(--st-lvl-1); border-radius: 2px; }

.st-di-arrow { color: #334155; font-size: 0.9rem; }
.st-drill-item:hover .st-di-arrow { color: white; transform: translateX(3px); }


/* --- TIMELINE HISTORY --- */
.st-history-wrapper { padding: 25px 20px; }

/* CHART CONTROLS */
.chart-controls-row {
    display: flex; gap: 10px; padding: 20px 20px 0 20px; overflow-x: auto;
}
.chart-filter-btn {
    flex: 1; background: transparent; border: 1px solid rgba(255,255,255,0.1);
    color: var(--c-text-sec); padding: 8px; border-radius: 20px; font-size: 0.7rem;
    font-weight: 700; cursor: pointer; white-space: nowrap;
}
.chart-filter-btn.active { background: var(--st-lvl-1); color: #000; border-color: var(--st-lvl-1); }

/* SVG CHART CONTAINER */
.st-chart-container {
    height: 180px; padding: 20px; margin-bottom: 10px;
    width: 100%; box-sizing: border-box;
}

/* CHART LABELS */
.chart-axis-label {
    fill: #64748b; font-family: var(--st-font-mono); font-size: 10px; font-weight: 600;
}
.chart-point-label {
    fill: white; font-family: var(--st-font-mono); font-size: 10px; font-weight: 700;
    text-shadow: 0 1px 2px black;
}

/* LINES */
.chart-target-line {
    stroke: #10b981; stroke-width: 1.5; stroke-dasharray: 5 3;
}
.chart-target-label {
    fill: #10b981; font-family: var(--st-font-mono); font-size: 9px; font-weight: 800;
}

.chart-best-line {
    stroke: #f59e0b; stroke-width: 1.5; /* Solid gold line */
}
.chart-best-label {
    fill: #f59e0b; font-family: var(--st-font-mono); font-size: 9px; font-weight: 800;
}

.st-trend-info {
    text-align: center; font-size: 0.9rem; font-weight: 700; 
    font-family: var(--st-font-mono); margin-bottom: 20px;
    padding: 10px; background: rgba(255,255,255,0.03); border-top: 1px solid rgba(255,255,255,0.05); border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* TIMELINE */
.st-tl-item {
    display: flex; gap: 15px; position: relative; padding-bottom: 30px;
}
.st-tl-item::before {
    content: ''; position: absolute; left: 6px; top: 15px; bottom: 0; width: 2px;
    background: rgba(255,255,255,0.1); z-index: 0;
}
.st-tl-item:last-child::before { display: none; }

.st-tl-dot {
    width: 14px; height: 14px; border-radius: 50%; background: #02040a;
    border: 2px solid #64748b; position: relative; z-index: 1; margin-top: 5px; flex-shrink: 0;
}
.st-tl-item:first-child .st-tl-dot { border-color: var(--st-lvl-1); background: var(--st-lvl-1); box-shadow: 0 0 10px var(--st-lvl-1); }

.st-tl-card {
    flex: 1; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; padding: 15px; position: relative;
}
.st-tl-card::after {
    content: ''; position: absolute; left: -6px; top: 10px; width: 10px; height: 10px;
    background: #1e2532; transform: rotate(45deg); border-left: 1px solid rgba(255,255,255,0.08); border-bottom: 1px solid rgba(255,255,255,0.08);
}

.st-tl-date { font-family: var(--st-font-mono); font-size: 0.7rem; color: #94a3b8; display: block; margin-bottom: 5px; }
.st-tl-res-row { display: flex; justify-content: space-between; align-items: flex-end; }
.st-tl-score { font-size: 1.4rem; font-weight: 800; color: white; font-family: var(--st-font-mono); }
.st-tl-visual { width: 60px; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; margin-bottom: 6px; }
.st-tl-fill { height: 100%; background: var(--st-lvl-1); }

/* --- DAILY REPORT MODAL SPECIFIC (NEW) --- */
.st-report-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 25px;
}
.st-rep-box {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05);
    padding: 15px; border-radius: 12px; display: flex; flex-direction: column;
}
.st-rep-lbl { font-size: 0.65rem; color: #64748b; letter-spacing: 1px; font-weight: 700; margin-bottom: 5px; }
.st-rep-val { font-family: var(--st-font-mono); font-size: 1.2rem; font-weight: 800; color: white; }
.st-rep-sub { font-size: 0.7rem; color: #475569; }

.st-rep-list-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 15px; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.st-rep-ex-name { font-weight: 700; font-size: 0.85rem; color: #e2e8f0; }
.st-rep-ex-res { font-family: var(--st-font-mono); font-size: 0.85rem; color: var(--st-lvl-1); }

.chart-col { cursor: pointer; transition: transform 0.2s; }
.chart-col:hover { transform: translateY(-5px); }

/* --- DESKTOP --- */
@media (min-width: 768px) {
    .st-modal-overlay { align-items: center; }
    .st-modal-card { height: 70vh; border-radius: 16px; border: 1px solid rgba(255,255,255,0.1); }
    .level-stats-grid { flex-direction: row; }
    .level-stat-card { flex: 1; }
}
