:root {
    /* Color Palette */
    --bg-dark: #0a0e17;
    --bg-panel: rgba(16, 22, 35, 0.6);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(0, 240, 255, 0.3);
    
    --text-main: #f0f4f8;
    --text-muted: #8b9bb4;
    
    --accent-blue: #00f0ff;
    --accent-purple: #8a2be2;
    --profit-green: #00e676;
    --loss-red: #ff3d00;
    
    --shadow-glow-blue: 0 0 20px rgba(0, 240, 255, 0.15);
    --shadow-glow-green: 0 0 20px rgba(0, 230, 118, 0.15);
    
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    /* Optional: If bg.png exists, use it, otherwise fallback to gradient */
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(0, 240, 255, 0.08), transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(138, 43, 226, 0.08), transparent 50%),
        url('bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-blend-mode: overlay;
}

/* Dynamic background animations */
.background-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: -1;
    background: linear-gradient(180deg, transparent 0%, rgba(10, 14, 23, 0.9) 100%);
}

.mono {
    font-family: 'JetBrains Mono', monospace;
}

.text-green { color: var(--profit-green) !important; }
.text-red { color: var(--loss-red) !important; }
.text-blue { color: var(--accent-blue) !important; }

/* Layout */
.dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.glass-panel:hover {
    border-color: var(--border-highlight);
    box-shadow: var(--shadow-glow-blue);
    transform: translateY(-2px);
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2.5rem;
    position: relative;
    overflow: hidden;
}

.main-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
}

.header-info h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.account-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(255,255,255,0.05);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.account-badge .divider {
    color: var(--border-glass);
}

.account-badge i {
    color: var(--accent-blue);
}

.live-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--profit-green);
    background: rgba(0, 230, 118, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(0, 230, 118, 0.2);
}

.status-dot {
    width: 10px;
    height: 10px;
    background-color: var(--profit-green);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--profit-green);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(0, 230, 118, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 230, 118, 0); }
}

/* Stats Grid */
.overview-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1.2fr;
    gap: 1.5rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stat-card h3 {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.2rem;
    font-weight: 700;
}

.main-pl {
    border-color: rgba(0, 230, 118, 0.3);
    box-shadow: var(--shadow-glow-green);
}

.main-pl .stat-value {
    font-size: 3rem;
}

.all-time {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(138, 43, 226, 0.1));
    border-color: rgba(0, 240, 255, 0.3);
}

.sparkline-container {
    width: 100%;
    height: 50px;
    margin-top: 10px;
    opacity: 0.7;
}

/* Bottom Grid */
.bottom-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

/* Positions Section */
.positions-section {
    display: flex;
    flex-direction: column;
}

.section-header {
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.section-header h2 i {
    color: var(--accent-blue);
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.table-container {
    overflow-x: auto;
}

.positions-table {
    width: 100%;
    border-collapse: collapse;
}

.positions-table th {
    text-align: left;
    padding: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-glass);
}

.positions-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.position-row {
    transition: background 0.2s;
}

.position-row:hover {
    background: rgba(255,255,255,0.03);
}

.symbol-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.symbol-icon {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-purple);
}

.font-bold { font-weight: 700; }

.empty-state {
    text-align: center !important;
    padding: 3rem !important;
    color: var(--text-muted);
    font-style: italic;
}

/* Call to Actions */
.action-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cta-card {
    position: relative;
    overflow: hidden;
    padding: 2rem 1.5rem;
}

.cta-card::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.cta-card:hover::before { opacity: 1; }

.cta-content h2 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.cta-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    width: 100%;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn i { font-size: 1.1rem; }

.btn-primary {
    background: rgba(0, 240, 255, 0.1);
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
}

.btn-primary:hover {
    background: var(--accent-blue);
    color: var(--bg-dark);
    box-shadow: var(--shadow-glow-blue);
}

.btn-secondary {
    background: rgba(138, 43, 226, 0.1);
    color: #c785ff;
    border: 1px solid var(--accent-purple);
}

.btn-secondary:hover {
    background: var(--accent-purple);
    color: white;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.3);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    border: none;
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3), var(--shadow-glow-blue);
}

/* Responsive */
@media (max-width: 1200px) {
    .overview-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .main-pl, .all-time {
        grid-column: span 3;
    }
}

@media (max-width: 900px) {
    .bottom-grid {
        grid-template-columns: 1fr;
    }
    .overview-grid {
        grid-template-columns: 1fr 1fr;
    }
    .main-pl, .all-time {
        grid-column: span 2;
    }
    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

@media (max-width: 600px) {
    .overview-grid {
        grid-template-columns: 1fr;
    }
    .main-pl, .all-time {
        grid-column: span 1;
    }
    .account-badge {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
    .account-badge .divider { display: none; }
}

/* New Utilities & Components */
.text-right { text-align: right !important; }

.flex-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.target-badge {
    background: rgba(138, 43, 226, 0.15);
    color: #c785ff;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(138, 43, 226, 0.3);
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.2);
}

.monthly-chart-container {
    width: 100%;
    height: 350px;
    margin-top: 1.5rem;
}

.cta-accent {
    border-color: rgba(138, 43, 226, 0.4);
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.15);
}

