/* HSI Market Intelligence Hub - Custom Styles */

/* General Styles */
:root {
    /* Aligned with public/style.css site tokens */
    --primary-dark: #1d4ed8;
    --primary-light: #60a5fa;
    --accent-blue: #2563eb;

    --bg-dark: #f3f4f6;
    --bg-card: #ffffff;
    --bg-hover: rgba(37, 99, 235, 0.06);

    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;

    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #2563eb;

    --bs-body-bg: var(--bg-dark);
    --bs-body-color: var(--text-primary);
    --bs-table-bg: var(--bg-card);
    --bs-table-color: var(--text-primary);
    --bs-table-striped-bg: #f9fafb;
    --bs-table-striped-color: var(--text-primary);
    --bs-table-hover-bg: var(--bg-hover);
    --bs-table-hover-color: var(--text-primary);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Legacy Bootstrap navbar (replaced by modern-header on finmkt.html) */
body:not(.finhub-page) .navbar {
    background-color: var(--primary-dark);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.navbar-brand {
    font-weight: 600;
    color: #ffffff;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
    overflow: hidden;
}

.card .card-header {
    background: linear-gradient(to right, #f9fafb, #ffffff);
    color: var(--text-primary);
    padding: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-bottom: 1px solid #e5e7eb;
}

.card .card-header i {
    color: var(--accent-blue);
    margin-right: 0.5rem;
}

.card-body {
    padding: 16px;
}

/* Table Styles */
.table {
    --bs-table-bg: var(--bg-card) !important;
    --bs-table-color: var(--text-primary) !important;
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    margin-bottom: 0;
}

.table thead th {
    --bs-table-bg: #f9fafb !important;
    background-color: #f9fafb !important;
    color: var(--text-muted) !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e5e7eb;
}

.table tbody tr {
    --bs-table-bg: var(--bg-card) !important;
    background-color: var(--bg-card) !important;
    border-bottom: 1px solid #e5e7eb;
}

.table tbody tr:hover {
    --bs-table-hover-bg: var(--bg-hover) !important;
    --bs-table-hover-color: var(--text-primary) !important;
    background-color: var(--bg-hover) !important;
    transition: background-color 0.2s ease;
}

.table td, .table th {
    border-top: 1px solid #e5e7eb;
    padding: 10px;
    vertical-align: middle;
}

/* Ensure all cells have good contrast */
.table td {
    opacity: 1 !important;
    color: var(--text-primary) !important;
}

/* Style for positive/negative changes */
.table td.positive {
    color: var(--success) !important;
}

.table td.negative {
    color: var(--danger) !important;
}

/* Hover effect for impact column */
.table tbody tr:hover td:nth-child(5) {
    opacity: 1;
}

/* Text alignment */
.text-right {
    text-align: right;
}

/* Ensure symbols and company names are always visible */
.table td:first-child,
.table td:nth-child(2) {
    color: var(--text-primary);
    font-weight: 500;
}

/* Add subtle zebra striping for better row distinction */
.table tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

/* Market Summary */
#market-summary {
    background: linear-gradient(to right, var(--primary-dark), var(--primary-light));
    border: none;
    padding: 20px;
}

#market-summary p {
    color: var(--text-secondary);
}

#hsi-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-feature-settings: "tnum" 1;
}

#hsi-change {
    font-size: 1.2rem;
    font-weight: 500;
}

#hsiIndex-last-updated {
    color: var(--text-muted);
}

.positive {
    color: var(--success);
}

.negative {
    color: var(--danger);
}

/* News Styles */
.news-item {
    border-bottom: 1px solid #333;
    padding: 12px 0;
    position: relative;
    padding-left: 15px;
    cursor: pointer;
}

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

.news-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.news-item h3.news-title {
    font-size: 1rem;
    margin-bottom: 5px;
    color: #ffffff;
    font-weight: 600;
}

.news-meta {
    color: #aaa;
    font-size: 0.8rem;
}

.impact-indicator {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.impact-indicator.impact-positive,
.impact-indicator.positive {
    background-color: #4caf50;
}

.impact-indicator.impact-negative,
.impact-indicator.negative {
    background-color: #f44336;
}

.impact-indicator.impact-neutral,
.impact-indicator.neutral {
    background-color: #9e9e9e;
}

/* News Item Enhancements */
.news-item .category-badge {
    font-size: 0.7rem;
    font-weight: normal;
    padding: 0.2rem 0.5rem;
    background-color: #1a73e8;
}

.news-item .impact-score-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #252525;
    border-radius: 4px;
    padding: 4px 8px;
    min-width: 70px;
}

.news-item .impact-score-label {
    font-size: 0.7rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-item .impact-score-value {
    font-size: 0.9rem;
    font-weight: 600;
}

.news-item .impact-score-value.positive {
    color: #4caf50;
}

.news-item .impact-score-value.negative {
    color: #f44336;
}

.news-item .impact-score-value.neutral {
    color: #9e9e9e;
}

.news-item .news-summary {
    color: #bbb;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.news-item .related-companies {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.news-item .company-badge {
    font-size: 0.7rem;
    font-weight: normal;
    padding: 0.2rem 0.5rem;
    background-color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
}

.news-item .company-badge:hover {
    background-color: #777;
    transform: translateY(-2px);
}

.news-item .impact-label {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
}

.news-item .impact-label.impact-positive,
.news-item .impact-label.positive {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.news-item .impact-label.impact-negative,
.news-item .impact-label.negative {
    background-color: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.news-item .impact-label.impact-neutral,
.news-item .impact-label.neutral {
    background-color: rgba(158, 158, 158, 0.2);
    color: #9e9e9e;
    border: 1px solid rgba(158, 158, 158, 0.3);
}

/* News Modal Enhancements */
#news-modal .impact-score-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #252525;
    border-radius: 4px;
    padding: 6px 12px;
    min-width: 80px;
}

#news-modal .impact-score-label {
    font-size: 0.7rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#news-modal .impact-score-value {
    font-size: 1.1rem;
    font-weight: 600;
}

#news-modal .impact-score-value.positive {
    color: #4caf50;
}

#news-modal .impact-score-value.negative {
    color: #f44336;
}

#news-modal .impact-score-value.neutral {
    color: #9e9e9e;
}

#news-modal .company-card {
    background-color: #252525;
    border: 1px solid #333;
    transition: all 0.2s ease;
    cursor: pointer;
}

#news-modal .company-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    background-color: #2a2a2a;
}

#news-modal .company-card .card-title {
    color: #fff;
    font-size: 0.9rem;
}

#news-modal .company-card .card-text {
    color: #aaa;
}

/* Loading and Error States */
.loading-indicator {
    display: flex;
    align-items: center;
    color: #aaa;
    font-size: 0.9rem;
}

.error-message {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 4px;
    padding: 8px 12px;
    margin: 10px 0;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.error-message::before {
    content: "\F33A";
    font-family: "bootstrap-icons";
    margin-right: 8px;
    font-size: 16px;
}

.data-source {
    color: #aaa;
    font-size: 0.8rem;
    font-style: italic;
}

.last-updated {
    color: #aaa;
    font-size: 0.8rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    #hsi-value {
        font-size: 1.8rem;
    }
    
    #hsi-change {
        font-size: 1rem;
    }
    
    .sector-name {
        width: 80px;
    }
}

/* Chart Styles */
#intraday-chart {
    width: 100%;
    height: 300px;
    min-height: 200px;
    max-width: 100%;
    max-height: 300px;
    overflow: hidden;
}

/* Prevent charts from growing out of control */
.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
    max-width: 100%;
    max-height: 300px;
    overflow: hidden;
}

.chart-container canvas {
    max-width: 100% !important;
    max-height: 300px !important;
    width: 100% !important;
    height: 300px !important;
}

/* Company chart specific sizing */
#company-chart {
    max-width: 100% !important;
    max-height: 200px !important;
    width: 100% !important;
    height: 200px !important;
}

/* Historical chart specific sizing */
#historical-chart {
    max-width: 100% !important;
    max-height: 400px !important;
    width: 100% !important;
    height: 400px !important;
}

/* Button Styles */
.btn {
    font-weight: 500;
}

.btn-outline-light {
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-outline-primary {
    border-color: #6ea8fe;
    color: #6ea8fe;
}

.btn-outline-primary:hover {
    background-color: rgba(77, 171, 247, 0.2);
    color: #ffffff;
    border-color: #6ea8fe;
}

.btn-outline-primary.active {
    background-color: #0d6efd;
    color: #ffffff;
    border-color: #0d6efd;
}

.btn-outline-danger {
    border-color: #f87171;
    color: #f87171;
}

.btn-outline-danger:hover {
    background-color: rgba(248, 113, 113, 0.2);
    color: #ffffff;
    border-color: #f87171;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Footer Styles */
footer {
    background-color: #1a1a1a !important;
    border-top: 1px solid #333;
}

/* Navigation */
.nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #f8f9fa !important;
}

/* News Items */
.news-time {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Refresh Buttons */
.btn-outline-light {
    border-width: 1px;
    padding: 0.25rem 0.5rem;
    transition: all 0.3s ease;
}

.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Charts */
#hsi-chart {
    height: 300px;
    width: 100%;
}

/* Footer */
footer {
    background-color: #1a2942 !important;
    color: white;
    padding: 20px 0;
    margin-top: 50px;
}

footer p {
    margin-bottom: 5px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    #market-summary .col-md-4 {
        margin-bottom: 20px;
    }
    
    .card-header {
        padding: 10px 15px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    #hsi-chart {
        height: 250px;
    }
}

/* Loading Indicators */
.loading-spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 0.2rem solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Tooltips */
.tooltip-inner {
    background-color: #1a2942;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.bs-tooltip-auto[x-placement^=top] .arrow::before, 
.bs-tooltip-top .arrow::before {
    border-top-color: #1a2942;
}

/* Company Details Modal */
#company-modal .modal-header {
    background-color: #252525;
    color: white;
    border-bottom: 1px solid #333;
}

#company-modal .modal-content {
    background-color: #1e1e1e;
    color: #e0e0e0;
    border: none;
}

#company-modal .modal-footer {
    border-top: 1px solid #333;
}

.company-info h2 {
    margin-bottom: 5px;
}

.company-symbol {
    color: #aaa;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.company-price {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.company-weight {
    color: #aaa;
}

.company-chart-container {
    height: 200px;
    margin-bottom: 15px;
}

/* News Modal Styles */
#news-modal .modal-header {
    background-color: #252525;
    color: white;
    border-bottom: 1px solid #333;
}

#news-modal .modal-content {
    background-color: #1e1e1e;
    color: #e0e0e0;
    border: none;
}

#news-modal .modal-footer {
    border-top: 1px solid #333;
}

/* News source link button */
#news-source-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
    transition: all 0.2s ease;
    position: relative;
    padding-right: 2.5rem;
}

#news-source-link:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#news-source-link::after {
    content: "\F08E";  /* External link icon */
    font-family: "bootstrap-icons";
    position: absolute;
    right: 1rem;
    transition: transform 0.2s ease;
}

#news-source-link:hover::after {
    transform: translateX(3px);
}

.news-article-header {
    margin-bottom: 20px;
}

.news-article-header h2 {
    margin-bottom: 10px;
}

.news-meta {
    color: #aaa;
    font-size: 0.9rem;
}

.news-summary {
    font-style: italic;
    color: #bbb;
    border-left: 3px solid #555;
    padding-left: 15px;
    margin-bottom: 20px;
}

.news-content p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.related-stock-item {
    cursor: pointer;
    transition: transform 0.2s;
}

.related-stock-item:hover {
    transform: translateY(-3px);
}

.related-stock-item .card {
    background-color: #252525;
}

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

::-webkit-scrollbar-track {
    background: #252525;
}

::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* Index Impact Column */
.table th i.bi-info-circle-fill {
    font-size: 0.7rem;
    vertical-align: super;
    cursor: help;
    opacity: 0.7;
}

.table th i.bi-info-circle-fill:hover {
    opacity: 1;
}

/* Make the impact values stand out a bit more */
td.text-right.positive, td.text-right.negative {
    font-weight: 500;
}

/* Add a subtle highlight to the Index Impact column */
.table tbody tr:hover td:nth-child(5) {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Company Modal Styles */
#company-modal .modal-content {
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#company-modal .modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background-color: #f8f9fa;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

#company-modal .company-info {
    padding: 10px 0;
}

#company-modal #company-name {
    margin-bottom: 5px;
    font-size: 1.5rem;
    font-weight: 600;
}

#company-modal .company-symbol {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 10px;
    font-weight: 500;
}

#company-modal .company-price {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 5px;
}

#company-modal .company-price #company-price {
    color: #212529;
}

#company-modal .company-price #company-change.text-success {
    color: #28a745 !important;
}

#company-modal .company-price #company-change.text-danger {
    color: #dc3545 !important;
}

#company-modal .company-weight {
    font-size: 0.9rem;
    color: #495057;
}

#company-modal .company-trading {
    color: #6c757d;
    font-size: 0.85rem;
}

#company-modal .company-chart-container {
    height: 200px;
    position: relative;
    margin-top: 10px;
}

#company-modal h5 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #343a40;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 5px;
}

#company-modal .table {
    font-size: 0.9rem;
}

#company-modal .table td:first-child {
    font-weight: 500;
    color: #495057;
}

#company-modal .table td:last-child {
    font-weight: 600;
    color: #212529;
}

#company-modal #company-description {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #495057;
}

#company-modal .news-item {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

#company-modal .news-item:last-child {
    border-bottom: none;
}

#company-modal .news-date {
    font-size: 0.8rem;
    color: #6c757d;
}

#company-modal .news-title a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1.4;
}

#company-modal .news-title a:hover {
    text-decoration: underline;
}

#company-modal .modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background-color: #f8f9fa;
}

#company-more-info {
    position: relative;
    padding-right: 28px;
    transition: all 0.2s ease;
}

#company-more-info:after {
    content: "→";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.2s ease;
}

#company-more-info:hover:after {
    right: 8px;
}

/* Tooltip styles for company modal */
#company-modal [title] {
    cursor: help;
    border-bottom: 1px dotted #ccc;
}

#company-modal td[title], 
#company-modal strong[title], 
#company-modal #company-symbol[title],
#company-modal canvas[title] {
    border-bottom: none;
}

#company-modal #company-data-timestamp {
    font-style: italic;
}

/* Historical Modal Styles */
#historical-modal .modal-content {
    background-color: #1e1e1e;
    color: #e0e0e0;
    border: none;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

#historical-modal .modal-header {
    background-color: #252525;
    color: white;
    border-bottom: 1px solid #333;
}

#historical-modal .modal-footer {
    border-top: 1px solid #333;
}

#historical-modal .current-value {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 5px;
}

#historical-modal #historical-current-value {
    color: #ffffff;
}

#historical-modal .btn-group .btn {
    background-color: transparent;
    color: #aaa;
    border-color: #444;
}

#historical-modal .btn-group .btn.active {
    background-color: #1a73e8;
    color: white;
    border-color: #1a73e8;
}

#historical-modal .btn-group .btn:hover:not(.active) {
    background-color: #333;
    color: white;
}

#historical-modal .table {
    color: #e0e0e0;
    margin-bottom: 0;
}

#historical-modal .table td:first-child {
    color: #aaa;
    font-weight: normal;
}

#historical-modal h6 {
    color: #1a73e8;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid #333;
}

#historical-modal #historical-download {
    background-color: #1a73e8;
    border-color: #1a73e8;
    transition: all 0.2s ease;
}

#historical-modal #historical-download:hover {
    background-color: #1765cc;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Loading state for elements */
.loading {
    opacity: 0.6;
    position: relative;
}

.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    right: -24px;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* Error state for elements */
.error {
    color: #dc3545;
    text-decoration: line-through;
    opacity: 0.7;
}

/* Streaming status indicator */
.streaming-status {
    display: flex;
    align-items: center;
    margin-top: 10px;
    font-size: 0.8rem;
    color: #aaa;
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-indicator.connected {
    background-color: #4caf50;
    box-shadow: 0 0 5px #4caf50;
    animation: pulse 2s infinite;
}

.status-indicator.disconnected {
    background-color: #f44336;
    box-shadow: 0 0 5px #f44336;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 5px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* Period selection buttons */
.btn-group .btn-outline-primary {
    color: var(--primary-color, #2563eb);
    border-color: #cbd5e1;
    background-color: #fff;
}

.btn-group .btn-outline-primary:hover {
    color: #fff;
    background-color: var(--primary-color, #2563eb);
    border-color: var(--primary-color, #2563eb);
}

.btn-group .btn-outline-primary.active {
    color: #fff;
    background-color: var(--primary-color, #2563eb);
    border-color: var(--primary-color, #2563eb);
}

/* Constituent table styling */
.table-hover tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.1);
    cursor: pointer;
}

.table th {
    font-weight: 600;
    border-bottom: 2px solid #3498db;
}

.table td {
    vertical-align: middle;
}

.constituent-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.constituent-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Index impact styling */
.positive-change {
    color: #4ade80;
    font-weight: 500;
}

.negative-change {
    color: #f87171;
    font-weight: 500;
}

/* Period note styling */
.text-muted.small {
    font-size: 0.8rem;
    padding: 8px 0;
    background-color: rgba(52, 152, 219, 0.05);
}

/* Toast Notifications */
body:not(.finhub-page) #toast-container {
    z-index: 9999;
}

body:not(.finhub-page) .toast {
    background-color: #252525;
    color: #f5f5f5;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 1;
}

body:not(.finhub-page) .toast .toast-header {
    background-color: #2a2a2a;
    color: #f5f5f5;
    border-bottom: 1px solid #444;
}

body:not(.finhub-page) .toast .toast-body {
    padding: 12px 16px;
    font-size: 0.9rem;
}

body:not(.finhub-page) .toast .btn-close {
    filter: invert(1);
}

body:not(.finhub-page) .toast.success-toast .toast-header {
    background-color: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

body:not(.finhub-page) .toast.error-toast .toast-header {
    background-color: rgba(248, 113, 113, 0.2);
    color: #f87171;
}

body:not(.finhub-page) .toast.warning-toast .toast-header {
    background-color: rgba(252, 211, 77, 0.2);
    color: #fcd34d;
}

body:not(.finhub-page) .toast.info-toast .toast-header {
    background-color: rgba(77, 171, 247, 0.2);
    color: #4dabf7;
}

/* Animation for refresh icon */
.spin-animation {
    animation: spin 1s linear;
}

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

/* Data source indicator */
.data-source {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: #333;
    color: #b0b0b0;
}

.data-source.fallback {
    background-color: rgba(252, 211, 77, 0.2);
    color: #fcd34d;
}

/* Delayed data indicator */
.delayed-data {
    color: #f5a623;
    font-style: italic;
}

.delayed-data-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(245, 166, 35, 0.9);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Error state for elements */
.error-state {
    color: #dc3545;
    font-style: italic;
}

/* No data styling */
.no-data {
    color: #999;
    font-style: italic;
}

.table tr.partial-data td {
    opacity: 0.7;
}

.table tr.partial-data .no-data-cell {
    font-style: italic;
    color: #aaa;
}

/* Delayed data notice */
.delayed-data-notice {
    background-color: rgba(245, 166, 35, 0.15);
    border: 1px solid rgba(245, 166, 35, 0.4);
    border-radius: 4px;
    padding: 8px 12px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f5a623;
}

/* Chart Control Styles */
.chart-controls {
    padding: 5px 0;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.chart-controls .btn {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
}

.chart-controls .dropdown-menu {
    background-color: #252525;
    border: 1px solid #333;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    padding: 0.5rem;
}

.chart-controls .dropdown-item {
    color: #e0e0e0;
    padding: 0.25rem 0.5rem;
}

.chart-controls .dropdown-item:hover {
    background-color: #333;
}

.chart-controls .form-check {
    margin-bottom: 0;
}

.chart-controls .form-check-input {
    background-color: #333;
    border-color: #555;
}

.chart-controls .form-check-input:checked {
    background-color: #1a73e8;
    border-color: #1a73e8;
}

.chart-controls .form-check-label {
    color: #e0e0e0;
    font-size: 0.8rem;
}

.chart-controls .dropdown-divider {
    border-top: 1px solid #444;
    margin: 0.25rem 0;
}

/* Chart Container Styles */
.chart-container {
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Alert styles override for dark mode */
.alert {
    color: #f5f5f5;
    border: 1px solid transparent;
}

.alert-info {
    background-color: rgba(54, 127, 169, 0.3);
    border-color: #4dabf7;
    color: #e0e0e0;
}

.alert-warning {
    background-color: rgba(176, 132, 38, 0.3);
    border-color: #ffc107;
    color: #e0e0e0;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.3);
    border-color: #f87171;
    color: #e0e0e0;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.3);
    border-color: #4ade80;
    color: #e0e0e0;
}

/* Badge styles for better contrast */
.badge {
    font-weight: 500;
    color: #ffffff;
}

.badge-warning {
    background-color: #b07722;
    color: #ffffff;
}

.badge-danger {
    background-color: #e05260;
    color: #ffffff;
}

.badge-success {
    background-color: #34c759;
    color: #ffffff;
}

.badge-info {
    background-color: #4dabf7;
    color: #ffffff;
}

/* Error message styling */
.error-message {
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
}

/* Button styling */
.btn-outline-light {
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-outline-primary {
    border-color: #6ea8fe;
    color: #6ea8fe;
}

.btn-outline-primary:hover {
    background-color: rgba(77, 171, 247, 0.2);
    color: #ffffff;
    border-color: #6ea8fe;
}

.btn-outline-primary.active {
    background-color: #0d6efd;
    color: #ffffff;
    border-color: #0d6efd;
}

.btn-outline-danger {
    border-color: #f87171;
    color: #f87171;
}

.btn-outline-danger:hover {
    background-color: rgba(248, 113, 113, 0.2);
    color: #ffffff;
    border-color: #f87171;
}

/* Bootstrap badge override */
.bg-secondary {
    background-color: #666 !important;
}

.bg-primary {
    background-color: #0d6efd !important;
}

/* Dropdown menu in dark mode (legacy archive pages only) */
body:not(.finhub-page) .dropdown-menu {
    background-color: #252525;
    border: 1px solid #444;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3);
}

body:not(.finhub-page) .dropdown-item {
    color: #f5f5f5;
}

body:not(.finhub-page) .dropdown-item:hover,
body:not(.finhub-page) .dropdown-item:focus {
    color: #ffffff;
    background-color: #333;
}

/* Form controls in dark mode (finmkt.html uses body.finhub-page + finhub-theme.css) */
body:not(.finhub-page) .form-control {
    background-color: #252525;
    border: 1px solid #444;
    color: #f5f5f5;
}

body:not(.finhub-page) .form-control:focus {
    background-color: #2a2a2a;
    border-color: #0d6efd;
    color: #ffffff;
}

body:not(.finhub-page) .form-control::placeholder {
    color: #aaa;
}

body:not(.finhub-page) input,
body:not(.finhub-page) select,
body:not(.finhub-page) textarea {
    background-color: #252525 !important;
    border: 1px solid #444 !important;
    color: #f5f5f5 !important;
}

body:not(.finhub-page) input:focus,
body:not(.finhub-page) select:focus,
body:not(.finhub-page) textarea:focus {
    background-color: #2a2a2a !important;
    border-color: #0d6efd !important;
    color: #ffffff !important;
}

/* Text colors for dark mode */
body:not(.finhub-page) .text-muted {
    color: #b0b0b0 !important;
}

body:not(.finhub-page) .text-secondary {
    color: #b0b0b0 !important;
}

body:not(.finhub-page) .text-primary {
    color: #6ea8fe !important;
}

body:not(.finhub-page) .text-success {
    color: #4ade80 !important;
}

body:not(.finhub-page) .text-danger {
    color: #f87171 !important;
}

body:not(.finhub-page) .text-warning {
    color: #fcd34d !important;
}

body:not(.finhub-page) .text-info {
    color: #4dabf7 !important;
}

/* Table styles enhancement */
body:not(.finhub-page) .table th {
    color: #cccccc;
    border-bottom: 2px solid #444;
}

body:not(.finhub-page) .table td {
    color: #f5f5f5;
    border-top: 1px solid #444;
}

/* Modal Styles for better visibility */
body:not(.finhub-page) .modal-content {
    background-color: #252525;
    color: #f5f5f5;
    border: 1px solid #444;
}

body:not(.finhub-page) .modal-header {
    background-color: #2a2a2a;
    border-bottom: 1px solid #444;
    color: #ffffff;
}

body:not(.finhub-page) .modal-footer {
    background-color: #2a2a2a;
    border-top: 1px solid #444;
}

body:not(.finhub-page) .modal-title {
    color: #ffffff;
    font-weight: 600;
}

body:not(.finhub-page) .close,
body:not(.finhub-page) .btn-close {
    color: #f5f5f5;
    opacity: 0.8;
    text-shadow: none;
}

body:not(.finhub-page) .close:hover,
body:not(.finhub-page) .btn-close:hover {
    color: #ffffff;
    opacity: 1;
}

/* Fix for #company-modal and #news-modal */
body:not(.finhub-page) #company-modal .modal-content,
body:not(.finhub-page) #news-modal .modal-content,
body:not(.finhub-page) #historical-modal .modal-content {
    background-color: #252525;
    color: #f5f5f5;
}

body:not(.finhub-page) #company-modal .modal-header,
body:not(.finhub-page) #news-modal .modal-header,
body:not(.finhub-page) #historical-modal .modal-header {
    background-color: #2a2a2a;
    color: #ffffff;
    border-bottom: 1px solid #444;
}

body:not(.finhub-page) #company-modal .modal-footer,
body:not(.finhub-page) #news-modal .modal-footer,
body:not(.finhub-page) #historical-modal .modal-footer {
    background-color: #2a2a2a;
    border-top: 1px solid #444;
}

/* Company modal specific fixes */
body:not(.finhub-page) #company-modal #company-name {
    color: #ffffff;
}

body:not(.finhub-page) #company-modal .company-symbol {
    color: #b0b0b0;
}

body:not(.finhub-page) #company-modal .company-price #company-price {
    color: #f5f5f5;
}

body:not(.finhub-page) #company-modal h5 {
    color: #ffffff;
    border-bottom: 1px solid #444;
}

body:not(.finhub-page) #company-modal .table td:first-child {
    color: #b0b0b0;
}

body:not(.finhub-page) #company-modal .table td:last-child {
    color: #f5f5f5;
}

body:not(.finhub-page) #company-modal #company-description {
    color: #e0e0e0;
}

body:not(.finhub-page) #company-modal .news-date {
    color: #b0b0b0;
}

body:not(.finhub-page) #company-modal .news-title a {
    color: #6ea8fe;
}

/* Toast notification fixes */
body:not(.finhub-page) .toast {
    background-color: #252525;
    color: #f5f5f5;
}

body:not(.finhub-page) .toast .toast-header {
    background-color: #2a2a2a;
    color: #f5f5f5;
    border-bottom: 1px solid #444;
}

body:not(.finhub-page) .toast.success-toast .toast-header {
    background-color: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

body:not(.finhub-page) .toast.error-toast .toast-header {
    background-color: rgba(248, 113, 113, 0.2);
    color: #f87171;
}

body:not(.finhub-page) .toast.warning-toast .toast-header {
    background-color: rgba(252, 211, 77, 0.2);
    color: #fcd34d;
}

body:not(.finhub-page) .toast.info-toast .toast-header {
    background-color: rgba(77, 171, 247, 0.2);
    color: #4dabf7;
}

/* Fix data source and timestamp displays */
.data-source, .last-updated {
    color: #b0b0b0;
}

.data-source.fallback {
    background-color: rgba(252, 211, 77, 0.2);
    color: #fcd34d;
}

/* Fix the symbol search modal */
#symbol-search-modal .modal-content {
    background-color: #252525;
    color: #f5f5f5;
}

#symbol-search-modal .modal-header {
    background-color: #2a2a2a;
    border-bottom: 1px solid #444;
}

#symbol-search-modal .modal-footer {
    background-color: #2a2a2a;
    border-top: 1px solid #444;
}

#symbol-search-input {
    background-color: #1e1e1e;
    color: #f5f5f5;
    border: 1px solid #444;
}

#symbol-search-results .list-group-item {
    background-color: #2a2a2a;
    color: #f5f5f5;
    border: 1px solid #444;
}

#symbol-search-results .list-group-item:hover {
    background-color: #333;
}

/* Fix list group items */
.list-group-item {
    background-color: #2a2a2a;
    color: #f5f5f5;
    border-color: #444;
}

.list-group-item-action:hover {
    background-color: #333;
    color: #ffffff;
}

/* Fix tooltip text color */
.tooltip {
    color: #f5f5f5;
}

.tooltip-inner {
    background-color: #1e1e1e;
    color: #f5f5f5;
    border: 1px solid #444;
}

/* Market data source indicators */
#hsi-data-source, 
#forex-data-source,
#constituents-data-source,
#news-data-source {
    background-color: #333;
    color: #b0b0b0;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* Chart controls and labels */
.chart-controls {
    color: #e0e0e0;
}

.chart-label {
    fill: #e0e0e0;
}

.chart-axis path,
.chart-axis line {
    stroke: #666;
}

.chart-axis text {
    fill: #b0b0b0;
}

.chart-tooltip {
    background-color: #252525;
    color: #f5f5f5;
    border: 1px solid #444;
}

/* Financial cards */
.forex-pair-card {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0.5rem;
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.forex-pair-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.forex-pair-card h5 {
    color: var(--text-primary);
    font-weight: 600;
}

.forex-pair-card .label {
    color: var(--text-muted);
    font-weight: 400;
}

.forex-pair-card #forex-bid,
.forex-pair-card #forex-ask,
.forex-pair-card #forex-change {
    color: var(--text-primary);
    font-weight: 600;
}

/* Fix for card text */
.card-text {
    color: var(--text-secondary);
}

/* Fix for news items in market news */
.news-item h3.news-title {
    color: var(--text-primary);
}

.news-item .news-summary,
.news-item .news-content {
    color: var(--text-secondary);
}

/* Delayed data indicator */
#hsi-delay-indicator {
    background-color: #ffb300;
    color: #212121;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Symbol search — scoped to legacy dark navbar only */
body:not(.finhub-page) #symbol-search-btn {
    color: #f5f5f5;
}

/* Footer improvements */
body:not(.finhub-page) footer {
    background-color: #1a1a1a !important;
}

body:not(.finhub-page) footer p {
    color: #e0e0e0;
}

body:not(.finhub-page) footer .small {
    color: #b0b0b0;
}

/* Chart legends */
body:not(.finhub-page) .chart-legend {
    color: #e0e0e0;
}

.chart-legend-item {
    margin-right: 1rem;
    display: inline-flex;
    align-items: center;
}

.chart-legend-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 5px;
    border-radius: 2px;
}

/* Improve tooltips */
.bootstrap-tooltip {
    background-color: #252525 !important;
    color: #f5f5f5 !important;
    border: 1px solid #444 !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
}

/* Performance Optimization Classes */
.optimize-performance * {
    animation: none !important;
    transition: none !important;
    transform: none !important;
}

.optimize-performance .non-essential {
    display: none !important;
}

.optimize-performance .chart-container {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.optimize-performance .table-container {
    contain: content;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Modern UI Component Enhancements */

/* Glassmorphism Effect for Cards */
.card.glass-effect {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Modern Data Badge */
.data-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.data-badge i {
    margin-right: 0.5rem;
    font-size: 0.875rem;
}

/* Enhanced Value Display */
.value-display {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.value-display .amount {
    font-size: 2rem;
    font-weight: 700;
    font-feature-settings: "tnum" 1;
    line-height: 1;
}

.value-display .currency {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Modern Loading Spinner */
.loading-spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spinner 0.6s linear infinite;
}

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

/* Enhanced Chart Controls */
.chart-controls {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.chart-controls button {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

/* Modern Tabs */
.modern-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.modern-tabs button {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.modern-tabs button.active {
    background: var(--accent-blue);
    color: white;
}

/* Enhanced Status Indicator */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-indicator.live {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-indicator.delayed {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status-indicator::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: currentColor;
}

.status-indicator.live::before {
    animation: pulse 2s infinite;
}

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

/* Modern Search Input */
.search-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    width: 100%;
    transition: all 0.2s ease;
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}

/* Enhanced News Item */
.news-item {
    padding: 1rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.news-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Modern Tooltip */
.modern-tooltip {
    position: relative;
    display: inline-block;
}

.modern-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: var(--bg-dark);
    color: var(--text-primary);
    border-radius: 0.375rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modern-tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-0.5rem);
}

/* Market Movers Enhancement */
.market-movers-card {
    height: 100%;
    background-color: var(--bg-card) !important;
    border: 1px solid #e5e7eb !important;
}

.market-movers-card .card-header {
    background: linear-gradient(to right, #f9fafb, #ffffff) !important;
    color: var(--text-primary) !important;
    padding: 1rem !important;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb !important;
}

.market-movers-card.gainers {
    border-left: 3px solid var(--success) !important;
}

.market-movers-card.losers {
    border-left: 3px solid var(--danger) !important;
}

.market-movers-table {
    --bs-table-bg: var(--bg-card) !important;
    --bs-table-color: var(--text-primary) !important;
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    margin-bottom: 0 !important;
}

.market-movers-table thead th {
    --bs-table-bg: #f9fafb !important;
    background-color: #f9fafb !important;
    color: var(--text-muted) !important;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.market-movers-table tbody tr {
    --bs-table-bg: var(--bg-card) !important;
    background-color: var(--bg-card) !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.market-movers-table tbody tr:hover {
    --bs-table-hover-bg: var(--bg-hover) !important;
    background-color: var(--bg-hover) !important;
    cursor: pointer;
}

.market-movers-table td {
    padding: 0.75rem 1rem !important;
    color: var(--text-primary) !important;
    background-color: transparent !important;
}

.market-movers-table .company-name {
    color: var(--text-primary) !important;
    font-weight: 500 !important;
}

.market-movers-table .change-value {
    font-family: 'IBM Plex Mono', monospace !important;
    font-weight: 600 !important;
    text-align: right !important;
}

.market-movers-table .change-value.positive {
    color: var(--success) !important;
}

.market-movers-table .change-value.negative {
    color: var(--danger) !important;
}

.market-movers-table .market-mover-row {
    cursor: pointer;
}

.market-movers-table .market-mover-row:hover td {
    background-color: rgba(37, 99, 235, 0.06) !important;
}

.market-movers-table .mover-company-label {
    display: block;
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.8rem;
    margin-top: 0.1rem;
}

.market-movers-table .company-name strong {
    color: var(--text-primary);
}

/* Loading State */
.market-movers-table tr td.text-center {
    color: var(--text-secondary) !important;
    padding: 1.5rem !important;
    font-style: italic;
}

/* Global Markets Panel */
.global-market-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 1rem;
    height: 100%;
    transition: border-color 0.2s, transform 0.2s;
}

.global-market-card:hover {
    border-color: rgba(56, 189, 248, 0.35);
    transform: translateY(-2px);
    cursor: pointer;
}

.portfolio-stress-card {
    border-color: rgba(16, 185, 129, 0.25);
    background: rgba(16, 185, 129, 0.06);
}

.global-market-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.global-market-name {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
}

.global-market-price {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'IBM Plex Mono', monospace;
    margin-bottom: 0.25rem;
}

.global-market-change {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.global-market-change.positive { color: var(--success); }
.global-market-change.negative { color: var(--danger); }

.global-market-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.opportunity-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.opportunity-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.opportunity-score {
    font-weight: 700;
    color: var(--accent-blue);
    white-space: nowrap;
}

.opportunity-thesis {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.opportunity-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.35rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.opportunity-details .label {
    color: var(--text-muted);
}

.opportunity-stress {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 0.5rem;
}

.opportunity-backtest {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 0.5rem;
    line-height: 1.4;
    font-size: 0.8rem;
}

.opportunity-backtest-text {
    color: var(--text-secondary);
}

.opportunity-news {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(56, 189, 248, 0.08);
    border-radius: 0.5rem;
    border-left: 3px solid var(--accent-blue);
}

.watchlist-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.watchlist-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.watchlist-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.watchlist-backtest-result {
    line-height: 1.4;
}