/* Custom Dashboard Styles */
body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card-body {
    padding: 1.5rem;
}

.table {
    margin-bottom: 0;
}

.table th {
    background-color: #f8f9fa;
    border-top: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.table td {
    vertical-align: middle;
    padding: 0.75rem;
}

.badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 0;
    color: #495057;
    font-weight: 500;
    padding: 1rem 1.5rem;
    position: relative;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: #007bff;
}

.nav-tabs .nav-link.active {
    color: #007bff;
    background-color: transparent;
    border-color: transparent;
}

.nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #007bff;
}

.tab-content {
    padding-top: 2rem;
}

.spinner-border {
    color: #007bff;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .nav-tabs .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Loading animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Portfolio value colors */
.portfolio-positive {
    color: #28a745;
}

.portfolio-negative {
    color: #dc3545;
}

.portfolio-neutral {
    color: #6c757d;
}

/* Add market depth specific styles */
.market-depth-controls {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.market-depth-table {
    max-height: 400px;
    overflow-y: auto;
}

.market-depth-table table {
    font-size: 0.875rem;
}

.market-depth-table th {
    position: sticky;
    top: 0;
    z-index: 10;
}

.buy-orders {
    border-left: 3px solid #198754;
}

.sell-orders {
    border-left: 3px solid #dc3545;
}

.streaming-indicator {
    animation: pulse 2s infinite;
}

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

.market-info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.market-info-card .card-body {
    padding: 1rem;
}

.portfolio-positive {
    color: #198754 !important;
}

.portfolio-negative {
    color: #dc3545 !important;
}

/* Autocomplete styles */
.autocomplete-container {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.autocomplete-item {
    padding: 0.75rem;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background-color: #f8f9fa;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item strong {
    color: #495057;
}

.autocomplete-item small {
    color: #6c757d;
}

/* Instrument management styles */
.instrument-stats-card {
    transition: all 0.3s ease;
}

.instrument-stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.instrument-search-container {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.instrument-table-container {
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
}

.instrument-table {
    margin-bottom: 0;
}

.instrument-table th {
    background-color: #343a40;
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem 0.75rem;
}

.instrument-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #f8f9fa;
    vertical-align: middle;
}

.instrument-table tbody tr:hover {
    background-color: #f8f9fa;
}

.instrument-token {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid #dee2e6;
}

.sync-status {
    border-radius: 0.5rem;
    border: none;
    font-weight: 500;
}

.sync-status i {
    margin-right: 0.5rem;
}

/* Loading states */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

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

/* Badge styles for exchanges and types */
.badge-exchange {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    font-weight: 600;
}

.badge-nse { background-color: #007bff; }
.badge-bse { background-color: #28a745; }
.badge-nfo { background-color: #fd7e14; }
.badge-bfo { background-color: #20c997; }
.badge-mcx { background-color: #6f42c1; }
.badge-cds { background-color: #dc3545; }

.badge-instrument-type {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    font-weight: 500;
}

.badge-eq { background-color: #198754; }
.badge-fut { background-color: #fd7e14; }
.badge-opt { background-color: #0dcaf0; }
.badge-index { background-color: #6610f2; }

/* Responsive improvements for instruments */
@media (max-width: 768px) {
    .instrument-search-container {
        padding: 1rem;
    }
    
    .instrument-table th,
    .instrument-table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }
    
    .instrument-table .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .autocomplete-item {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
}

/* Dashboard Base Styles */
body {
    background-color: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 8px 8px 0 0;
    margin-right: 4px;
    color: #6c757d;
    font-weight: 500;
}

.nav-tabs .nav-link.active {
    background-color: #fff;
    color: #495057;
    border: 1px solid #dee2e6;
    border-bottom-color: #fff;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: #495057;
}

.tab-content {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0 8px 8px 8px;
    border-top: none;
}

.table-hover tbody tr:hover {
    background-color: rgba(0,123,255,0.1);
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Market Depth Specific Styles */
.market-depth-container {
    padding: 1rem;
}

.market-depth-price-summary .card {
    transition: transform 0.2s ease;
}

.market-depth-price-summary .card:hover {
    transform: translateY(-2px);
}

.market-depth-tables .table {
    font-size: 0.9rem;
}

.market-depth-tables .table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.market-depth-tables .table-sm td {
    padding: 0.5rem 0.75rem;
}

.market-depth-buy-orders {
    border-left: 4px solid #28a745;
}

.market-depth-sell-orders {
    border-left: 4px solid #dc3545;
}

.market-depth-status {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.market-depth-controls {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.market-depth-symbol-input {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .market-depth-price-summary .col-md-3 {
        margin-bottom: 1rem;
    }
    
    .market-depth-tables .col-md-6 {
        margin-bottom: 1rem;
    }
    
    .nav-tabs {
        flex-wrap: wrap;
    }
    
    .nav-tabs .nav-link {
        margin-bottom: 4px;
    }
} 