@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --bg-main: #0c0c10; /* Shoppulse Dark Theme Page BG */
    --panel-bg: #141418; /* Shoppulse Card/Panel BG */
    --border-color: #27272a; /* Shoppulse Zinc 800 Border */
    --border-subtle: #1e1e24;
    
    --accent-primary: #7c3aed; /* Shoppulse Signature Violet */
    --accent-hover: #6d28d9;
    --accent-subtle: rgba(124, 58, 237, 0.1);
    
    --text-primary: #f4f4f5; /* Zinc 100 */
    --text-secondary: #a1a1aa; /* Zinc 400 */
    --text-muted: #52525b; /* Zinc 600 */
    
    --color-green: #22c55e; /* Shoppulse Green */
    --color-green-light: #4ade80;
    --color-red: #ef4444; /* Shoppulse Red */
    --color-red-light: #fb7185;
    
    --font-heading: 'Plus Jakarta Sans', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

.app-container {
    width: 100%;
    min-height: 100vh;
}

/* Full Width Main Content */
.main-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

@media (min-width: 768px) {
    .main-content {
        padding: 24px 32px;
    }
}

/* Content Header */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    font-size: 24px;
    color: var(--accent-primary);
}

.brand-text h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #a78bfa, var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--text-muted);
}

.status-dot.online {
    background-color: var(--color-green);
    box-shadow: 0 0 6px var(--color-green);
}

.status-text {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

.sync-time {
    font-size: 10px;
    color: var(--text-muted);
}

/* Buttons (Shoppulse Style - 6px border-radius, clean flat/solid) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease-in-out;
}

.btn-primary {
    background-color: var(--accent-primary);
    color: #ffffff;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #18181b;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #27272a;
}

/* Stats Cards Grid (Shoppulse Style) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.stats-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
    border-radius: 12px;
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    width: 100%;
}

.card-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.card-top h3 {
    font-family: var(--font-heading);
    font-size: 12.5px;
    color: var(--text-secondary);
    font-weight: 500;
}

.card-value {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #ffffff;
}

/* Panels */
.panel {
    border-radius: 12px;
    padding: 20px;
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    margin-bottom: 24px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
}

.panel-header h2 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.flex-wrap {
    flex-wrap: wrap;
}

/* Filters bar (Shoppulse Inputs) */
.filters {
    display: flex;
    gap: 8px;
    width: 100%;
}

@media (min-width: 768px) {
    .filters {
        width: auto;
    }
}

.input-select {
    background-color: #18181b;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.input-select:focus, .input-text:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.input-text {
    background-color: #18181b;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 13px;
    outline: none;
    width: 100%;
    transition: all 0.15s ease-in-out;
}

@media (min-width: 768px) {
    .input-select, .input-text {
        width: auto;
    }
    .input-text {
        width: 180px;
    }
}

/* Table Design (Shoppulse Flat Table, Full Desktop Layout on Mobile with Horizontal Scroll) */
.table-container {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    min-width: 600px;
}

th, td {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-subtle);
}

th {
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 12px;
    background-color: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid var(--border-color);
}

td {
    font-family: var(--font-body);
    font-weight: 400;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: rgba(255, 255, 255, 0.015);
}

/* Plain White Text styling for exchange and side */
.exchange-label {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.side-label {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Status Badges (Shoppulse Style) */
.badge {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    border: 1px solid transparent;
}

.badge-open {
    background-color: rgba(34, 197, 94, 0.1);
    color: var(--color-green-light);
    border-color: rgba(34, 197, 94, 0.2);
}

.badge-closed {
    background-color: #27272a;
    color: var(--text-secondary);
    border-color: #3f3f46;
}

.pnl-positive { color: var(--color-green-light); font-weight: 600; }
.pnl-negative { color: var(--color-red-light); font-weight: 600; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* Infinite Scroll Sentinel */
.scroll-sentinel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 13px;
}

.scroll-sentinel.hidden {
    display: none;
}

.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top: 2px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Custom scrollbar for horizontal scrolling on mobile */
.table-container::-webkit-scrollbar {
    height: 6px;
}

.table-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
