/* Trading Platform - TradingView Style */
.demo-platform {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 40px 0;
    min-height: auto;
}

.demo-platform::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(0,197,142,0.1)"/><circle cx="80" cy="40" r="1" fill="rgba(0,197,142,0.1)"/><circle cx="40" cy="80" r="3" fill="rgba(0,197,142,0.1)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

.trading-platform-container {
    display: flex;
    flex-direction: column;
    height: 75vh;
    max-height: 750px;
    background: #131722;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 1400px;
    position: relative;
    z-index: 1;
}

/* Top Toolbar */
.platform-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #1E222D;
    border-bottom: 1px solid #2A2E39;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.symbol-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #2A2E39;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.symbol-selector:hover {
    background: #363A45;
}

.current-symbol {
    font-size: 16px;
    font-weight: 600;
    color: #D1D4DC;
}

.symbol-selector i {
    color: #787B86;
    font-size: 12px;
}

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

.symbol-price {
    font-size: 18px;
    font-weight: 700;
    color: #00C58E;
}

.symbol-change {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}

.symbol-change.positive {
    background: rgba(0, 197, 142, 0.1);
    color: #00C58E;
}

.symbol-change.negative {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

/* Timeframe Buttons */
.toolbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

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

.tf-btn {
    padding: 6px 14px;
    background: transparent;
    border: none;
    color: #787B86;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.tf-btn:hover {
    background: #2A2E39;
    color: #D1D4DC;
}

.tf-btn.active {
    background: #2962FF;
    color: white;
}

/* Toolbar Right */
.toolbar-right {
    display: flex;
    gap: 8px;
}

.tool-btn {
    width: 36px;
    height: 36px;
    background: #2A2E39;
    border: none;
    border-radius: 4px;
    color: #787B86;
    cursor: pointer;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: #363A45;
    color: #D1D4DC;
}

/* Main Platform Layout */
.platform-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Watchlist Sidebar */
.watchlist-sidebar {
    width: 260px;
    background: #1E222D;
    border-right: 1px solid #2A2E39;
    display: flex;
    flex-direction: column;
}

.watchlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #2A2E39;
}

.watchlist-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: #D1D4DC;
    margin: 0;
}

.add-symbol-btn {
    width: 28px;
    height: 28px;
    background: #2A2E39;
    border: none;
    border-radius: 4px;
    color: #787B86;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-symbol-btn:hover {
    background: #00C58E;
    color: white;
}

.watchlist-items {
    flex: 1;
    overflow-y: auto;
}

.watchlist-item {
    padding: 12px 16px;
    border-bottom: 1px solid #2A2E39;
    cursor: pointer;
    transition: background 0.2s;
}

.watchlist-item:hover {
    background: #2A2E39;
}

.watchlist-item.active {
    background: #2962FF;
}

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

.item-symbol {
    font-size: 13px;
    font-weight: 600;
    color: #D1D4DC;
}

.item-change {
    font-size: 12px;
    font-weight: 600;
}

.item-change.positive {
    color: #00C58E;
}

.item-change.negative {
    color: #EF4444;
}

.item-price {
    font-size: 15px;
    font-weight: 700;
    color: #D1D4DC;
}

/* Chart Area */
.chart-area {
    flex: 1;
    position: relative;
    background: #131722;
}

#tradingChart {
    width: 100%;
    height: 100%;
}

.chart-watermark {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid #FFC107;
    border-radius: 20px;
    color: #FFC107;
    font-size: 12px;
    font-weight: 600;
}

/* Trading Panel */
.trading-panel {
    width: 300px;
    background: #1E222D;
    border-left: 1px solid #2A2E39;
    display: flex;
    flex-direction: column;
}

.panel-tabs-header {
    display: flex;
    border-bottom: 1px solid #2A2E39;
}

.panel-tab-btn {
    flex: 1;
    padding: 14px;
    background: transparent;
    border: none;
    color: #787B86;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.panel-tab-btn:hover {
    background: #2A2E39;
    color: #D1D4DC;
}

.panel-tab-btn.active {
    color: #2962FF;
    border-bottom-color: #2962FF;
}

.panel-content {
    display: none;
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

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

/* Order Type Selector */
.order-type-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.order-type-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid transparent;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.buy-order {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
    border-color: #10B981;
}

.buy-order.active {
    background: #10B981;
    color: white;
}

.sell-order {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    border-color: #EF4444;
}

.sell-order.active {
    background: #EF4444;
    color: white;
}

/* Order Form */
.order-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: #787B86;
    text-transform: uppercase;
}

.volume-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.volume-input button {
    width: 36px;
    height: 36px;
    background: #2A2E39;
    border: none;
    border-radius: 4px;
    color: #D1D4DC;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.volume-input button:hover {
    background: #363A45;
}

.volume-input input,
.form-group input {
    flex: 1;
    padding: 10px 14px;
    background: #2A2E39;
    border: 1px solid #363A45;
    border-radius: 4px;
    color: #D1D4DC;
    font-size: 14px;
    font-weight: 600;
}

.form-group input:focus,
.volume-input input:focus {
    outline: none;
    border-color: #2962FF;
}

/* Order Info */
.order-info {
    padding: 16px;
    background: #2A2E39;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.info-row span:first-child {
    color: #787B86;
}

.info-row span:last-child {
    color: #D1D4DC;
    font-weight: 700;
}

/* Execute Button */
.execute-order-btn {
    padding: 16px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}

.execute-order-btn.buy-btn {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
}

.execute-order-btn.sell-btn {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
}

.execute-order-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Positions Panel */
.positions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-positions {
    text-align: center;
    padding: 40px 20px;
    color: #787B86;
}

.empty-positions i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-positions p {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #D1D4DC;
}

.empty-positions span {
    font-size: 13px;
}

.position-card {
    padding: 16px;
    background: #2A2E39;
    border-radius: 6px;
    border-left: 4px solid transparent;
}

.position-card.buy-position {
    border-left-color: #10B981;
}

.position-card.sell-position {
    border-left-color: #EF4444;
}

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

.position-symbol {
    font-size: 14px;
    font-weight: 700;
    color: #D1D4DC;
}

.position-type {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

.position-type.buy {
    background: #10B981;
    color: white;
}

.position-type.sell {
    background: #EF4444;
    color: white;
}

.position-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 12px;
}

.position-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    color: #787B86;
    font-size: 11px;
}

.detail-value {
    color: #D1D4DC;
    font-weight: 600;
}

.position-pl {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #363A45;
}

.pl-label {
    font-size: 12px;
    color: #787B86;
}

.pl-value {
    font-size: 16px;
    font-weight: 700;
}

.pl-value.positive {
    color: #10B981;
}

.pl-value.negative {
    color: #EF4444;
}

.close-position-btn {
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    background: #EF4444;
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.close-position-btn:hover {
    background: #DC2626;
}

/* Status Bar */
.platform-statusbar {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 10px 20px;
    background: #1E222D;
    border-top: 1px solid #2A2E39;
}

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

.status-label {
    color: #787B86;
}

.status-value {
    color: #D1D4DC;
    font-weight: 700;
}

.status-value.profit {
    color: #10B981;
}

.status-value.loss {
    color: #EF4444;
}

.contact-cta {
    margin-left: auto;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #00C58E;
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.contact-link:hover {
    background: #0F7A5E;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .watchlist-sidebar {
        width: 240px;
    }

    .trading-panel {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .demo-platform {
        padding: 20px 0;
    }
    
    .trading-platform-container {
        height: auto;
        max-height: 500px;
        margin: 10px;
        border-radius: 8px;
    }

    .platform-main {
        flex-direction: column;
    }

    .watchlist-sidebar {
        width: 100%;
        max-height: 200px;
    }

    .chart-area {
        height: 300px;
    }
    
    .platform-toolbar {
        padding: 8px 10px;
    }
    
    .toolbar-left {
        gap: 10px;
    }
    
    .symbol-selector {
        padding: 6px 10px;
    }
    
    .current-symbol {
        font-size: 13px;
    }
    
    .symbol-price {
        font-size: 14px;
    }
    
    .symbol-change {
        font-size: 11px;
        padding: 3px 6px;
    }

    .trading-panel {
        width: 100%;
        padding: 10px;
    }

    .toolbar-center {
        display: none;
    }

    .platform-statusbar {
        flex-wrap: wrap;
        gap: 10px;
        padding: 8px 10px;
        font-size: 11px;
    }

    .contact-cta {
        margin-left: 0;
        width: 100%;
    }

    .contact-link {
        justify-content: center;
        font-size: 13px;
        padding: 8px 16px;
    }
}

/* Dark Mode for Trading Platform - Unified Black Theme */
body.dark-mode .demo-platform {
    background: #0d1117 !important;
}

body.dark-mode .trading-platform-container {
    background: #161b22 !important;
    border: 1px solid #30363d !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode .platform-toolbar {
    background: #21262d !important;
    border-bottom: 1px solid #30363d !important;
}

body.dark-mode .symbol-selector {
    background: #161b22 !important;
    border: 1px solid #30363d !important;
    color: #c9d1d9 !important;
}

body.dark-mode .symbol-selector:hover {
    background: #21262d !important;
    border-color: #00C58E !important;
}

body.dark-mode .current-symbol {
    color: #c9d1d9 !important;
}

body.dark-mode .symbol-price {
    color: #00C58E !important;
}

body.dark-mode .tf-btn {
    background: #161b22 !important;
    color: #8b949e !important;
    border: 1px solid #30363d !important;
}

body.dark-mode .tf-btn.active {
    background: #00C58E !important;
    color: #ffffff !important;
    border-color: #00C58E !important;
}

body.dark-mode .tf-btn:hover {
    background: #21262d !important;
    color: #c9d1d9 !important;
}

body.dark-mode .tool-btn {
    background: #161b22 !important;
    color: #8b949e !important;
    border: 1px solid #30363d !important;
}

body.dark-mode .tool-btn:hover {
    background: #00C58E !important;
    color: #ffffff !important;
}

body.dark-mode .watchlist-sidebar {
    background: #161b22 !important;
    border-right: 1px solid #30363d !important;
}

body.dark-mode .watchlist-header h3 {
    color: #c9d1d9 !important;
}

body.dark-mode .add-symbol-btn {
    background: #21262d !important;
    color: #8b949e !important;
    border: 1px solid #30363d !important;
}

body.dark-mode .add-symbol-btn:hover {
    background: #00C58E !important;
    color: #ffffff !important;
}

body.dark-mode .watchlist-item {
    background: #21262d !important;
    border-bottom: 1px solid #30363d !important;
    color: #c9d1d9 !important;
}

body.dark-mode .watchlist-item:hover {
    background: #2d333b !important;
}

body.dark-mode .watchlist-item.active {
    background: rgba(0, 197, 142, 0.1) !important;
    border-left: 3px solid #00C58E !important;
}

body.dark-mode .item-symbol {
    color: #c9d1d9 !important;
}

body.dark-mode .item-price {
    color: #c9d1d9 !important;
}

body.dark-mode .chart-area {
    background: #0d1117 !important;
}

body.dark-mode .chart-watermark {
    color: #8b949e !important;
}

body.dark-mode .chart-watermark span {
    color: #8b949e !important;
}

body.dark-mode .trading-panel {
    background: #161b22 !important;
    border-left: 1px solid #30363d !important;
}

body.dark-mode .panel-tab-btn {
    background: #21262d !important;
    color: #8b949e !important;
    border-bottom: 1px solid #30363d !important;
}

body.dark-mode .panel-tab-btn.active {
    background: #161b22 !important;
    color: #00C58E !important;
    border-bottom: 2px solid #00C58E !important;
}

body.dark-mode .order-type-btn {
    background: #21262d !important;
    border: 1px solid #30363d !important;
    color: #8b949e !important;
}

body.dark-mode .order-type-btn.active.buy-order {
    background: #00C58E !important;
    color: #ffffff !important;
    border-color: #00C58E !important;
}

body.dark-mode .order-type-btn.active.sell-order {
    background: #f85149 !important;
    color: #ffffff !important;
    border-color: #f85149 !important;
}

body.dark-mode .form-group label {
    color: #c9d1d9 !important;
}

body.dark-mode .form-group input {
    background: #21262d !important;
    border: 1px solid #30363d !important;
    color: #c9d1d9 !important;
}

body.dark-mode .form-group input:focus {
    border-color: #00C58E !important;
    outline: none !important;
}

body.dark-mode .volume-input button {
    background: #21262d !important;
    border: 1px solid #30363d !important;
    color: #c9d1d9 !important;
}

body.dark-mode .volume-input button:hover {
    background: #00C58E !important;
    color: #ffffff !important;
}

body.dark-mode .execute-order-btn {
    color: #ffffff !important;
}

body.dark-mode .execute-order-btn.buy-btn {
    background: #00C58E !important;
}

body.dark-mode .execute-order-btn.sell-btn {
    background: #f85149 !important;
}

body.dark-mode .platform-statusbar {
    background: #21262d !important;
    border-top: 1px solid #30363d !important;
}

body.dark-mode .status-label {
    color: #8b949e !important;
}

body.dark-mode .status-value {
    color: #c9d1d9 !important;
}

body.dark-mode .status-value.profit {
    color: #00C58E !important;
}

body.dark-mode .status-value.loss {
    color: #f85149 !important;
}

body.dark-mode .contact-link {
    background: #00C58E !important;
    color: #ffffff !important;
    border: 1px solid #00C58E !important;
}

body.dark-mode .contact-link:hover {
    background: #1ED18D !important;
}

/* Position Cards Dark Mode */
body.dark-mode .position-card {
    background: #21262d !important;
    border: 1px solid #30363d !important;
    color: #c9d1d9 !important;
}

body.dark-mode .position-symbol {
    color: #c9d1d9 !important;
}

body.dark-mode .position-type {
    color: #c9d1d9 !important;
}

body.dark-mode .detail-label {
    color: #8b949e !important;
}

body.dark-mode .detail-value {
    color: #c9d1d9 !important;
}

body.dark-mode .pl-label {
    color: #8b949e !important;
}

body.dark-mode .pl-value.positive {
    color: #00C58E !important;
}

body.dark-mode .pl-value.negative {
    color: #f85149 !important;
}

body.dark-mode .close-position-btn {
    background: #f85149 !important;
    color: #ffffff !important;
    border: 1px solid #f85149 !important;
}

body.dark-mode .close-position-btn:hover {
    background: #ff6b6b !important;
}

body.dark-mode .empty-positions {
    color: #8b949e !important;
}

body.dark-mode .empty-positions i {
    color: #8b949e !important;
}

body.dark-mode .empty-positions p {
    color: #c9d1d9 !important;
}

body.dark-mode .empty-positions span {
    color: #8b949e !important;
}

/* Additional Dark Mode Fixes for Order Info */
body.dark-mode .order-info {
    background: #21262d !important;
    border: 1px solid #30363d !important;
}

body.dark-mode .order-info .info-row {
    color: #c9d1d9 !important;
}

body.dark-mode .order-info .info-row span:first-child {
    color: #8b949e !important;
}

body.dark-mode .order-info .info-row span:last-child {
    color: #c9d1d9 !important;
    font-weight: 700 !important;
}
