/* --- (v26.0) DANSO UNIFIED DASHBOARD: Premium Apple Metallic Theme --- */

/* 1. Font Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
    /* --- Palette: MacBook Silver & Matte Black --- */
    
    /* Background: Brushed Aluminum Feel */
    --metal-body-bg: #F2F2F7; 
    --metal-texture: repeating-linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.015) 0px,
        rgba(0, 0, 0, 0.015) 1px,
        transparent 1px,
        transparent 4px
    );
    
    /* Surfaces: Glass & Keycap Style */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(0, 0, 0, 0.06);
    --keycap-bg: #1C1C1E; /* Matte Black Keycap */
    --keycap-border: rgba(255, 255, 255, 0.1);
    
    /* Text: High Contrast Matte */
    --text-primary: #1D1D1F; /* Deep Black */
    --text-secondary: #6E6E73; /* Cool Gray */
    --text-tertiary: #AEAEB2;
    --text-inverse: #F5F5F7; /* White text on dark keycaps */

    /* Accents: Subtle Apple Colors */
    --accent-green: #34C759; 
    --accent-red: #FF3B30;
    --accent-blue: #007AFF;
    
    /* Legacy Neon Mappings (remapped to soft premium colors) */
    --neon-green: var(--accent-green);
    --neon-green-dark: #248A3D;
    --neon-red: var(--accent-red);
    --neon-blue: var(--accent-blue);
    --neon-cyan: #0071E3;

    /* UI Components */
    --radius-main: 20px;
    --radius-sub: 12px;
    --radius-full: 99px;
    --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow-keycap: 0 4px 12px rgba(0, 0, 0, 0.3);

    /* Fonts */
    --font-primary: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* --- 1. Global Reset & Layout --- */
body {
    font-family: var(--font-primary);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--metal-body-bg);
    /* Brushed Aluminum Texture + Spotlight */
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 1.0) 0%, transparent 70%),
        var(--metal-texture);
    background-attachment: fixed;
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

#heroCanvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; opacity: 0.15; mix-blend-mode: multiply;
    pointer-events: none;
}

.content-wrapper { position: relative; z-index: 10; min-height: 100vh; }

.main-container { max-width: 1000px; margin: 0 auto; padding: 40px 24px; }
.main-container.full-width { max-width: 1440px; padding: 20px; }

/* --- 2. Layout Grid (Unified Dashboard) --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 380px 1fr; /* Fixed Left Sidebar / Flexible Right Main */
    gap: 24px;
    align-items: start;
}
.left-col { width: 100%; }
.right-col { width: 100%; }

/* STS Sub Grid (Right Panel Split) */
.sts-sub-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px;
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .sts-sub-grid { grid-template-columns: 1fr; }
}

/* --- 3. Premium Glass Components --- */
.glass-card, 
.status-card, 
.community-section, 
.settings-card, 
.engine-panel,
.modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-main);
    box-shadow: var(--shadow-card);
    padding: 24px;
    color: var(--text-primary);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.glass-card:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(0,0,0,0.1); }

.card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; padding-bottom: 12px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.card-header h3 {
    margin: 0; font-size: 14px; font-weight: 700; 
    color: var(--text-primary); text-transform: uppercase; letter-spacing: 0.5px;
    display: flex; align-items: center; gap: 8px;
}
.card-header h3 i { color: var(--text-secondary); font-size: 16px; }

/* Live Indicator Dot */
.live-indicator {
    font-size: 11px; font-weight: 600; color: var(--text-secondary);
    display: flex; align-items: center; gap: 6px; text-transform: uppercase;
}
.dot { width: 6px; height: 6px; background: var(--accent-green); border-radius: 50%; }
.blink { animation: blinker 2s infinite; }
@keyframes blinker { 50% { opacity: 0.4; } }

/* --- 4. Header & Navigation --- */
.sts-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; padding-bottom: 16px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.brand-logo { 
    display: flex; align-items: center; gap: 8px;
    font-size: 18px; font-weight: 800; color: #111; letter-spacing: -0.5px; 
}
.brand-logo span { color: var(--accent-green); font-weight: 600; font-size: 14px; margin-top: 2px; letter-spacing: 1px; }

.system-status { display: flex; gap: 24px; font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.status-item { display: flex; align-items: center; gap: 6px; }

/* User Buttons (Keycap Style) */
.user-actions { display: flex; align-items: center; }

.notification-button, .nav-button {
    background: #FFFFFF;
    color: var(--text-primary);
    padding: 8px 20px; 
    border: 1px solid rgba(0,0,0,0.1); 
    border-radius: var(--radius-full);
    font-family: var(--font-primary);
    font-weight: 600; font-size: 13px; 
    cursor: pointer; transition: all 0.2s ease;
    display: inline-flex; align-items: center; gap: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    text-decoration: none;
}
.notification-button:hover, .nav-button:hover {
    background: #F5F5F7; transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}
.notification-button i { color: var(--accent-green); }

/* --- 5. Top Scrolling Ticker --- */
.scrolling-bar-container {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-radius: 12px; padding: 10px 0;
    overflow: hidden; white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.4);
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}
.scrolling-bar-track { display: inline-block; animation: scroll-left 60s linear infinite; }
@keyframes scroll-left { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

.scroll-item { 
    display: inline-block; padding: 0 16px; 
    font-size: 13px; font-family: var(--font-mono); 
    border-right: 1px solid rgba(0,0,0,0.05);
}
.scroll-item .name { font-weight: 600; color: var(--text-primary); margin-right: 6px; }
.scroll-item .value { color: var(--text-secondary); margin-right: 6px; }
.scroll-item .change-positive { color: var(--accent-green); font-weight: 600; }
.scroll-item .change-negative { color: var(--accent-red); font-weight: 600; }
.scroll-item .change-zero { color: var(--text-tertiary); }

/* --- 6. Scanner Feed (Left Column) --- */
.feed-scroll { max-height: 400px; overflow-y: auto; padding-right: 4px; }

/* Signal Cards */
.signal-card {
    background: #FFFFFF;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 12px; padding: 16px; margin-bottom: 12px;
    cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; gap: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.signal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.06);
    border-color: rgba(0,0,0,0.1);
}
.signal-icon-wrapper {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(52, 199, 89, 0.1); color: var(--accent-green);
}
.info .info-header { 
    display: flex; justify-content: space-between; 
    font-family: var(--font-mono); font-weight: 700; font-size: 15px; 
    color: var(--text-primary);
}
.option-label { 
    font-size: 10px; background: #1C1C1E; color: #fff; 
    padding: 2px 6px; border-radius: 4px; 
    font-weight: 600; letter-spacing: 0.5px;
}
.signal-details { 
    font-size: 13px; color: var(--text-secondary); 
    display: flex; justify-content: space-between; margin-top: 4px; 
}
.ai-score { color: var(--accent-green); font-weight: 600; display: flex; align-items: center; gap: 4px; }

/* Watchlist Tags */
.ticker-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ticker-list span {
    background: #FFFFFF;
    border: 1px solid rgba(0,0,0,0.08);
    padding: 6px 12px; border-radius: 8px;
    font-size: 12px; font-weight: 600; font-family: var(--font-mono);
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    cursor: pointer; transition: 0.2s;
}
.ticker-list span:hover { transform: translateY(-1px); border-color: var(--accent-green); }
.ticker-list span.new-ticker { border-color: var(--accent-green); color: var(--accent-green); background: rgba(52, 199, 89, 0.05); }

/* Status Header */
.status-header { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-secondary); border-bottom: 1px solid rgba(0,0,0,0.05); padding-bottom: 12px; margin-bottom: 12px; }
#scan-status-text { color: var(--accent-green); font-weight: 600; }

/* Settings & Community */
.settings-body .description { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
.control-group { display: flex; align-items: center; gap: 12px; }
#min-score-input {
    background: #fff; border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px; padding: 10px; width: 60px; text-align: center;
    font-weight: 700; font-size: 16px; font-family: var(--font-mono);
}
#save-score-btn, #post-submit-btn {
    background: var(--keycap-bg); color: #fff;
    border: none; border-radius: 8px; padding: 10px 20px;
    font-weight: 600; font-size: 13px; cursor: pointer;
    box-shadow: var(--shadow-keycap); transition: 0.2s;
}
#save-score-btn:hover, #post-submit-btn:hover { transform: translateY(-1px); background: #000; }

#post-form input, #post-form textarea {
    width: 100%; background: #fff; border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px; padding: 12px; margin-bottom: 10px;
    font-family: var(--font-primary); font-size: 14px;
}
.post-card {
    background: #fff; border: 1px solid rgba(0,0,0,0.05); border-radius: 12px;
    padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.post-card-header .author { font-weight: 700; color: var(--text-primary); }
.post-card-header .time { font-size: 11px; color: var(--text-tertiary); float: right; }
.post-card-content { font-size: 14px; color: var(--text-secondary); margin-top: 6px; line-height: 1.5; }

/* --- 7. STS Sniper Console (Right Column) --- */

/* Top Targets Table */
.table-wrapper { overflow-x: auto; }
.sts-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sts-table th {
    text-align: left; font-weight: 600; color: var(--text-tertiary);
    padding: 12px 16px; border-bottom: 1px solid rgba(0,0,0,0.06);
    text-transform: uppercase; letter-spacing: 0.5px; font-size: 11px;
}
.sts-table td {
    padding: 14px 16px; border-bottom: 1px solid rgba(0,0,0,0.03);
    color: var(--text-primary); vertical-align: middle; font-weight: 500;
}

/* Table Badges */
.ticker-badge {
    background: #fff; border: 1px solid rgba(0,0,0,0.1);
    padding: 4px 8px; border-radius: 6px;
    font-family: var(--font-mono); font-weight: 700; font-size: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.status-badge {
    padding: 4px 8px; border-radius: 99px;
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.status-badge.aiming {
    background: rgba(52, 199, 89, 0.1); color: var(--accent-green);
    border: 1px solid rgba(52, 199, 89, 0.2);
}
.status-badge.watching {
    background: rgba(0,0,0,0.03); color: var(--text-tertiary);
    border: 1px solid rgba(0,0,0,0.06);
}

/* Micro Panel (Keycap Style Dark Panels) */
.micro-row { display: flex; justify-content: space-between; margin-bottom: 14px; font-size: 13px; color: var(--text-secondary); }
.micro-item { 
    display: flex; justify-content: space-between; 
    border-top: 1px solid rgba(0,0,0,0.06); 
    padding-top: 14px; margin-top: 8px; font-size: 13px; color: var(--text-secondary); 
}

/* Mini Progress Bars */
.mini-bar { width: 60px; height: 4px; background: rgba(0,0,0,0.06); border-radius: 2px; overflow: hidden; }
.mini-bar div { height: 100%; background: var(--accent-green); opacity: 0.9; }

.progress-wrapper { width: 60%; text-align: right; }
.val-text { font-size: 13px; font-weight: 700; display: block; margin-bottom: 6px; color: var(--text-primary); }
.progress-bg { height: 4px; background: rgba(0,0,0,0.06); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent-green); transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.progress-fill.warn { background: var(--accent-red); }

/* Risk Engine Grid */
.risk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.risk-item {
    background: rgba(255,255,255,0.5); 
    padding: 16px; border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.04);
    display: flex; flex-direction: column; gap: 6px;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.8);
}
.risk-item .label { font-size: 10px; color: var(--text-tertiary); font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }
.risk-item .value { font-size: 16px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.5px; }
.risk-item.highlight { 
    background: rgba(52, 199, 89, 0.05); 
    border-color: rgba(52, 199, 89, 0.2);
}

/* Heatmap Area (Dark Keycap Style) */
.heatmap-grid { display: flex; gap: 10px; }
.heat-block {
    flex: 1; padding: 16px 0; text-align: center;
    border-radius: 8px; font-weight: 600; font-size: 12px;
    transition: transform 0.2s;
}
.heat-block.hot { 
    background: var(--keycap-bg); color: #fff; /* Inverted for contrast */
    box-shadow: var(--shadow-keycap);
}
.heat-block.warm { background: rgba(0,0,0,0.08); color: var(--text-primary); }
.heat-block.cool { background: rgba(0,0,0,0.03); color: var(--text-tertiary); }

/* Session Stats */
.stat-flex { display: flex; gap: 16px; margin-bottom: 24px; }
.stat-box { 
    flex: 1; text-align: center; 
    background: #fff; padding: 20px; border-radius: 12px; 
    border: 1px solid rgba(0,0,0,0.05); box-shadow: 0 2px 8px rgba(0,0,0,0.03); 
}
.stat-box .val { font-size: 24px; font-weight: 800; color: var(--text-primary); margin-top: 6px; letter-spacing: -1px; }

/* --- 8. Chart Modal (Unified) --- */
.modal-overlay {
    display: none; position: fixed; z-index: 2000;
    left: 0; top: 0; width: 100%; height: 100%; overflow: auto;
    background-color: rgba(0, 0, 0, 0.3); /* Dimmed */
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.modal-content {
    background: #fff; width: 90%; max-width: 720px; margin: 5% auto;
    border-radius: 20px; overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.2);
    animation: modalUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.modal-header {
    padding: 20px 24px; background: #F9F9F9; border-bottom: 1px solid rgba(0,0,0,0.06);
    display: flex; justify-content: space-between; align-items: center;
}
.modal-header h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--text-primary); }
.close-button { font-size: 28px; color: var(--text-tertiary); cursor: pointer; line-height: 1; }
.close-button:hover { color: var(--text-primary); }

.modal-tabs { display: flex; padding: 0 24px; background: #fff; border-bottom: 1px solid rgba(0,0,0,0.06); }
.tab-button {
    background: transparent; border: none; color: var(--text-secondary);
    padding: 16px 20px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: 0.2s; border-bottom: 2px solid transparent;
}
.tab-button.active { color: var(--text-primary); border-bottom-color: #111; }

.modal-body { padding: 24px; min-height: 300px; }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.2s; }

/* Utility Colors */
.text-green { color: var(--accent-green); font-weight: 600; }
.text-dim { color: var(--text-tertiary); font-size: 11px; font-weight: 500; }
.text-warn { color: var(--accent-red); }
.text-highlight { color: var(--text-primary); font-weight: 700; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }

/* Chart Container */
#chart-container { width: 100%; height: 350px; position: relative; }