/* ═══════════════════════════════════════════════════════════
   QUANTUM FX PRO - Professional Forex Trading Platform
   Premium Dark Theme Stylesheet
   ═══════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────
   CSS Variables & Theme
   ───────────────────────────────────────────────────────────── */
:root {
    /* Primary Colors */
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.3);
    
    /* Accent Colors */
    --accent: #8b5cf6;
    --accent-light: #a78bfa;
    --accent-glow: rgba(139, 92, 246, 0.3);
    
    /* Success/Profit Colors */
    --success: #10b981;
    --success-light: #34d399;
    --success-dark: #059669;
    --success-bg: rgba(16, 185, 129, 0.1);
    
    /* Danger/Loss Colors */
    --danger: #ef4444;
    --danger-light: #f87171;
    --danger-dark: #dc2626;
    --danger-bg: rgba(239, 68, 68, 0.1);
    
    /* Warning Colors */
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --warning-bg: rgba(245, 158, 11, 0.1);
    
    /* Neutral Colors */
    --neutral: #6b7280;
    --neutral-light: #9ca3af;
    
    /* Background Colors */
    --bg-primary: #0f0f14;
    --bg-secondary: #16161d;
    --bg-tertiary: #1c1c26;
    --bg-elevated: #22222e;
    --bg-card: #1a1a24;
    --bg-hover: #252532;
    --bg-active: #2d2d3d;
    
    /* Border Colors */
    --border-primary: #2a2a3a;
    --border-secondary: #363648;
    --border-light: #404055;
    
    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --text-muted: #475569;
    
    /* Chart Colors */
    --chart-bull: #26a69a;
    --chart-bear: #ef5350;
    --chart-grid: #1e1e2d;
    --chart-crosshair: #758696;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px var(--primary-glow);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Spacing */
    --sidebar-width: 240px;
    --sidebar-collapsed: 70px;
    --header-height: 56px;
    --bottom-panel-height: 200px;
    
    /* Font Families */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ─────────────────────────────────────────────────────────────
   Reset & Base Styles
   ───────────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-light);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    outline: none;
}

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

/* ─────────────────────────────────────────────────────────────
   Preloader
   ───────────────────────────────────────────────────────────── */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    text-align: center;
}

.preloader-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

.preloader-logo i {
    font-size: 36px;
    color: white;
}

.preloader-text {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 24px;
}

.preloader-bar {
    width: 200px;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    margin: 0 auto 12px;
    overflow: hidden;
}

.preloader-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
    animation: loading 1.5s ease-in-out infinite;
}

.preloader-status {
    color: var(--text-secondary);
    font-size: 13px;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 var(--primary-glow); }
    50% { transform: scale(1.05); box-shadow: 0 0 30px var(--primary-glow); }
}

@keyframes loading {
    0% { width: 0%; margin-left: 0; }
    50% { width: 70%; margin-left: 15%; }
    100% { width: 0%; margin-left: 100%; }
}

/* ─────────────────────────────────────────────────────────────
   App Container & Layout
   ───────────────────────────────────────────────────────────── */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* ─────────────────────────────────────────────────────────────
   Sidebar
   ───────────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width var(--transition-normal);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-primary);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.logo-icon i {
    font-size: 20px;
    color: white;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 2px;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    margin-bottom: 4px;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-md);
}

.nav-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-item span {
    font-weight: 500;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-primary);
}

.account-info {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
}

.account-balance, .account-pnl {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.account-balance {
    margin-bottom: 8px;
}

.balance-label, .pnl-label {
    font-size: 12px;
    color: var(--text-tertiary);
}

.balance-value {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.pnl-value {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
}

.pnl-value.positive { color: var(--success); }
.pnl-value.negative { color: var(--danger); }

.btn-settings {
    width: 100%;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.btn-settings:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ─────────────────────────────────────────────────────────────
   Main Content
   ───────────────────────────────────────────────────────────── */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-primary);
}

/* Top Bar */
.top-bar {
    height: var(--header-height);
    padding: 0 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.market-status {
    display: flex;
    align-items: center;
    gap: 24px;
}

.status-indicator, .connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.status-dot, .connection-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: blink 2s infinite;
}

.status-dot { background: var(--success); }
.connection-dot { background: var(--neutral); }
.connection-dot.connected { background: var(--success); }
.connection-dot.disconnected { background: var(--danger); }

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text { color: var(--text-secondary); }
.connection-text { color: var(--text-secondary); }

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.server-time {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-icon .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--danger);
    border-radius: 9px;
    font-size: 10px;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─────────────────────────────────────────────────────────────
   Trading Section
   ───────────────────────────────────────────────────────────── */
.trading-section {
    flex: 1;
    display: grid;
    grid-template-columns: 280px 1fr 340px;
    grid-template-rows: 1fr;
    gap: 0;
    min-height: 0;
}

/* Instrument Panel */
.instrument-panel {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.instrument-selector {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.instrument-search {
    padding: 12px;
    position: relative;
}

.instrument-search i {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.instrument-search input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
}

.instrument-search input::placeholder {
    color: var(--text-tertiary);
}

.instrument-search input:focus {
    border-color: var(--primary);
}

.instrument-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px;
}

.instrument-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 2px;
}

.instrument-item:hover {
    background: var(--bg-hover);
}

.instrument-item.active {
    background: var(--bg-active);
    border: 1px solid var(--primary);
}

.instrument-item .pair {
    font-weight: 600;
    font-size: 13px;
}

.instrument-item .price {
    font-family: var(--font-mono);
    font-size: 12px;
}

.instrument-item .price.up { color: var(--success); }
.instrument-item .price.down { color: var(--danger); }

/* Current Instrument */
.current-instrument {
    padding: 16px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-primary);
}

.instrument-info {
    margin-bottom: 16px;
}

.instrument-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.pair-base { color: var(--text-primary); }
.pair-separator { color: var(--text-tertiary); margin: 0 2px; }
.pair-quote { color: var(--text-secondary); }

.instrument-description {
    font-size: 12px;
    color: var(--text-tertiary);
}

.instrument-price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.price-bid, .price-ask {
    flex: 1;
    text-align: center;
    padding: 12px;
    border-radius: var(--radius-md);
}

.price-bid {
    background: var(--danger-bg);
}

.price-ask {
    background: var(--success-bg);
}

.price-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.price-bid .price-value {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 600;
    color: var(--danger);
}

.price-ask .price-value {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 600;
    color: var(--success);
}

.price-spread {
    background: var(--bg-elevated);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

.spread-value {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
}

/* ─────────────────────────────────────────────────────────────
   Chart Wrapper
   ───────────────────────────────────────────────────────────── */
.chart-wrapper {
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    overflow: hidden;
}

.chart-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    flex-shrink: 0;
}

.timeframe-buttons {
    display: flex;
    gap: 4px;
}

.tf-btn {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    transition: all var(--transition-fast);
}

.tf-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.tf-btn.active {
    background: var(--primary);
    color: white;
}

.chart-type-buttons, .chart-tools, .chart-actions {
    display: flex;
    gap: 4px;
}

.chart-type-btn, .tool-btn, .action-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.chart-type-btn:hover, .tool-btn:hover, .action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.chart-type-btn.active {
    background: var(--bg-active);
    color: var(--primary);
}

.chart-tools {
    margin-left: auto;
}

.chart-container {
    flex: 1;
    min-height: 300px;
    position: relative;
}

.chart-legend {
    position: absolute;
    top: 12px;
    left: 16px;
    display: flex;
    gap: 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    z-index: 10;
    background: rgba(15, 15, 20, 0.8);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

.legend-item span {
    color: var(--text-primary);
    font-weight: 500;
}

/* ─────────────────────────────────────────────────────────────
   Right Panel
   ───────────────────────────────────────────────────────────── */
.right-panel {
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Order Panel */
.order-panel {
    padding: 16px;
    border-bottom: 1px solid var(--border-primary);
}

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

.panel-header h3 {
    font-size: 14px;
    font-weight: 600;
}

.order-type-toggle {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.toggle-btn {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.toggle-btn.active {
    background: var(--primary);
    color: white;
}

/* Order Direction Buttons */
.order-direction {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.direction-btn {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-md);
    text-align: center;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
}

.direction-btn.sell {
    background: var(--danger-bg);
    border-color: var(--danger-dark);
}

.direction-btn.sell:hover {
    background: var(--danger);
    border-color: var(--danger);
}

.direction-btn.buy {
    background: var(--success-bg);
    border-color: var(--success-dark);
}

.direction-btn.buy:hover {
    background: var(--success);
    border-color: var(--success);
}

.direction-btn:hover .direction-label,
.direction-btn:hover .direction-price {
    color: white;
}

.direction-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.direction-btn.sell .direction-label { color: var(--danger); }
.direction-btn.buy .direction-label { color: var(--success); }

.direction-price {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Form Groups */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
}

.form-control:focus {
    border-color: var(--primary);
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

/* Volume Input */
.volume-input {
    display: flex;
    align-items: center;
    gap: 4px;
}

.volume-input input {
    flex: 1;
    text-align: center;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-weight: 600;
}

.volume-btn {
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.volume-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.volume-presets {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.preset-btn {
    flex: 1;
    padding: 6px;
    font-size: 11px;
    font-family: var(--font-mono);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.preset-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--primary);
}

/* SL/TP Section */
.sl-tp-section {
    margin-bottom: 16px;
}

.sl-tp-toggle {
    margin-bottom: 12px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.sl-tp-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.sl-tp-inputs .form-group {
    margin-bottom: 0;
}

.sl-tp-inputs input {
    padding: 8px;
    font-size: 12px;
}

/* Order Summary */
.order-summary {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 12px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.summary-row:not(:last-child) {
    margin-bottom: 8px;
}

.summary-row span:first-child {
    color: var(--text-tertiary);
}

.summary-row span:last-child {
    color: var(--text-primary);
    font-family: var(--font-mono);
}

/* ─────────────────────────────────────────────────────────────
   Signal Panel
   ───────────────────────────────────────────────────────────── */
.signal-panel {
    flex: 1;
    padding: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.signal-strength-indicator {
    display: flex;
    align-items: center;
}

.strength-bars {
    display: flex;
    gap: 2px;
}

.strength-bars .bar {
    width: 6px;
    height: 12px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    transition: background var(--transition-fast);
}

.strength-bars .bar.active {
    background: var(--success);
}

.strength-bars.weak .bar:nth-child(1) { background: var(--danger); }
.strength-bars.moderate .bar:nth-child(-n+3) { background: var(--warning); }
.strength-bars.strong .bar { background: var(--success); }

.signal-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.main-signal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.signal-direction {
    display: flex;
    align-items: center;
    gap: 8px;
}

.signal-direction i {
    font-size: 20px;
}

.direction-text {
    font-size: 14px;
    font-weight: 700;
}

.signal-direction.buy { color: var(--success); }
.signal-direction.sell { color: var(--danger); }
.signal-direction.neutral { color: var(--neutral); }

/* Confidence Ring */
.signal-confidence {
    width: 60px;
    height: 60px;
}

.confidence-ring {
    position: relative;
    width: 100%;
    height: 100%;
}

.confidence-ring svg {
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: var(--bg-elevated);
    stroke-width: 3;
}

.ring-progress {
    fill: none;
    stroke: var(--primary);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray var(--transition-normal);
}

.confidence-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-mono);
}

/* Signal Details */
.signal-details {
    flex: 1;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-primary);
    font-size: 12px;
}

.detail-label {
    color: var(--text-tertiary);
}

.detail-value {
    font-family: var(--font-mono);
    font-weight: 500;
}

.detail-value.positive { color: var(--success); }
.detail-value.negative { color: var(--danger); }

.btn-execute-signal {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: auto;
    transition: all var(--transition-fast);
}

.btn-execute-signal:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    box-shadow: var(--shadow-glow);
}

.btn-execute-signal:disabled {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    cursor: not-allowed;
}

/* ─────────────────────────────────────────────────────────────
   Bottom Panel
   ───────────────────────────────────────────────────────────── */
.bottom-panel {
    height: var(--bottom-panel-height);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.panel-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-tertiary);
}

.tab-btn {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.tab-btn.active {
    color: var(--text-primary);
    background: var(--bg-active);
}

.tab-count {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--bg-elevated);
    border-radius: 9px;
    font-size: 10px;
    line-height: 18px;
    text-align: center;
    margin-left: 4px;
}

.panel-content {
    flex: 1;
    overflow: auto;
}

.tab-content {
    display: none;
    height: 100%;
}

.tab-content.active {
    display: block;
}

/* Data Table */
.data-table {
    width: 100%;
    font-size: 12px;
}

.data-table thead {
    position: sticky;
    top: 0;
    background: var(--bg-tertiary);
    z-index: 1;
}

.data-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-primary);
}

.data-table td {
    padding: 10px 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-primary);
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.data-table .empty-row td {
    text-align: center;
    color: var(--text-tertiary);
    padding: 24px;
}

.data-table .positive { color: var(--success); }
.data-table .negative { color: var(--danger); }

.data-table .btn-close-position {
    padding: 4px 8px;
    font-size: 10px;
    background: var(--danger-bg);
    color: var(--danger);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.data-table .btn-close-position:hover {
    background: var(--danger);
    color: white;
}

/* ─────────────────────────────────────────────────────────────
   Price Flash Animations
   ───────────────────────────────────────────────────────────── */
.flash-up {
    animation: flashUp 0.3s ease;
}

.flash-down {
    animation: flashDown 0.3s ease;
}

@keyframes flashUp {
    0% { background: transparent; }
    50% { background: rgba(16, 185, 129, 0.3); color: var(--success-light); }
    100% { background: transparent; }
}

@keyframes flashDown {
    0% { background: transparent; }
    50% { background: rgba(239, 68, 68, 0.3); color: var(--danger-light); }
    100% { background: transparent; }
}

/* Price value flash effect */
.price-value.flash-up {
    animation: priceFlashUp 0.4s ease;
}

.price-value.flash-down {
    animation: priceFlashDown 0.4s ease;
}

@keyframes priceFlashUp {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); text-shadow: 0 0 10px var(--success); }
    100% { transform: scale(1); }
}

@keyframes priceFlashDown {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); text-shadow: 0 0 10px var(--danger); }
    100% { transform: scale(1); }

/* ─────────────────────────────────────────────────────────────
   Modal
   ───────────────────────────────────────────────────────────── */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-container {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform var(--transition-normal);
}

.modal.active .modal-container {
    transform: scale(1);
}

.modal-container.modal-sm {
    max-width: 400px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-primary);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h2 i {
    color: var(--primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-primary);
}

/* Settings Tabs */
.settings-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: var(--radius-md);
}

.settings-tab {
    flex: 1;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.settings-tab:hover {
    color: var(--text-primary);
}

.settings-tab.active {
    background: var(--primary);
    color: white;
}

.settings-panel {
    display: none;
}

.settings-panel.active {
    display: block;
}

.settings-group {
    margin-bottom: 24px;
}

.settings-group h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-primary);
}

/* Form Check */
.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.form-check label {
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

/* Theme Selector */
.theme-selector {
    display: flex;
    gap: 16px;
}

.theme-option {
    flex: 1;
    cursor: pointer;
}

.theme-option input {
    display: none;
}

.theme-preview {
    height: 60px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-primary);
    margin-bottom: 8px;
    transition: border-color var(--transition-fast);
}

.theme-preview.dark {
    background: linear-gradient(135deg, #0f0f14, #1c1c26);
}

.theme-preview.light {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
}

.theme-option input:checked + .theme-preview {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.theme-name {
    display: block;
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Color Settings */
.color-settings {
    display: flex;
    gap: 16px;
}

.color-option {
    flex: 1;
}

.color-option label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.color-option input[type="color"] {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
}

/* Input with Icon */
.input-with-icon {
    position: relative;
}

.input-with-icon input {
    padding-right: 40px;
}

.toggle-visibility {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    padding: 4px;
    transition: color var(--transition-fast);
}

.toggle-visibility:hover {
    color: var(--text-primary);
}

.form-hint {
    display: block;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* Connection Result */
.connection-result {
    margin-top: 16px;
    padding: 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    display: none;
}

.connection-result.success {
    display: block;
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-dark);
}

.connection-result.error {
    display: block;
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-dark);
}

/* Indicators Modal */
.indicators-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.indicator-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.indicator-option:hover {
    background: var(--bg-hover);
}

.indicator-option input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.indicator-name {
    font-size: 13px;
    color: var(--text-primary);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-light);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ─────────────────────────────────────────────────────────────
   Notification Container
   ───────────────────────────────────────────────────────────── */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 360px;
}

.notification {
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

.notification.success { border-left-color: var(--success); }
.notification.error { border-left-color: var(--danger); }
.notification.warning { border-left-color: var(--warning); }

.notification-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification.success .notification-icon { background: var(--success-bg); color: var(--success); }
.notification.error .notification-icon { background: var(--danger-bg); color: var(--danger); }
.notification.warning .notification-icon { background: var(--warning-bg); color: var(--warning); }
.notification.info .notification-icon { background: rgba(59, 130, 246, 0.1); color: var(--primary); }

.notification-content {
    flex: 1;
}

.notification-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.notification-message {
    font-size: 12px;
    color: var(--text-secondary);
}

.notification-close {
    color: var(--text-tertiary);
    padding: 4px;
    transition: color var(--transition-fast);
}

.notification-close:hover {
    color: var(--text-primary);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ─────────────────────────────────────────────────────────────
   Order Confirm Modal
   ───────────────────────────────────────────────────────────── */
.order-confirm-details {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px;
}

.confirm-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
}

.confirm-row:not(:last-child) {
    border-bottom: 1px solid var(--border-primary);
}

.confirm-row .label {
    color: var(--text-tertiary);
}

.confirm-row .value {
    font-weight: 500;
    color: var(--text-primary);
}

.confirm-row .value.buy { color: var(--success); }
.confirm-row .value.sell { color: var(--danger); }

/* ─────────────────────────────────────────────────────────────
   Scrollbar
   ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ─────────────────────────────────────────────────────────────
   Responsive Design
   ───────────────────────────────────────────────────────────── */
@media (max-width: 1400px) {
    .trading-section {
        grid-template-columns: 240px 1fr 300px;
    }
}

@media (max-width: 1200px) {
    .sidebar {
        width: var(--sidebar-collapsed);
    }
    
    .sidebar .logo-text,
    .sidebar .nav-item span,
    .sidebar .account-info {
        display: none;
    }
    
    .sidebar .nav-item {
        justify-content: center;
        padding: 12px;
    }
    
    .sidebar .btn-settings {
        padding: 10px;
    }
    
    .trading-section {
        grid-template-columns: 220px 1fr 280px;
    }
}

@media (max-width: 992px) {
    .trading-section {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
    
    .instrument-panel {
        border-right: none;
        border-bottom: 1px solid var(--border-primary);
        max-height: 200px;
    }
    
    .right-panel {
        border-left: none;
        border-top: 1px solid var(--border-primary);
        max-height: 300px;
    }
}
