/* Financial Instruments Dashboard Styles */
.financial-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Dark theme */
.financial-dashboard[data-theme="dark"] {
    background: #1a1a1a;
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Header Section */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.search-container {
    position: relative;
    flex: 1;
    min-width: 300px;
}

.search-input {
    width: 100%;
    padding: 12px 45px 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    outline: none;
}

.search-input:focus {
    border-color: #0066cc;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.financial-dashboard[data-theme="dark"] .search-input {
    background: #2d2d2d;
    border-color: #404040;
    color: #ffffff;
}

.financial-dashboard[data-theme="dark"] .search-input:focus {
    background: #333333;
    border-color: #0088ff;
}

.search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 18px;
}

.theme-toggle {
    display: flex;
    gap: 8px;
}

.theme-btn {
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.theme-btn:hover {
    background: #f0f0f0;
    border-color: #0066cc;
}

.theme-btn.active {
    background: #0066cc;
    border-color: #0066cc;
    color: #ffffff;
}

.financial-dashboard[data-theme="dark"] .theme-btn {
    background: #2d2d2d;
    border-color: #404040;
    color: #ffffff;
}

.financial-dashboard[data-theme="dark"] .theme-btn:hover {
    background: #404040;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: #f8f9fa;
    padding: 4px;
    border-radius: 8px;
    overflow-x: auto;
}

.financial-dashboard[data-theme="dark"] .filter-tabs {
    background: #2d2d2d;
}

.filter-tab {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-tab:hover {
    background: #e9ecef;
    color: #333;
}

.filter-tab.active {
    background: #0066cc;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.financial-dashboard[data-theme="dark"] .filter-tab {
    color: #cccccc;
}

.financial-dashboard[data-theme="dark"] .filter-tab:hover {
    background: #404040;
    color: #ffffff;
}

/* Instruments Container */
.instruments-container {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e1e5e9;
}

.financial-dashboard[data-theme="dark"] .instruments-container {
    background: #252525;
    border-color: #404040;
}

.instruments-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1.2fr;
    gap: 16px;
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
    font-weight: 600;
    font-size: 14px;
    color: #555;
}

.financial-dashboard[data-theme="dark"] .instruments-header {
    background: #2d2d2d;
    border-color: #404040;
    color: #cccccc;
}

.instruments-list {
    max-height: 500px;
    overflow-y: auto;
}

.instrument-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1.2fr;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.instrument-item:hover {
    background: #f8f9fa;
}

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

.financial-dashboard[data-theme="dark"] .instrument-item {
    border-color: #333333;
}

.financial-dashboard[data-theme="dark"] .instrument-item:hover {
    background: #2d2d2d;
}

.instrument-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.instrument-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.instrument-symbol {
    font-size: 12px;
    color: #666;
    font-family: 'Courier New', monospace;
}

.financial-dashboard[data-theme="dark"] .instrument-name {
    color: #ffffff;
}

.financial-dashboard[data-theme="dark"] .instrument-symbol {
    color: #999999;
}

.instrument-type {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    background: #e9ecef;
    color: #495057;
}

.instrument-type.stock {
    background: #e3f2fd;
    color: #1976d2;
}

.instrument-type.etf {
    background: #f3e5f5;
    color: #7b1fa2;
}

.instrument-type.cfd {
    background: #fff3e0;
    color: #f57c00;
}

.financial-dashboard[data-theme="dark"] .instrument-type {
    background: #404040;
    color: #cccccc;
}

.instrument-price {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    font-family: 'Courier New', monospace;
}

.financial-dashboard[data-theme="dark"] .instrument-price {
    color: #ffffff;
}

.instrument-change {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.change-value.positive {
    color: #22c55e;
}

.change-value.negative {
    color: #ef4444;
}

.change-value.neutral {
    color: #6b7280;
}

.change-percent {
    font-size: 12px;
    opacity: 0.8;
}

.buy-sell-prices {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.buy-price {
    color: #22c55e;
}

.sell-price {
    color: #ef4444;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

.financial-dashboard[data-theme="dark"] .loading {
    color: #999999;
}

/* Footer */
.dashboard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e1e5e9;
    font-size: 14px;
    color: #666;
}

.financial-dashboard[data-theme="dark"] .dashboard-footer {
    border-color: #404040;
    color: #999999;
}

.auto-refresh-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.refresh-toggle {
    padding: 4px 8px;
    border: 1px solid #0066cc;
    border-radius: 4px;
    background: #0066cc;
    color: #ffffff;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.refresh-toggle:hover {
    background: #0052a3;
}

.refresh-toggle.off {
    background: #dc3545;
    border-color: #dc3545;
}

.refresh-toggle.off:hover {
    background: #c82333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .financial-dashboard {
        margin: 10px;
        padding: 16px;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .search-container {
        min-width: auto;
    }

    .instruments-header {
        display: none;
    }

    .instrument-item {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px;
    }

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

    .filter-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .dashboard-footer {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .instrument-mobile-layout {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .filter-tab {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Animation for data updates */
.instrument-item.updating {
    background: rgba(0, 102, 204, 0.1);
    transform: scale(1.02);
}

.financial-dashboard[data-theme="dark"] .instrument-item.updating {
    background: rgba(0, 136, 255, 0.1);
}

/* Smooth transitions */
* {
    box-sizing: border-box;
}

.financial-dashboard * {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}