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

#wg-trading-floor {
    font-family: 'Inter', -apple-system, sans-serif;
    background: #0a0e17;
    color: #e1e5ea;
    min-height: 100vh;
    padding: 0;
    margin: -20px -40px;
    position: relative;
}

#wg-trading-floor * { box-sizing: border-box; }

.wg-mono { font-family: 'JetBrains Mono', monospace; }
.wg-green { color: #00e676 !important; }
.wg-red { color: #ff1744 !important; }
.wg-muted { color: #5a6474; }

/* Ticker Bar */
.wg-ticker-bar {
    background: #0d1321;
    border-bottom: 1px solid #1a2332;
    overflow: hidden;
    height: 44px;
    position: relative;
}
.wg-ticker-track {
    display: flex;
    animation: wg-scroll 40s linear infinite;
    white-space: nowrap;
    height: 44px;
    align-items: center;
}
@keyframes wg-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.wg-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 24px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    height: 100%;
}
.wg-ticker-item:hover { background: #1a2332; }
.wg-ticker-symbol { font-weight: 700; color: #fff; }
.wg-ticker-price { font-family: 'JetBrains Mono', monospace; }
.wg-ticker-change { font-family: 'JetBrains Mono', monospace; font-size: 12px; }

/* Main Layout */
.wg-main { display: flex; min-height: calc(100vh - 44px); }
.wg-sidebar {
    width: 300px;
    background: #0d1321;
    border-right: 1px solid #1a2332;
    overflow-y: auto;
    flex-shrink: 0;
}
.wg-content { flex: 1; overflow-y: auto; padding: 20px; }

/* Sidebar Product List */
.wg-sidebar-header {
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #5a6474;
    border-bottom: 1px solid #1a2332;
}
.wg-product-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #111827;
    transition: background 0.15s;
}
.wg-product-item:hover, .wg-product-item.active { background: #131a2b; }
.wg-product-info { flex: 1; }
.wg-product-ticker { font-weight: 700; font-size: 14px; color: #fff; }
.wg-product-name { font-size: 11px; color: #5a6474; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.wg-product-price-col { text-align: right; }
.wg-product-price { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 14px; }
.wg-product-change-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 2px;
}
.wg-product-change-badge.up { background: rgba(0,230,118,0.15); color: #00e676; }
.wg-product-change-badge.down { background: rgba(255,23,68,0.15); color: #ff1744; }

/* Sparkline canvas */
.wg-sparkline { width: 60px; height: 30px; margin: 0 12px; }

/* Chart Area */
.wg-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.wg-chart-title { font-size: 24px; font-weight: 700; color: #fff; }
.wg-chart-subtitle { font-size: 13px; color: #5a6474; }
.wg-chart-price-big {
    font-family: 'JetBrains Mono', monospace;
    font-size: 36px;
    font-weight: 700;
}
.wg-chart-change-big { font-size: 16px; margin-left: 12px; }

.wg-range-btns { display: flex; gap: 4px; }
.wg-range-btn {
    background: #1a2332;
    border: 1px solid #243044;
    color: #8892a4;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}
.wg-range-btn:hover, .wg-range-btn.active { background: #243044; color: #fff; border-color: #3a4a64; }

.wg-chart-container {
    background: #0d1321;
    border-radius: 12px;
    border: 1px solid #1a2332;
    padding: 16px;
    margin-bottom: 20px;
    height: 400px;
}

/* Order Book */
.wg-orderbook {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
.wg-ob-side {
    background: #0d1321;
    border-radius: 12px;
    border: 1px solid #1a2332;
    padding: 16px;
}
.wg-ob-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}
.wg-ob-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    position: relative;
}
.wg-ob-row .wg-ob-bar {
    position: absolute;
    top: 0;
    bottom: 0;
    opacity: 0.08;
    border-radius: 2px;
}
.wg-ob-buy .wg-ob-bar { right: 0; background: #00e676; }
.wg-ob-sell .wg-ob-bar { left: 0; background: #ff1744; }

/* Trading Panel */
.wg-trade-panel {
    background: #0d1321;
    border-radius: 12px;
    border: 1px solid #1a2332;
    padding: 20px;
    margin-bottom: 20px;
}
.wg-trade-tabs { display: flex; margin-bottom: 16px; gap: 2px; }
.wg-trade-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.15s;
    background: #1a2332;
    color: #5a6474;
}
.wg-trade-tab.active-buy { background: rgba(0,230,118,0.15); color: #00e676; }
.wg-trade-tab.active-sell { background: rgba(255,23,68,0.15); color: #ff1744; }

.wg-order-types { display: flex; gap: 2px; margin-bottom: 16px; }
.wg-order-type-btn {
    flex: 1; padding: 8px; text-align: center; cursor: pointer;
    border-radius: 6px; font-size: 13px; background: #131a2b; color: #5a6474;
}
.wg-order-type-btn.active { background: #1a2332; color: #e1e5ea; }

.wg-trade-field { margin-bottom: 12px; }
.wg-trade-label { font-size: 12px; color: #5a6474; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.wg-trade-input {
    width: 100%;
    background: #131a2b;
    border: 1px solid #243044;
    color: #e1e5ea;
    padding: 10px 12px;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    outline: none;
}
.wg-trade-input:focus { border-color: #3a4a64; }

.wg-trade-total {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-top: 1px solid #1a2332;
    margin-top: 12px;
    font-weight: 600;
}
.wg-trade-total-value { font-family: 'JetBrains Mono', monospace; font-size: 18px; color: #fff; }

.wg-trade-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    margin-top: 12px;
    transition: opacity 0.15s, transform 0.1s;
    color: #fff;
}
.wg-trade-btn:hover { opacity: 0.9; }
.wg-trade-btn:active { transform: scale(0.98); }
.wg-trade-btn.buy-btn { background: linear-gradient(135deg, #00c853, #00e676); }
.wg-trade-btn.sell-btn { background: linear-gradient(135deg, #d50000, #ff1744); }

.wg-login-prompt {
    text-align: center; padding: 24px;
}
.wg-login-prompt a {
    color: #00e676; text-decoration: underline;
}

/* Portfolio */
.wg-portfolio {
    background: #0d1321;
    border-radius: 12px;
    border: 1px solid #1a2332;
    padding: 20px;
    margin-bottom: 20px;
}
.wg-section-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.wg-holdings-table {
    width: 100%;
    border-collapse: collapse;
}
.wg-holdings-table th {
    text-align: left;
    font-size: 11px;
    color: #5a6474;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    border-bottom: 1px solid #1a2332;
}
.wg-holdings-table td {
    padding: 10px 12px;
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    border-bottom: 1px solid #111827;
}

/* Transaction History */
.wg-tx-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #111827;
    font-size: 13px;
}
.wg-tx-type {
    font-weight: 700;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}
.wg-tx-type.buy { background: rgba(0,230,118,0.15); color: #00e676; }
.wg-tx-type.sell { background: rgba(255,23,68,0.15); color: #ff1744; }

/* Market Overview Grid (default view) */
.wg-market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.wg-market-card {
    background: #0d1321;
    border-radius: 12px;
    border: 1px solid #1a2332;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
}
.wg-market-card:hover { border-color: #243044; transform: translateY(-2px); }
.wg-market-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.wg-market-card-ticker { font-size: 18px; font-weight: 700; color: #fff; }
.wg-market-card-name { font-size: 12px; color: #5a6474; margin-top: 2px; }
.wg-market-card-price { font-family: 'JetBrains Mono', monospace; font-size: 22px; font-weight: 700; }
.wg-market-card-change { font-family: 'JetBrains Mono', monospace; font-size: 14px; margin-top: 4px; }
.wg-market-card-chart { height: 60px; margin-top: 12px; }

/* Responsive */
@media (max-width: 768px) {
    #wg-trading-floor { margin: 0; }
    .wg-main { flex-direction: column; }
    .wg-sidebar { width: 100%; max-height: 200px; border-right: none; border-bottom: 1px solid #1a2332; }
    .wg-content { padding: 12px; }
    .wg-chart-container { height: 300px; }
    .wg-orderbook { grid-template-columns: 1fr; }
    .wg-chart-price-big { font-size: 24px; }
    .wg-market-grid { grid-template-columns: 1fr; }
}

/* Tabs for Portfolio/History */
.wg-panel-tabs { display: flex; gap: 2px; margin-bottom: 16px; }
.wg-panel-tab {
    padding: 8px 16px; cursor: pointer; border-radius: 6px;
    font-size: 13px; font-weight: 600; background: #131a2b; color: #5a6474;
}
.wg-panel-tab.active { background: #1a2332; color: #e1e5ea; }

/* Back button */
.wg-back-btn {
    background: none; border: 1px solid #243044; color: #8892a4;
    padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 13px;
    margin-bottom: 16px; display: inline-flex; align-items: center; gap: 6px;
}
.wg-back-btn:hover { background: #1a2332; color: #fff; }

/* Toast */
.wg-toast {
    position: fixed; bottom: 24px; right: 24px; padding: 14px 24px;
    border-radius: 10px; font-weight: 600; font-size: 14px; z-index: 9999;
    animation: wg-slide-in 0.3s ease-out;
    color: #fff;
}
.wg-toast.success { background: #00c853; }
.wg-toast.error { background: #d50000; }
@keyframes wg-slide-in { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Astra overrides */
.wg-trading-page .site-content { padding: 0 !important; max-width: 100% !important; }
.wg-trading-page .entry-content { padding: 0 !important; margin: 0 !important; max-width: 100% !important; }
