/* ========================================= */
/* QUANTLOOM DASHBOARD CSS (home.css)        */
/* ========================================= */

:root {
    /* Deep Void Background */
    --bg-dark: #02060f; 
    
    /* Neon HUD Accents */
    --neon-cyan: #00E5FF;
    --neon-pink: #FF007F;
    --neon-green: #00FF9D;
    
    /* Glass & Grids */
    --glass-panel: rgba(5, 12, 25, 0.6);
    --glass-card: rgba(10, 18, 35, 0.5);
    --card-bg: #1e293b;
    --border: #334155;
    --grid-line: rgba(0, 229, 255, 0.05);
    --border-glow: rgba(0, 229, 255, 0.2);
    
    /* Text */
    --text-main: #FFFFFF;
    --text-muted: #8E9BAE;
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }

/* --- THE CYBER-GRID BACKGROUND --- */
body, html { 
    height: 100%; 
    margin: 0; 
    background-color: var(--bg-dark); 
    background-image: 
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
        radial-gradient(ellipse at 50% 0%, rgba(0, 229, 255, 0.15), transparent 70%);
    background-size: 35px 35px, 35px 35px, 100% 100%;
    background-attachment: fixed;
    color: var(--text-main); 
    font-family: 'Inter', sans-serif; 
    overflow-x: hidden; 
}

/* --- MAIN LAYOUT & PANELS --- */
.main-wrapper { 
    display: grid; 
    grid-template-columns: 280px 1fr 280px; 
    height: calc(100vh - 105px); 
    gap: 15px; 
    padding: 15px;
}

.ticker-sidebar, .side-panel.right, .content-panel { 
    background: var(--glass-panel); 
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-glow); 
    border-radius: 8px; 
    overflow-y: auto; 
    box-shadow: inset 0 0 20px rgba(0, 229, 255, 0.02);
}
.ticker-sidebar { padding: 0; }
.content-panel { padding: 25px; }

/* --- SIDEBAR & ACCORDION --- */
.sidebar-header { 
    padding: 15px 20px; 
    font-size: 0.75rem; 
    text-transform: uppercase; 
    letter-spacing: 2px; 
    color: var(--neon-cyan); 
    font-weight: 800; 
    border-bottom: 1px solid var(--border-glow); 
    background: rgba(0, 229, 255, 0.05);
    width: 100%; 
    box-sizing: border-box; 
    margin: 0;
}
/* Fix for flat lists like Crypto in the sidebar */
.acc-content > a { 
    display: block; 
    padding: 12px 25px; 
    color: var(--text-muted); 
    text-decoration: none; 
    font-size: 0.85rem; 
    border-left: 2px solid transparent;
    transition: all 0.2s;
}

.acc-content > a:hover { 
    color: var(--neon-cyan); 
    border-left: 2px solid var(--neon-cyan); 
    background: rgba(0, 229, 255, 0.08); 
}

.ticker-list-item { display: flex; justify-content: space-between; padding: 15px 20px; border-bottom: 1px solid rgba(0, 229, 255, 0.1); cursor: pointer; transition: all 0.2s; box-sizing: border-box; }
.ticker-list-item:hover { background: rgba(0, 229, 255, 0.08); border-left: 3px solid var(--neon-cyan); }
.ticker-list-item .symbol { font-weight: 700; font-size: 0.9rem; color: #fff; }
.ticker-list-item .price { font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; }

.acc-item { border-bottom: 1px solid rgba(255,255,255,0.05); }
.acc-btn { width: 100%; padding: 15px; background: transparent; border: none; color: white; text-align: left; cursor: pointer; font-weight: bold; display: flex; justify-content: space-between; transition: 0.3s; }
.acc-btn:hover { background: rgba(0, 229, 255, 0.1); color: var(--neon-cyan); }
.acc-content { max-height: 0; overflow: hidden; transition: max-height 0.5s ease-in-out; background: #0f172a; }

.nested-acc-btn { width: 100%; padding: 10px 15px 10px 25px; background: transparent; border: none; color: var(--text-muted); text-align: left; cursor: pointer; font-weight: 600; display: flex; justify-content: space-between; transition: 0.3s; font-size: 0.85rem; }
.nested-acc-btn:hover { color: var(--neon-cyan); }
.nested-acc-content { max-height: 0; overflow: hidden; transition: max-height 0.4s ease-in-out; background: #090e17; }
.nested-acc-content a { display: block; padding: 8px 25px 8px 45px; color: #64748b; text-decoration: none; font-size: 0.8rem; border-left: 2px solid transparent; }
.nested-acc-content a:hover { color: var(--neon-green); border-left: 2px solid var(--neon-green); background: rgba(0, 255, 157, 0.05); }

.show { max-height: 1500px; }
.nested-show { max-height: 800px; overflow-y: auto; }

/* --- TIMEFRAME BUTTONS --- */
.tf-btn-group { display: flex; gap: 10px; justify-content: flex-end; margin-bottom: 10px; }
.tf-btn { background: transparent; border: 1px solid var(--border); color: var(--text-muted); padding: 6px 16px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 0.85rem; transition: all 0.2s; }
.tf-btn:hover { border-color: var(--neon-cyan); color: var(--text-main); }
.tf-btn.active { background: var(--neon-cyan); color: var(--bg-dark); border-color: var(--neon-cyan); }

/* --- AI HUD PANELS --- */
.hud-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.hud-panel { display: flex; flex-direction: column; justify-content: center; background: rgba(10, 18, 35, 0.8); border: 1px solid rgba(0, 229, 255, 0.3); border-radius: 12px; padding: 20px 30px; box-shadow: 0 0 20px rgba(0, 229, 255, 0.1), inset 0 0 10px rgba(0, 229, 255, 0.05); transition: all 0.5s ease; }
.hud-header { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
.hud-badge { background: rgba(0, 229, 255, 0.1); padding: 6px 12px; border-radius: 6px; border: 1px solid var(--neon-cyan); color: var(--neon-cyan); font-weight: bold; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 2px; }
.trade-data-group { display: flex; justify-content: space-between; font-family: 'JetBrains Mono', monospace; }
.trade-point { display: flex; flex-direction: column; align-items: flex-start; }

/* --- STAT BARS --- */
.ai-metrics-bar { display: flex; justify-content: space-between; align-items: center; background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 15px 25px; margin-bottom: 25px; box-shadow: inset 0 0 15px rgba(0, 229, 255, 0.05); }
.metric-block { display: flex; flex-direction: column; border-right: 1px solid rgba(255,255,255,0.1); padding-right: 25px; flex: 1; }
.metric-block:last-child { border-right: none; padding-right: 0; }
.metric-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; font-weight: 700; }
.metric-value { font-size: 1.2rem; font-weight: bold; font-family: 'JetBrains Mono', monospace; }

/* --- FUNDAMENTALS & CHARTS --- */
.fundamentals-container { background: var(--card-bg); padding: 25px; border-radius: 16px; border: 1px solid var(--border); box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); height: 100%; }
.fundamentals-header { margin-bottom: 20px; color: var(--text-muted); font-size: 1.1rem; font-weight: 600; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.fundamentals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 20px; }
.f-item { display: flex; flex-direction: column; }
.f-label { font-size: 0.75rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.f-value { font-size: 1.1rem; font-weight: 700; color: #f8fafc; font-family: 'JetBrains Mono', monospace; }
.accent-text { color: var(--neon-cyan); }

.fund-chart-container { background: var(--card-bg); padding: 25px; border-radius: 16px; margin-top: 25px; border: 1px solid var(--border); display: none; }
.fund-tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 20px; }
.fund-tab { background: transparent; border: none; color: #64748b; font-size: 1rem; font-weight: 700; cursor: pointer; padding: 5px 10px; transition: all 0.3s; }
.fund-tab.active { color: var(--neon-cyan); border-bottom: 3px solid var(--neon-cyan); }

.chart-card { background: var(--glass-card); border: 1px solid rgba(0, 229, 255, 0.2); padding: 20px; border-radius: 12px; margin-bottom: 20px; }

/* --- CATALYST TIMELINE --- */
.catalyst-list { margin-top: 15px; display: flex; flex-direction: column; gap: 10px; }
.catalyst-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: rgba(15, 23, 42, 0.6); border-radius: 8px; border-left: 3px solid #334155; }
.cat-warning { border-left-color: #f59e0b; background: rgba(245, 158, 11, 0.05); }
.cat-info { border-left-color: #00E5FF; background: rgba(0, 229, 255, 0.05); }
.cat-danger { border-left-color: #FF007F; background: rgba(255, 0, 127, 0.05); }
.cat-neutral { border-left-color: #8E9BAE; background: rgba(142, 155, 174, 0.05); }

/* --- UTILITIES --- */
.loading-pulse { animation: pulse 1.5s infinite; color: #64748b; font-style: italic; }
@keyframes pulse { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }
::-webkit-scrollbar { display: none; }
* { -ms-overflow-style: none; scrollbar-width: none; }

/* --- RESPONSIVE DASHBOARD LAYOUT --- */
@media screen and (max-width: 1150px) {
    .main-wrapper { grid-template-columns: 260px 1fr; }
    .side-panel.right { display: none; } 
}

@media screen and (max-width: 900px) {
    .content-panel > div:first-child { flex-direction: column !important; align-items: flex-start !important; gap: 15px; }
    .content-panel > div:first-child > div { text-align: left !important; }
    .tf-btn-group { justify-content: flex-start; }
    .hud-grid { grid-template-columns: 1fr; }
}

@media screen and (max-width: 768px) {
    body, html { overflow: auto; height: auto; }
    .main-wrapper { display: flex; flex-direction: column; height: auto; padding: 10px; }
    
    .ticker-sidebar { display: none; }
    .ticker-sidebar.open { 
        display: block; position: fixed; top: 0; left: 0; 
        width: 85%; max-width: 320px; height: 100vh; z-index: 2000; 
        border-radius: 0; border-right: 1px solid var(--neon-cyan); 
        box-shadow: 10px 0 50px rgba(0, 0, 0, 0.9);
        background: #0f172a;
    }
    
    .ai-metrics-bar { flex-direction: column; gap: 15px; align-items: flex-start; }
    .metric-block { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.1); padding-right: 0; padding-bottom: 15px; width: 100%; }
    .metric-block:last-child { border-bottom: none; padding-bottom: 0; }
    
    div[style*="grid-template-columns: repeat(auto-fit"] { grid-template-columns: 1fr !important; }
    .chart-card canvas { height: 300px !important; }
}