/* Advanced Trading Platform Styles */

.trading-container {
    background: #0f0f0f;
    color: #ffffff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Chart Styling */
.chart-container {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    position: relative;
}

.chart-container iframe {
    border-radius: 8px;
}

/* Order Panel Styling */
.order-panel {
    background: #1e1e1e;
    border: 1px solid #333;
}

.nav-pills .nav-link {
    background: transparent;
    border: 1px solid #555;
    color: #ccc;
    margin-right: 5px;
    padding: 6px 12px;
    font-size: 0.85rem;
}

.nav-pills .nav-link.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

/* Portfolio Stats */
.portfolio-stats {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 1px solid #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.price-ticker {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

/* P&L Colors */
.pnl-positive {
    color: #00d4aa !important;
    text-shadow: 0 0 3px rgba(0, 212, 170, 0.3);
}

.pnl-negative {
    color: #ff6b6b !important;
    text-shadow: 0 0 3px rgba(255, 107, 107, 0.3);
}

/* Order Book Styling */
.order-book-table {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

.bid-price {
    color: #00d4aa;
    font-weight: bold;
}

.ask-price {
    color: #ff6b6b;
    font-weight: bold;
}

.order-book-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Card Styling */
.card {
    background: #1a1a1a;
    border: 1px solid #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.card-header {
    background: #2a2a2a;
    border-bottom: 1px solid #333;
}

/* Form Controls */
.form-control {
    background: #2a2a2a;
    border: 1px solid #555;
    color: #fff;
}

.form-control:focus {
    background: #2a2a2a;
    border-color: #007bff;
    color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-control::placeholder {
    color: #888;
}

/* Button Groups */
.btn-group .btn {
    border-color: #555;
}

.btn-check:checked + .btn {
    background-color: var(--bs-btn-active-bg);
    border-color: var(--bs-btn-active-border-color);
}

/* Tables */
.table-dark {
    --bs-table-bg: #1a1a1a;
    --bs-table-border-color: #333;
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.075);
}

.positions-table th,
.positions-table td {
    padding: 8px 4px;
    font-size: 0.85rem;
    vertical-align: middle;
}

/* Market Status */
.market-status {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.market-status .badge {
    font-size: 0.9rem;
    padding: 8px 12px;
}

/* Alerts and Notifications */
.alert {
    border: none;
    border-radius: 6px;
}

.alert-info {
    background: rgba(23, 162, 184, 0.1);
    color: #17a2b8;
    border-left: 3px solid #17a2b8;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border-left: 3px solid #ffc107;
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border-left: 3px solid #28a745;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .price-ticker {
        font-size: 1rem;
    }
    
    .portfolio-stats {
        padding: 10px;
    }
    
    .positions-table th,
    .positions-table td {
        padding: 6px 2px;
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .trading-container {
        padding: 10px;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .portfolio-stats .d-flex {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .portfolio-stats .text-center {
        flex: 1;
        min-width: 80px;
    }
    
    .btn-group .btn {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
}

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #333;
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Custom Scrollbars */
.table-responsive::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Badge Styling */
.badge {
    font-size: 0.75rem;
    padding: 4px 8px;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Hover Effects */
.card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* Focus States */
.btn:focus,
.form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Print Styles */
@media print {
    .market-status,
    .btn,
    .nav-pills {
        display: none !important;
    }
    
    .trading-container {
        background: white !important;
        color: black !important;
    }
    
    .card {
        border: 1px solid #ccc !important;
        background: white !important;
    }
}