/* 
   Modern Pro Trading Theme 
   Based on Stitch Design Concept
*/

:root {
    /* Color Palette */
    --bg-main: #0f172a;
    /* Slate 900 */
    --bg-card: #1e293b;
    /* Slate 800 */
    --bg-card-hover: #334155;
    /* Slate 700 */

    --accent-primary: #135bec;
    /* Neon Blue */
    --accent-glow: rgba(19, 91, 236, 0.3);

    --text-primary: #f1f5f9;
    /* Slate 100 */
    --text-secondary: #94a3b8;
    /* Slate 400 */

    --border-color: #334155;
    /* Slate 700 */

    --success: #10b981;
    /* Emerald 500 */
    --danger: #ef4444;
    /* Red 500 */
    --warning: #f59e0b;
    /* Amber 500 */

    /* Spacing & Layout */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --header-height: 70px;
}

/* Base Reset & Typography */
body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Navigation / Header */
.nav {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-links a.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    text-decoration: none;
    border: 1px solid transparent;
}

.nav-links a.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-links a.nav-link.active {
    color: var(--accent-primary);
    background: rgba(19, 91, 236, 0.1);
    border-color: var(--accent-glow);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Page Header */
.header {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-main) 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Status Badge Pulse */
.status-badge {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Cards (Glassmorphism) */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    overflow: hidden;
}

.card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.card-header {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

.card-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-body {
    padding: 1.5rem;
}

/* Metrics & Stats */
.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Metric specific colors */
#accountBalance {
    color: var(--accent-primary);
    text-shadow: 0 0 20px rgba(19, 91, 236, 0.3);
}

#winRate {
    color: var(--success);
}

#dailyTrades {
    color: var(--warning);
}

/* Tables */
.trades-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.trades-table th {
    background: var(--bg-card);
    color: var(--text-secondary);
    font-weight: 600;
    text-align: left;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.trades-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.trades-table tr:hover td {
    background: var(--bg-card-hover);
}

.trades-table tr:last-child td {
    border-bottom: none;
}

/* Chart Container */
#chartContainer {
    width: 100%;
    height: 400px;
    position: relative;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
    padding: 2rem 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Grid Layout Fixes */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.section {
    margin-bottom: 2rem;
}

.section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Utility for text colors */
.text-green {
    color: var(--success);
}

.text-red {
    color: var(--danger);
}

.text-blue {
    color: var(--accent-primary);
}