
.status-open {
    color: #48bb78;
    font-weight: bold;
}

.status-closed {
    color: #f56565;
    font-weight: bold;
}

/* Warning Banner */
.warning-banner {
    background: #fed7d7;
    border-left: 4px solid #f56565;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.warning-banner h3 {
    color: #c53030;
    margin-bottom: 8px;
}

.warning-banner p {
    color: #742a2a;
}

/* Market Context */
.market-context {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.context-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.context-card h4 {
    color: #718096;
    font-size: 14px;
    margin-bottom: 8px;
}

.context-card p {
    font-size: 24px;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 5px;
}

.change {
    font-size: 14px;
    font-weight: 600;
}

.change.positive {
    color: #48bb78;
}

.change.negative {
    color: #f56565;
}

/* Controls */
.controls {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
}

.btn-secondary {
    background: #edf2f7;
    color: #2d3748;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

#searchStock {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
}

#filterTier {
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
}

/* Opportunities Section */
.opportunities {
    margin-bottom: 20px;
}

.opportunities > h2 {
    color: white;
    margin-bottom: 20px;
    font-size: 28px;
}

/* Tier Section Scrollable Container */
.tier-section {
    background: #252526;
    border: 1px solid #3c3c3c;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    max-height: 500px; /* Adjust this value as needed */
}

.tier-section h3 {
    flex-shrink: 0; /* Keep header fixed */
        margin-bottom: 5px;
}

/* Stock Grid Container - Enable Vertical Scroll */
#tier1Container,
#tier2Container,
#tier3Container,
#tier4Container {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 450px; /* Adjust based on your needs */
    padding: 8px;
    overflow: scroll;
    z-index: 0;
}

/* Stock Grid maintains grid layout but scrolls */
.tier-section .stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
    background-color: #050505;
    /* Remove any height constraints that might exist */
}

/* Scrollbar Styling for Tier Containers */
#tier1Container::-webkit-scrollbar,
#tier2Container::-webkit-scrollbar,
#tier3Container::-webkit-scrollbar,
#tier4Container::-webkit-scrollbar {
    width: 6px;
}

#tier1Container::-webkit-scrollbar-track,
#tier2Container::-webkit-scrollbar-track,
#tier3Container::-webkit-scrollbar-track,
#tier4Container::-webkit-scrollbar-track {
    background: #1e1e1e;
}

#tier1Container::-webkit-scrollbar-thumb,
#tier2Container::-webkit-scrollbar-thumb,
#tier3Container::-webkit-scrollbar-thumb,
#tier4Container::-webkit-scrollbar-thumb {
    background: rgba(76, 201, 240, 0.5);
    border-radius: 3px;
}

#tier1Container::-webkit-scrollbar-thumb:hover,
#tier2Container::-webkit-scrollbar-thumb:hover,
#tier3Container::-webkit-scrollbar-thumb:hover,
#tier4Container::-webkit-scrollbar-thumb:hover {
    background: rgba(76, 201, 240, 0.8);
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {

    #tier1Container,
    #tier2Container,
    #tier3Container,
    #tier4Container {
        max-height: 350px;
    }
    
    .tier-section .stock-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
    }
}

.expiry-date {
    font-weight: 600;
    color: #4cc9f0;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.aggressive-expiry {
    display: block;
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(76, 201, 240, 0.2);
    font-weight: 600;
    color: #4cc9f0;
}


.stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 15px;
}

.stock-card {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    contain: layout style paint;  /* CSS containment for performance */
    will-change: transform;  /* Hint browser to optimize */
}

.stock-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.stock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.stock-ticker {
    font-size: 20px;
    font-weight: bold;
    color: #2d3748;
}

.stock-score {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.stock-price {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.stock-info {
    font-size: 13px;
    color: #718096;
    margin-bottom: 5px;
}

.pin-risk {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 8px;
}

.pin-risk.high {
    background: #fed7d7;
    color: #c53030;
}

.pin-risk.moderate {
    background: #feebc8;
    color: #c05621;
}

.pin-risk.low {
    background: #c6f6d5;
    color: #276749;
}

.pin-risk.none {
    background: #e6fffa;
    color: #234e52;
}

.catalyst {
    background: white;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
    border-left: 3px solid #667eea;
}

.catalyst-title {
    font-weight: 600;
    color: #2d3748;
    font-size: 13px;
    margin-bottom: 5px;
}

.catalyst-desc {
    font-size: 12px;
    color: #718096;
}

.no-data {
    color: #a0aec0;
    text-align: center;
    padding: 40px;
    font-style: italic;
}

/* Alerts Section */
.alerts {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.alerts h2 {
    margin-bottom: 15px;
    color: #2d3748;
}

.alert-card {
    background: #fff5f5;
    border-left: 4px solid #f56565;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.alert-header {
    font-size: 18px;
    font-weight: bold;
    color: #c53030;
    margin-bottom: 10px;
}

.alert-timeline {
    font-size: 13px;
    color: #742a2a;
    line-height: 1.8;
}

.alert-recommendation {
    background: white;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
    font-weight: 600;
    color: #2d3748;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    border: 3px solid #37373d;
    border-top: 3px solid #4CC9F0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    color: white;
    margin-top: 20px;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .stock-grid {
        grid-template-columns: 1fr;
    }
    
    .controls {
        flex-direction: column;
    }
    
    #searchStock {
        width: 100%;
    }
}

/* Enhanced CSS for New Options Data Display */

/* Add to css/style.css */

/* Stock Card Metrics Grid */
.stock-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 10px 0;
    font-size: 12px;
}

.metric {
    display: flex;
    justify-content: space-between;
    padding: 5px;
    background: #060505;
    border-radius: 4px;
}

.metric-label {
    color: #ffffff;
    font-weight: 500;
    text-transform: uppercase;
}

.metric-value {
    color: #dedede;
    font-weight: 400;
}

/* OI Strikes Display */
.oi-strikes {
    background: white;
    border-radius: 6px;
    padding: 10px;
    margin-top: 10px;
    border: 1px solid #e2e8f0;
}

.oi-header {
    font-size: 11px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.oi-strike {
    font-size: 11px;
    padding: 4px 0;
    color: #2d3748;
    display: flex;
    justify-content: space-between;
}

.oi-ratio {
    color: #718096;
    font-size: 10px;
}

/* Estimated Data Badge */
.badge-estimated {
    background: #feebc8;
    color: #c05621;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 8px;
}

.stock-card.estimated-data {
    border-left: 3px solid #ed8936;
}

/* Pump & Fade Warning in Card */
.pump-fade-warning {
    background: #fff5f5 !important;
    border-left-color: #f56565 !important;
}



@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}



@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}



/* Detail Sections */


.detail-section h3 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
    font-size: 18px;
    color: #4CC9F0;
    font-weight: 500;

}
.detail-section {
    padding: 16px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #525558 120%, #91959a 100%);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: auto;
}


.detail-grid #text {
    color: #171616;
    font-weight: 500;
}
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.detail-grid > div {
    padding: 12px;
    background: #f7fafc;
    color: #252526;
    border-radius: 6px;
    font-size: 14px;
}

.detail-grid strong {
    color: #4a5568;
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}


.detail-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: auto;
}


.detail-section h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: #4CC9F0;
}

.detail-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.detail-metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-table td {
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 13px;
}

.detail-table td:nth-child(odd) {
    color: rgba(255, 255, 255, 0.6);
}

.detail-table td:nth-child(even) {
    color: #fff;
    font-weight: 600;
}


/* OI Table */
.oi-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    overflow-y: scroll;
}

.oi-table thead {
    background: #55595b;
}

.oi-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    /* color: #4a5568; */
    border-bottom: 2px solid #e2e8f0;
}

.oi-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    /* color: #2d3748; */
}

.oi-table tbody tr:hover {
    background: #f7fafc;
}

/* Tier Badge in Modal */
.tier-badge {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 15px;
}

.tier-badge.tier1 {
    background: #c6f6d5;
    color: #276749;
}

.tier-badge.tier2 {
    background: #fef5e7;
    color: #b7791f;
}

.tier-badge.tier3 {
    background: #fed7d7;
    color: #c53030;
}

.tier-badge.tier4 {
    background: #feb2b2;
    color: #742a2a;
}

/* Warning Box */
.warning-box {
    background: #fff5f5;
    border-left: 4px solid #f56565;
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
    color: #742a2a;
    font-size: 14px;
    line-height: 1.6;
}

/* Recommendation Box */
.recommendation-box {
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    font-size: 14px;
    line-height: 1.8;
    color: #2d3748;
}

.recommendation-box strong {
    color: #667eea;
    font-size: 16px;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 100%;
        max-height: 100vh;
    }
    

    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .oi-table {
        font-size: 12px;
    }
    
    .oi-table th,
    .oi-table td {
        padding: 8px 4px;
    }
}

/* Loading Progress Enhancement */
.loading-overlay p {
    color: white;
    margin-top: 20px;
    font-size: 16px;
    font-weight: 600;
}

/* Smooth transitions */
.stock-card,
.metric,
.oi-strikes {
    transition: all 0.3s ease;
}

/* Hover effects */
.stock-card:hover .oi-strikes {
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

/* Additional indicator badges */
.badge-high-oi {
    background: #bee3f8;
    color: #2c5282;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 5px;
}

.badge-high-iv {
    background: #fef5e7;
    color: #b7791f;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 5px;
}

/* Gamma exposure indicator */
.gamma-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}

.gamma-indicator.high {
    background: #f56565;
}

.gamma-indicator.moderate {
    background: #ed8936;
}

.gamma-indicator.low {
    background: #48bb78;
}
/* Add load more button styles */
.btn-load-more {
    width: 100%;
    padding: 15px;
    margin-top: 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.btn-load-more:hover {
    background: #5a67d8;
}
.vix-source {
    font-size: 9px;
    color: #a0aec0;
    font-weight: normal;
    text-transform: uppercase;
}


/* Profitability Section Styles */

.profitability-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.metric-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #e2e8f0;
    transition: transform 0.2s;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.metric-card.overpriced {
    border-color: #fc8181;
    background: #fff5f5;
}

.metric-card.underpriced {
    border-color: #68d391;
    background: #f0fff4;
}

.metric-card.fair {
    border-color: #90cdf4;
    background: #ebf8ff;
}



.metric-value-large {
    font-size: 14px;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 5px;
}

.metric-subtext {
    font-size: 11px;
    color: #a0aec0;
}

/* Trade Ideas */
.trade-ideas {
    margin-top: 20px;
}

.trade-ideas h4 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 16px;
}

.trade-idea {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
}

.trade-idea.primary {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.trade-idea-header {
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.75em
}

.trade-type {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.trade-type.sell-premium {
    background: #c6f6d5;
    color: #276749;
}

.trade-type.buy-premium {
    background: #bee3f8;
    color: #2c5282;
}

.trade-type.max-pain-reversion {
    background: #fef5e7;
    color: #b7791f;
}

.trade-type.buy-volatility {
    background: #e9d8fd;
    color: #553c9a;
}

.trade-type.avoid {
    background: #fed7d7;
    color: #c53030;
}

.trade-strategy {
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
    float: right;
}

.trade-strikes {
    background: #050505;
    padding: 8px 12px;
    border-radius: 4px;
    margin: 8px 0;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.trade-reasoning {
    color: #4a5568;
    font-size: 13px;
    line-height: 1.6;
    margin: 10px 0;
}

.trade-metrics {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #718096;
    margin-top: 10px;
}

.trade-target {
    background: #edf2f7;
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 8px;
    font-size: 13px;
    color: #2d3748;
}

.profitability-recommendation {
    background: #667eea;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.6;
}

.profitability-recommendation strong {
    display: block;
    margin-bottom: 5px;
    font-size: 16px;
}

/* Exploit Analysis Styles */
.exploit-analysis {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #fff5f5 0%, #fffaf0 100%);
    border-radius: 8px;
    border: 2px solid #fc8181;
}

.exploit-analysis h4 {
    color: #c53030;
    margin-bottom: 15px;
    font-size: 16px;
}

.exploit-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #e2e8f0;
}

.exploit-card.gamma-exposure {
    border-left-color: #9f7aea;
}

.exploit-card.hedging-pressure {
    border-left-color: #ed8936;
}

.exploit-card.uncovered-positions {
    border-left-color: #f56565;
}

.exploit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.exploit-label {
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
}

.exploit-value {
    font-size: 20px;
    font-weight: bold;
}

.exploit-value.positive {
    color: #48bb78;
}

.exploit-value.negative {
    color: #f56565;
}

.exploit-badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.exploit-badge.upward {
    background: #c6f6d5;
    color: #276749;
}

.exploit-badge.downward {
    background: #fed7d7;
    color: #c53030;
}

.exploit-badge.pinning {
    background: #feebc8;
    color: #c05621;
}

.exploit-badge.neutral {
    background: #e2e8f0;
    color: #4a5568;
}

.exploit-detail {
    font-size: 13px;
    color: #4a5568;
    line-height: 1.6;
}

.exploit-opportunity {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
}

.exploit-opportunity.high {
    background: #c6f6d5;
    color: #276749;
}

.exploit-opportunity.low {
    background: #e2e8f0;
    color: #718096;
}

.flow-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 10px 0;
    font-size: 12px;
}

.dealer-flow {
    background: #f7fafc;
    padding: 12px;
    border-radius: 6px;
    margin-top: 12px;
}

.dealer-flow h5 {
    font-size: 13px;
    color: #2d3748;
    margin-bottom: 8px;
}

.dealer-flow p {
    font-size: 12px;
    color: #4a5568;
    margin-bottom: 8px;
}

.flow-impact {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.flow-impact.high {
    background: #fc8181;
    color: white;
}

.flow-impact.moderate {
    background: #f6ad55;
    color: white;
}

.risk-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.risk-badge.high {
    background: #fc8181;
    color: white;
}

.risk-badge.moderate {
    background: #f6ad55;
    color: white;
}

.uncovered-list {
    margin-top: 12px;
}

.uncovered-list h5 {
    font-size: 13px;
    color: #2d3748;
    margin-bottom: 8px;
}

.uncovered-item {
    background: #f7fafc;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 12px;
}

.uncovered-item strong {
    color: #2d3748;
    font-size: 14px;
}

.risk-note {
    display: block;
    margin-top: 5px;
    color: #718096;
    font-style: italic;
    font-size: 11px;
}


/* Order Flow Section Styles */
.order-flow-section {
    background: linear-gradient(135deg, #525558 120%, #91959a 100%);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

/* Combined Sentiment */
.combined-sentiment {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid #e2e8f0;
}

.combined-sentiment.bullish {
    border-color: #48bb78;
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
}

.combined-sentiment.bearish {
    border-color: #f56565;
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
}

.combined-sentiment.neutral {
    border-color: #90cdf4;
}

.sentiment-header {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}

.sentiment-badge {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 16px;
}

.combined-sentiment.bullish .sentiment-badge {
    background: #48bb78;
    color: white;
}

.combined-sentiment.bearish .sentiment-badge {
    background: #f56565;
    color: white;
}

.combined-sentiment.neutral .sentiment-badge {
    background: #4299e1;
    color: white;
}

.confidence-badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.confidence-badge.high {
    background: #38a169;
    color: white;
}

.confidence-badge.moderate {
    background: #ed8936;
    color: white;
}

.confidence-badge.low {
    background: #a0aec0;
    color: white;
}

.sentiment-signals {
    display: flex;
    gap: 20px;
    margin: 15px 0;
}

.signal-count {
    flex: 1;
    text-align: center;
    padding: 15px;
    border-radius: 6px;
}

.signal-count.bullish {
    background: #c6f6d5;
}

.signal-count.bearish {
    background: #fed7d7;
}

.signal-count .count {
    display: block;
    font-size: 32px;
    font-weight: bold;
    color: #2d3748;
}

.signal-count .label {
    display: block;
    font-size: 12px;
    color: #718096;
    text-transform: uppercase;
    margin-top: 5px;
}

.sentiment-reasoning {
    background: #f7fafc;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #4a5568;
    line-height: 1.8;
}

.signal-item {
    padding: 4px 0;
}

/* Flow Subsections */
.flow-subsection {
    background: linear-gradient(135deg, #ebf8ff 100%, #bee3f8 0%);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    padding: 2px;
    margin-top: 15px;
}

.flow-subsection h4 {
    color: #2d3748;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.flow-subsection h5 {
    color: #4a5568;
    font-size: 14px;
    margin: 15px 0 10px 0;
}

/* Flow Metrics Grid */
.flow-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.flow-metric {
    background: #f7fafc;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #cbd5e0;
}

.flow-metric.bullish {
    border-left-color: #48bb78;
    background: #f0fff4;
}

.flow-metric.bearish {
    border-left-color: #f56565;
    background: #fff5f5;
}

.flow-metric.neutral {
    border-left-color: #90cdf4;
    background: #ebf8ff;
}

.flow-metric .metric-label {
    font-size: 11px;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.flow-metric .metric-value {
    font-size: 14px;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 3px;
}

.flow-metric .metric-value.positive {
    color: #38a169;
}

.flow-metric .metric-value.negative {
    color: #e53e3e;
}

.flow-metric .metric-subtext {
    font-size: 11px;
    color: #a0aec0;
}

/* Large Orders Section */
.large-orders-section {
    margin-top: 20px;
    background: #f7fafc;
    border-radius: 6px;
}

.large-orders-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.large-orders-column {
    background: white;
    border-radius: 6px;
    overflow: hidden;
}

.column-header {
    padding: 10px 15px;
    font-weight: 600;
    font-size: 13px;
    color: white;
}

.column-header.buy {
    background: #48bb78;
}

.column-header.sell {
    background: #f56565;
}

.column-header.call {
    background: #4299e1;
}

.column-header.put {
    background: #ed8936;
}

.orders-list {
    padding: 10px;
}

.order-item {
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    font-size: 12px;
    border-left: 3px solid;
}

.order-item.buy {
    background: #f0fff4;
    border-left-color: #48bb78;
}

.order-item.sell {
    background: #fff5f5;
    border-left-color: #f56565;
}

.order-main {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
}

.order-size {
    font-weight: 600;
    color: #2d3748;
}

.order-price {
    color: #718096;
}

.order-value {
    font-weight: bold;
    color: #2d3748;
    margin: 3px 0;
}

.order-time {
    font-size: 10px;
    color: #a0aec0;
}

/* Price Levels Section */
.price-levels-section {
    margin-top: 20px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 6px;
}

.levels-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.levels-column {
    background: white;
    border-radius: 6px;
    overflow: hidden;
}

.levels-header {
    padding: 10px 15px;
    font-weight: 600;
    font-size: 13px;
    color: white;
}

.levels-header.support {
    background: #48bb78;
}

.levels-header.resistance {
    background: #f56565;
}

.level-item {
    padding: 10px 15px;
    border-left: 3px solid;
    margin: 5px;
    border-radius: 4px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.level-item.support {
    background: #f0fff4;
    border-left-color: #48bb78;
}

.level-item.resistance {
    background: #fff5f5;
    border-left-color: #f56565;
}

.level-price {
    font-weight: bold;
    color: #2d3748;
    font-size: 14px;
}

.level-volume, .level-ratio {
    font-size: 11px;
    color: #718096;
}

/* Aggressive Options Activity */
.aggressive-flow-section {
    margin-top: 20px;
    padding: 15px;
    background: #fffaf0;
    border-radius: 6px;
    border: 2px solid #ed8936;
}

.aggressive-flow-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.aggressive-column {
    background: white;
    border-radius: 6px;
    overflow: hidden;
}

.aggressive-list {
    padding: 10px;
}

.aggressive-item {
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    font-size: 12px;
    border-left: 3px solid;
}

.aggressive-item.call {
    background: #ebf8ff;
    border-left-color: #4299e1;
}

.aggressive-item.put {
    background: #feebc8;
    border-left-color: #ed8936;
}

.aggressive-main {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
}

.aggressive-strike {
    font-weight: 600;
    color: #2d3748;
}

.aggressive-size {
    color: #718096;
}

.aggressive-value {
    font-weight: bold;
    color: #2d3748;
    margin: 3px 0;
}

.aggressive-time {
    font-size: 10px;
    color: #a0aec0;
}

/* Active Strikes Table */
.active-strikes-section {
    margin-top: 20px;
}

.active-strikes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: white;
}

.active-strikes-table thead {
    background: #f7fafc;
}

.active-strikes-table th {
    padding: 10px;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    border-bottom: 2px solid #e2e8f0;
    font-size: 11px;
    text-transform: uppercase;
}

.active-strikes-table td {
    padding: 10px;
    border-bottom: 1px solid #e2e8f0;
    color: #2d3748;
}

.active-strikes-table td.call {
    color: #4299e1;
    font-weight: 600;
}

.active-strikes-table td.put {
    color: #ed8936;
    font-weight: 600;
}

.aggressive-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    margin-right: 4px;
}

.aggressive-badge.call {
    background: #bee3f8;
    color: #2c5282;
}

.aggressive-badge.put {
    background: #feebc8;
    color: #c05621;
}

/* Unusual Activity Alert */
.unusual-activity-alert {
    background: #fff5f5;
    border: 2px solid #fc8181;
    border-radius: 6px;
    padding: 15px;
    margin-top: 20px;
}

.unusual-activity-alert h5 {
    color: #c53030;
    margin-bottom: 10px;
}

.unusual-item {
    padding: 8px;
    background: white;
    border-radius: 4px;
    margin-bottom: 6px;
    font-size: 13px;
    color: #2d3748;
}

/* Flow Insights */
.flow-insights {
    background: #edf2f7;
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
}

.flow-insights h5 {
    color: #2d3748;
    margin-bottom: 10px;
}

.insights-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.insight-item {
    padding: 10px;
    background: white;
    border-radius: 4px;
    border-left: 3px solid #667eea;
    font-size: 13px;
    color: #4a5568;
}

/* Responsive */
@media (max-width: 768px) {
    .large-orders-grid,
    .levels-grid,
    .aggressive-flow-grid {
        grid-template-columns: 1fr;
    }
    
    .flow-metrics-grid {
        grid-template-columns: 1fr;
    }
}

/* Order Flow Badge on Stock Cards */
.order-flow-badge {
    margin: 10px 0;
    padding: 10px;
    border-radius: 6px;
    border-left: 4px solid;
    background: #f7fafc;
}

.order-flow-badge.bullish {
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
    border-left-color: #48bb78;
}

.order-flow-badge.bearish {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    border-left-color: #f56565;
}

.order-flow-badge.neutral {
    background: linear-gradient(135deg, #ebf8ff 0%, #bee3f8 100%);
    border-left-color: #4299e1;
}

.flow-badge-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.flow-icon {
    font-size: 14px;
}

.flow-sentiment {
    font-weight: 700;
    font-size: 13px;
    color: #2d3748;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.flow-confidence {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: auto;
}

.flow-confidence.high {
    background: #38a169;
    color: white;
}

.flow-confidence.moderate {
    background: #ed8936;
    color: white;
}

.flow-confidence.low {
    background: #a0aec0;
    color: white;
}

.flow-badge-signals {
    display: flex;
    gap: 10px;
}

.signal-mini {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.signal-mini.bullish {
    background: #c6f6d5;
    color: #22543d;
}

.signal-mini.bearish {
    background: #fed7d7;
    color: #742a2a;
}
.order-flow-badge {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.stock-card:hover .order-flow-badge {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ============================================================================
   DASHBOARD TAB STYLES - VSCode Theme Integration
   Updated to match the rest of the application's dark VSCode aesthetic
   ============================================================================ */

/* Dashboard Container - Override legacy styles */
.panel-content {
  flex: 1;
  padding: 2px 5px;
  overflow: scroll;
  z-index: 0;
  max-width: 100%;
}
.panel-content .container {
    background: transparent;
    padding: 0;
    max-width: 100%;
}

/* Header Section - VSCode style */
.panel-content header {
    background: #252526;
    border-bottom: 1px solid #3c3c3c;
    padding: 16px 20px;
    margin: 0 0 16px 0;
    border-radius: 4px;
}

.panel-content header h1 {
    color: #d4d4d4;
    font-size: 18px;
    font-weight: 500;
    margin: 0 0 8px 0;
    font-family: 'JetBrains Mono', monospace;
}

.panel-content .header-info {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: #858585;
}

.panel-content .header-info span {
    padding: 4px 8px;
    background: #2d2d30;
    border-radius: 3px;
}

/* Market Context Cards - VSCode theme */
.market-context {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.context-card {
    background: #252526;
    padding: 16px;
    border-radius: 4px;
    border: 1px solid #3c3c3c;
    text-align: center;
    transition: border-color 0.2s;
}

.context-card:hover {
    border-color: #4CC9F0;
}



.context-card .change {
    font-size: 12px;
    font-weight: 500;
}

.context-card .change.positive {
    color: #06D6A0;
}

.context-card .change.negative {
    color: #EF476F;
}

.vix-source {
    font-size: 10px;
    color: #858585;
    margin-left: 4px;
}

/* Controls Panel - VSCode style */
.controls {
    background: #252526;
    padding: 12px 16px;
    border-radius: 4px;
    border: 1px solid #3c3c3c;
    margin-bottom: 16px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-primary, .btn-secondary, .btn-view-toggle {
    padding: 6px 12px;
    border: 1px solid #3c3c3c;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
    background: #2d2d30;
    color: #d4d4d4;
    font-family: 'JetBrains Mono', monospace;
}

.btn-primary {
    background: #4CC9F0;
    color: #1e1e1e;
    border-color: #4CC9F0;
}

.btn-primary:hover {
    background: #3ab3d9;
    border-color: #3ab3d9;
}

.btn-secondary:hover, .btn-view-toggle:hover {
    background: #37373d;
    border-color: #4CC9F0;
}

.btn-view-toggle.active {
    background: #4CC9F0;
    color: #1e1e1e;
    border-color: #4CC9F0;
}

.controls input[type="text"],
.controls select {
    padding: 6px 12px;
    background: #2d2d30;
    border: 1px solid #3c3c3c;
    border-radius: 3px;
    color: #d4d4d4;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    outline: none;
}

.controls input[type="text"]:focus,
.controls select:focus {
    border-color: #4CC9F0;
}

.universe-count {
    color: #858585;
    font-size: 12px;
    margin-left: auto;
}

/* Opportunities Section */
.opportunities {
    margin-bottom: 20px;
}

.opportunities h2 {
    color: #d4d4d4;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 16px;
    font-family: 'JetBrains Mono', monospace;
}


/* Grid View - Improved card layout */
.stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
}

.stock-card {
    background: #2d2d30;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #3c3c3c;
    transition: all 0.2s;
    cursor: pointer;
}

.stock-card:hover {
    border-color: #4CC9F0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 201, 240, 0.15);
}

.stock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.stock-ticker {
    font-size: 14px;
    font-weight: 600;
    color: #4CC9F0;
    font-family: 'JetBrains Mono', monospace;
}

.stock-score {
    background: #37373d;
    color: #FFD166;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.stock-price {
    font-size: 16px;
    font-weight: 600;
    color: #d4d4d4;
    margin-bottom: 8px;
}

.stock-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
}

.metric {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
}



.pin-risk {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    margin-top: 6px;
}

.pin-risk.high {
    background: rgba(239, 71, 111, 0.2);
    color: #EF476F;
}

.pin-risk.moderate {
    background: rgba(255, 209, 102, 0.2);
    color: #FFD166;
}

.pin-risk.low {
    background: rgba(6, 214, 160, 0.2);
    color: #06D6A0;
}

/* Table View - NEW for better data analysis */
.stock-table {
    width: 100%;
    border-collapse: collapse;
    background: #2d2d30;
    border: 1px solid #3c3c3c;
    border-radius: 4px;
    overflow: scroll;
}

.stock-table thead {
    background: #37373d;
    position: sticky;
    top: 0;
    z-index: 10;
}

.stock-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #858585;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #3c3c3c;
    cursor: pointer;
    user-select: none;
}

.stock-table th:hover {
    color: #4CC9F0;
}

.stock-table th.sortable::after {
    content: ' ↕';
    opacity: 0.5;
}

.stock-table th.sort-asc::after {
    content: ' ↑';
    opacity: 1;
    color: #4CC9F0;
}

.stock-table th.sort-desc::after {
    content: ' ↓';
    opacity: 1;
    color: #4CC9F0;
}

.stock-table tbody tr {
    border-bottom: 1px solid #3c3c3c;
    transition: background-color 0.2s;
    cursor: pointer;
}

.stock-table tbody tr:hover {
    background: #37373d;
}

.stock-table td {
    padding: 10px 12px;
    font-size: 12px;
    color: #d4d4d4;
}

.stock-table .symbol-cell {
    color: #4CC9F0;
    font-weight: 600;
}

.stock-table .positive {
    color: #06D6A0;
}

.stock-table .negative {
    color: #EF476F;
}

/* Override panel z-index for ARIMA modal */
#arima-modal {
  position: fixed !important;
  z-index: 99999 !important;
  width: 100vw !important;
  height: 100vh !important;
  top: 0 !important;
  left: 0 !important;
}



/* Modal Improvements - Per-stock refresh button */
.modal-content {
    display: flex;
    position: relative;
    z-index: 10001;
    flex-direction: column;
    border-radius: 12px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s;
    background: #252526;
    border: 1px solid #3c3c3c;
}




/* Modal Styles */
.modal-backdrop {
    pointer-events: auto;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    backdrop-filter: blur(2px);
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.2s;
}

.modal-backdrop .modal-content {
  pointer-events: auto;
  /* Modal content receives ALL clicks/touches */
}

.modal-backdrop::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  /* Prevents clicks from passing through overlay */
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #e2e8f0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    padding: 16px 20px;
    margin: 0px;
    font-size: 20px;
}


.modal-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 50px;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.modal-close:hover {
    background: #37373d;
    color: #d4d4d4;
}
.modal-header h2 {
    margin: 0;
    color: white;
    font-size: 16px;
    font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
}

.modal-refresh-btn {
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 60%);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    width: max-content;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.modal-refresh-btn:hover {
    background: #3ab3d9;
}

.modal-refresh-btn:disabled {
    background: #37373d;
    color: #858585;
    cursor: not-allowed;
}




.modal-body {
    padding: 5px;
    max-height: calc(90vh - 120px);
    overflow-y: auto;
    flex: 1;
}



.modal-section {
    margin-bottom: 24px;
}

.modal-section h4 {
    color: white;
    margin: 0 0 12px 0;
    font-size: 16px;
}



/* Warning Banner - VSCode theme */
.warning-banner {
    background: rgba(239, 71, 111, 0.15);
    border-left: 3px solid #EF476F;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.warning-banner h3 {
    color: #EF476F;
    font-size: 13px;
    margin-bottom: 6px;
    font-weight: 600;
}

.warning-banner p {
    color: #d4d4d4;
    font-size: 11px;
    line-height: 1.5;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 30, 30, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}



.loading-overlay p {
    margin-top: 16px;
    color: #d4d4d4;
    font-size: 13px;
}

/* No Data State */
.no-data {
    color: #858585;
    text-align: center;
    padding: 24px;
    font-style: italic;
    font-size: 12px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stock-grid {
        grid-template-columns: 1fr;
    }
    
    .market-context {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .controls > * {
        width: 100%;
    }
}

/* Scrollbar styling for modal */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #2d2d30;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #4CC9F0;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #3ab3d9;
}

/* Safari iOS flex-direction: column height bug fix - TIER 1 ONLY */
.tier-section.tier1, .tier-section.tier2,.tier-section.tier3, .tier-section.tier4 {
    /* Force Safari to calculate height properly */
    min-height: 0 !important;
    height: auto !important;
}

/* For Safari iOS specifically */
@supports (-webkit-touch-callout: none) {
    .tier-section.tier1, .tier-section.tier2,.tier-section.tier3, .tier-section.tier4 {
        display: block ;
        overflow-y: visible;
    }
    
    .tier-section.tier1 .stock-grid, .tier-section.tier2 .stock-grid, .tier-section.tier3 .stock-grid, .tier-section.tier4  .stock-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* Additional mobile fix for Safari */
@media (max-width: 768px) {
    .tier-section.tier1, .tier-section.tier2,.tier-section.tier3, .tier-section.tier4 {
        -webkit-overflow-scrolling: touch;
        flex: none !important;
        flex-basis: auto !important;
        height: auto !important;
        min-height: fit-content !important;
    }
}



/* ============================================================================
   ARIMA ANALYSIS STYLES
   Add these styles to your existing CSS or in a style tag
   ============================================================================ */

/* Use existing semantic-analysis styles, plus these additions */

.trajectory-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0;
    transition: all 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.trajectory-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.trajectory-card .card-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* background: var(--bg-primary); */
}

.trajectory-card .card-header h3 {
    margin: 0;
    font-size: 18px;
    color: white;
    font-weight: 600;
}

.trajectory-card .card-actions {
    display: flex;
    gap: 8px;
}

.trajectory-card .btn-icon {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.trajectory-card .btn-icon:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.trajectory-card .card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}


.predictions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 12px;
    /* background: var(--bg-primary); */
    border-radius: 6px;
}

.prediction {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pred-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.pred-value {
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.pred-change {
    font-size: 12px;
    margin-top: 2px;
}

.pred-change.positive {
    color: #22c55e;
}

.pred-change.negative {
    color: #ef4444;
}

.overwhelm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.overwhelm-badge {
    padding: 1px 1px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.overwhelm-badge.up {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.overwhelm-badge.down {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.overwhelm-badge.neutral {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
}

.dominance-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.physics-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.physics-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    /* background: var(--bg-primary); */
    border-radius: 4px;
}

.physics-metric .metric-label {
    font-size: 10px;
    margin-bottom: 2px;
}

.physics-metric .metric-value {
    font-size: 14px;
}

.confidence-bands {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    background: linear-gradient(90deg, rgba(239,68,68,0.1), rgba(34,197,94,0.1));
    border-radius: 4px;
    font-size: 12px;
}

.band-lower {
    color: #ef4444;
}

.band-upper {
    color: #22c55e;
}

/* Modal Styles */
.semantic-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    overflow: auto;
}



.predictions-table {
    width: 100%;
    border-collapse: collapse;
}

.predictions-table th {
    /* background: var(--bg-primary); */
    padding: 8px;
    text-align: left;
    font-size: 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.predictions-table td {
    padding: 8px;
    font-size: 12px;
    color: white;
    border-bottom: 1px solid var(--border-subtle);
}

.momentum-details {
    /* background: var(--bg-primary); */
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.momentum-series {
    margin-bottom: 8px;
    font-size: 12px;
    color: white;
    word-break: break-all;
}

.momentum-current {
    display: flex;
    justify-content: space-around;
    padding: 12px;
    /* background: var(--bg-primary); */
    border-radius: 6px;
}

.momentum-current span {
    font-size: 12px;
    color: white;
}

.directional-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 12px;
    /* background: var(--bg-primary); */
    border-radius: 6px;
}

.directional-details div {
    font-size: 12px;
    color: white;
}

/* Momentum signal labels */
.momentum-bullish {
    color: #22c55e;
}

.momentum-bearish {
    color: #ef4444;
}

.momentum-weak-bull {
    color: #fbbf24;
}

.momentum-weak-bear {
    color: #f97316;
}

.momentum-neutral {
    color: #94a3b8;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .semantic-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        max-width: 95%;
        margin: 10px;
    }
}

:root {
  /* Primitive Color Tokens */
  --color-white: rgba(255, 255, 255, 1);
  --color-black: rgba(0, 0, 0, 1);
  --color-cream-50: rgba(252, 252, 249, 1);
  --color-cream-100: rgba(255, 255, 253, 1);
  --color-gray-200: rgba(245, 245, 245, 1);
  --color-gray-300: rgba(167, 169, 169, 1);
  --color-gray-400: rgba(119, 124, 124, 1);
  --color-slate-500: rgba(98, 108, 113, 1);
  --color-brown-600: rgba(94, 82, 64, 1);
  --color-charcoal-700: rgba(31, 33, 33, 1);
  --color-charcoal-800: rgba(38, 40, 40, 1);
  --color-slate-900: rgba(19, 52, 59, 1);
  --color-teal-300: rgba(50, 184, 198, 1);
  --color-teal-400: rgba(45, 166, 178, 1);
  --color-teal-500: rgba(33, 128, 141, 1);
  --color-teal-600: rgba(29, 116, 128, 1);
  --color-teal-700: rgba(26, 104, 115, 1);
  --color-teal-800: rgba(41, 150, 161, 1);
  --color-red-400: rgba(255, 84, 89, 1);
  --color-red-500: rgba(192, 21, 47, 1);
  --color-orange-400: rgba(230, 129, 97, 1);
  --color-orange-500: rgba(168, 75, 47, 1);

  /* RGB versions for opacity control */
  --color-brown-600-rgb: 94, 82, 64;
  --color-teal-500-rgb: 33, 128, 141;
  --color-slate-900-rgb: 19, 52, 59;
  --color-slate-500-rgb: 98, 108, 113;
  --color-red-500-rgb: 192, 21, 47;
  --color-red-400-rgb: 255, 84, 89;
  --color-orange-500-rgb: 168, 75, 47;
  --color-orange-400-rgb: 230, 129, 97;

  /* Background color tokens (Light Mode) */
  --color-bg-1: rgba(59, 130, 246, 0.08); /* Light blue */
  --color-bg-2: rgba(245, 158, 11, 0.08); /* Light yellow */
  --color-bg-3: rgba(34, 197, 94, 0.08); /* Light green */
  --color-bg-4: rgba(239, 68, 68, 0.08); /* Light red */
  --color-bg-5: rgba(147, 51, 234, 0.08); /* Light purple */
  --color-bg-6: rgba(249, 115, 22, 0.08); /* Light orange */
  --color-bg-7: rgba(236, 72, 153, 0.08); /* Light pink */
  --color-bg-8: rgba(6, 182, 212, 0.08); /* Light cyan */

  /* Semantic Color Tokens (Light Mode) */
  --color-background: var(--color-cream-50);
  --color-surface: var(--color-cream-100);
  --color-text: var(--color-slate-900);
  --color-text-secondary: var(--color-slate-500);
  --color-primary: var(--color-teal-500);
  --color-primary-hover: var(--color-teal-600);
  --color-primary-active: var(--color-teal-700);
  --color-secondary: rgba(var(--color-brown-600-rgb), 0.12);
  --color-secondary-hover: rgba(var(--color-brown-600-rgb), 0.2);
  --color-secondary-active: rgba(var(--color-brown-600-rgb), 0.25);
  --color-border: rgba(var(--color-brown-600-rgb), 0.2);
  --color-btn-primary-text: var(--color-cream-50);
  --color-card-border: rgba(var(--color-brown-600-rgb), 0.12);
  --color-card-border-inner: rgba(var(--color-brown-600-rgb), 0.12);
  --color-error: var(--color-red-500);
  --color-success: var(--color-teal-500);
  --color-warning: var(--color-orange-500);
  --color-info: var(--color-slate-500);
  --color-focus-ring: rgba(var(--color-teal-500-rgb), 0.4);
  --color-select-caret: rgba(var(--color-slate-900-rgb), 0.8);

  /* Common style patterns */
  --focus-ring: 0 0 0 3px var(--color-focus-ring);
  --focus-outline: 2px solid var(--color-primary);
  --status-bg-opacity: 0.15;
  --status-border-opacity: 0.25;
  --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

  /* RGB versions for opacity control */
  --color-success-rgb: 33, 128, 141;
  --color-error-rgb: 192, 21, 47;
  --color-warning-rgb: 168, 75, 47;
  --color-info-rgb: 98, 108, 113;

  /* Typography */
  --font-family-base: "FKGroteskNeue", "Geist", "Inter", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family-mono: "Berkeley Mono", ui-monospace, SFMono-Regular, Menlo,
    Monaco, Consolas, monospace;
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-md: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;
  --font-size-2xl: 20px;
  --font-size-3xl: 24px;
  --font-size-4xl: 30px;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 550;
  --font-weight-bold: 600;
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --letter-spacing-tight: -0.01em;

  /* Spacing */
  --space-0: 0;
  --space-1: 1px;
  --space-2: 2px;
  --space-4: 4px;
  --space-6: 6px;
  --space-8: 8px;
  --space-10: 10px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-base: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.04),
    0 2px 4px -1px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04),
    0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.03);

  /* Animation */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
}

/* Dark mode colors */
@media (prefers-color-scheme: dark) {
  :root {
    /* RGB versions for opacity control (Dark Mode) */
    --color-gray-400-rgb: 119, 124, 124;
    --color-teal-300-rgb: 50, 184, 198;
    --color-gray-300-rgb: 167, 169, 169;
    --color-gray-200-rgb: 245, 245, 245;

    /* Background color tokens (Dark Mode) */
    --color-bg-1: rgba(29, 78, 216, 0.15); /* Dark blue */
    --color-bg-2: rgba(180, 83, 9, 0.15); /* Dark yellow */
    --color-bg-3: rgba(21, 128, 61, 0.15); /* Dark green */
    --color-bg-4: rgba(185, 28, 28, 0.15); /* Dark red */
    --color-bg-5: rgba(107, 33, 168, 0.15); /* Dark purple */
    --color-bg-6: rgba(194, 65, 12, 0.15); /* Dark orange */
    --color-bg-7: rgba(190, 24, 93, 0.15); /* Dark pink */
    --color-bg-8: rgba(8, 145, 178, 0.15); /* Dark cyan */

    /* Semantic Color Tokens (Dark Mode) */
    --color-background: var(--color-charcoal-700);
    --color-surface: var(--color-charcoal-800);
    --color-text: var(--color-gray-200);
    --color-text-secondary: rgba(var(--color-gray-300-rgb), 0.7);
    --color-primary: var(--color-teal-300);
    --color-primary-hover: var(--color-teal-400);
    --color-primary-active: var(--color-teal-800);
    --color-secondary: rgba(var(--color-gray-400-rgb), 0.15);
    --color-secondary-hover: rgba(var(--color-gray-400-rgb), 0.25);
    --color-secondary-active: rgba(var(--color-gray-400-rgb), 0.3);
    --color-border: rgba(var(--color-gray-400-rgb), 0.3);
    --color-error: var(--color-red-400);
    --color-success: var(--color-teal-300);
    --color-warning: var(--color-orange-400);
    --color-info: var(--color-gray-300);
    --color-focus-ring: rgba(var(--color-teal-300-rgb), 0.4);
    --color-btn-primary-text: var(--color-slate-900);
    --color-card-border: rgba(var(--color-gray-400-rgb), 0.2);
    --color-card-border-inner: rgba(var(--color-gray-400-rgb), 0.15);
    --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.1),
      inset 0 -1px 0 rgba(0, 0, 0, 0.15);
    --button-border-secondary: rgba(var(--color-gray-400-rgb), 0.2);
    --color-border-secondary: rgba(var(--color-gray-400-rgb), 0.2);
    --color-select-caret: rgba(var(--color-gray-200-rgb), 0.8);

    /* Common style patterns - updated for dark mode */
    --focus-ring: 0 0 0 3px var(--color-focus-ring);
    --focus-outline: 2px solid var(--color-primary);
    --status-bg-opacity: 0.15;
    --status-border-opacity: 0.25;
    --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

    /* RGB versions for dark mode */
    --color-success-rgb: var(--color-teal-300-rgb);
    --color-error-rgb: var(--color-red-400-rgb);
    --color-warning-rgb: var(--color-orange-400-rgb);
    --color-info-rgb: var(--color-gray-300-rgb);
  }
}

/* Data attribute for manual theme switching */
[data-color-scheme="dark"] {
  /* RGB versions for opacity control (dark mode) */
  --color-gray-400-rgb: 119, 124, 124;
  --color-teal-300-rgb: 50, 184, 198;
  --color-gray-300-rgb: 167, 169, 169;
  --color-gray-200-rgb: 245, 245, 245;

  /* Colorful background palette - Dark Mode */
  --color-bg-1: rgba(29, 78, 216, 0.15); /* Dark blue */
  --color-bg-2: rgba(180, 83, 9, 0.15); /* Dark yellow */
  --color-bg-3: rgba(21, 128, 61, 0.15); /* Dark green */
  --color-bg-4: rgba(185, 28, 28, 0.15); /* Dark red */
  --color-bg-5: rgba(107, 33, 168, 0.15); /* Dark purple */
  --color-bg-6: rgba(194, 65, 12, 0.15); /* Dark orange */
  --color-bg-7: rgba(190, 24, 93, 0.15); /* Dark pink */
  --color-bg-8: rgba(8, 145, 178, 0.15); /* Dark cyan */

  /* Semantic Color Tokens (Dark Mode) */
  --color-background: var(--color-charcoal-700);
  --color-surface: var(--color-charcoal-800);
  --color-text: var(--color-gray-200);
  --color-text-secondary: rgba(var(--color-gray-300-rgb), 0.7);
  --color-primary: var(--color-teal-300);
  --color-primary-hover: var(--color-teal-400);
  --color-primary-active: var(--color-teal-800);
  --color-secondary: rgba(var(--color-gray-400-rgb), 0.15);
  --color-secondary-hover: rgba(var(--color-gray-400-rgb), 0.25);
  --color-secondary-active: rgba(var(--color-gray-400-rgb), 0.3);
  --color-border: rgba(var(--color-gray-400-rgb), 0.3);
  --color-error: var(--color-red-400);
  --color-success: var(--color-teal-300);
  --color-warning: var(--color-orange-400);
  --color-info: var(--color-gray-300);
  --color-focus-ring: rgba(var(--color-teal-300-rgb), 0.4);
  --color-btn-primary-text: var(--color-slate-900);
  --color-card-border: rgba(var(--color-gray-400-rgb), 0.15);
  --color-card-border-inner: rgba(var(--color-gray-400-rgb), 0.15);
  --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  --color-border-secondary: rgba(var(--color-gray-400-rgb), 0.2);
  --color-select-caret: rgba(var(--color-gray-200-rgb), 0.8);

  /* Common style patterns - updated for dark mode */
  --focus-ring: 0 0 0 3px var(--color-focus-ring);
  --focus-outline: 2px solid var(--color-primary);
  --status-bg-opacity: 0.15;
  --status-border-opacity: 0.25;
  --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

  /* RGB versions for dark mode */
  --color-success-rgb: var(--color-teal-300-rgb);
  --color-error-rgb: var(--color-red-400-rgb);
  --color-warning-rgb: var(--color-orange-400-rgb);
  --color-info-rgb: var(--color-gray-300-rgb);
}

[data-color-scheme="light"] {
  /* RGB versions for opacity control (light mode) */
  --color-brown-600-rgb: 94, 82, 64;
  --color-teal-500-rgb: 33, 128, 141;
  --color-slate-900-rgb: 19, 52, 59;

  /* Semantic Color Tokens (Light Mode) */
  --color-background: var(--color-cream-50);
  --color-surface: var(--color-cream-100);
  --color-text: var(--color-slate-900);
  --color-text-secondary: var(--color-slate-500);
  --color-primary: var(--color-teal-500);
  --color-primary-hover: var(--color-teal-600);
  --color-primary-active: var(--color-teal-700);
  --color-secondary: rgba(var(--color-brown-600-rgb), 0.12);
  --color-secondary-hover: rgba(var(--color-brown-600-rgb), 0.2);
  --color-secondary-active: rgba(var(--color-brown-600-rgb), 0.25);
  --color-border: rgba(var(--color-brown-600-rgb), 0.2);
  --color-btn-primary-text: var(--color-cream-50);
  --color-card-border: rgba(var(--color-brown-600-rgb), 0.12);
  --color-card-border-inner: rgba(var(--color-brown-600-rgb), 0.12);
  --color-error: var(--color-red-500);
  --color-success: var(--color-teal-500);
  --color-warning: var(--color-orange-500);
  --color-info: var(--color-slate-500);
  --color-focus-ring: rgba(var(--color-teal-500-rgb), 0.4);

  /* RGB versions for light mode */
  --color-success-rgb: var(--color-teal-500-rgb);
  --color-error-rgb: var(--color-red-500-rgb);
  --color-warning-rgb: var(--color-orange-500-rgb);
  --color-info-rgb: var(--color-slate-500-rgb);
}

/* ============================================================================
   TRAJECTORY CONTEXT CSS - DESIGN SYSTEM COMPLIANT
   Using design system variables for consistency and theme support
   ============================================================================ */

.trajectory-context-section {
    margin-bottom: var(--space-32);
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.trajectory-context {
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
}

/* ============================================================================
   MAIN GRID CARDS
   ============================================================================ */

.context-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-12);
    margin-bottom: var(--space-16);
}

.context-card {
    padding: var(--space-16);
    background: white;
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-sm);
    transition: all var(--duration-normal) var(--ease-standard);
    box-shadow: var(--shadow-sm);
}

.context-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.card-label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-8);
    letter-spacing: 0.8px;
}

/* ============================================================================
   TRAJECTORY TYPE BADGE
   ============================================================================ */

.trajectory-type-badge {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-bold);
    padding: var(--space-10) var(--space-12);
    border-radius: var(--radius-sm);
    text-align: center;
    margin-bottom: var(--space-10);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.trajectory-type-badge.permanent {
    background: rgba(var(--color-success-rgb), 0.15);
    color: var(--color-success);
    border: 1px solid rgba(var(--color-success-rgb), 0.3);
    box-shadow: 0 0 var(--space-12) rgba(var(--color-success-rgb), 0.2);
}

.trajectory-type-badge.temporary {
    background: rgba(var(--color-warning-rgb), 0.15);
    color: var(--color-warning);
    border: 1px solid rgba(var(--color-warning-rgb), 0.3);
    box-shadow: 0 0 var(--space-12) rgba(var(--color-warning-rgb), 0.2);
}

.trajectory-type-badge.uncertain {
    background: rgba(var(--color-error-rgb), 0.15);
    color: var(--color-error);
    border: 1px solid rgba(var(--color-error-rgb), 0.3);
    box-shadow: 0 0 var(--space-12) rgba(var(--color-error-rgb), 0.2);
}

/* ============================================================================
   CONFIDENCE BAR
   ============================================================================ */

.confidence-bar {
    width: 100%;
    height: var(--space-4);
    background: rgba(var(--color-slate-900-rgb), 0.3);
    border-radius: var(--space-2);
    overflow: hidden;
    margin-bottom: var(--space-6);
    border: 1px solid var(--color-card-border);
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-success));
    transition: width 0.5s var(--ease-standard);
    box-shadow: 0 0 var(--space-8) rgba(var(--color-teal-500-rgb), 0.4);
}

.confidence-text {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    text-align: center;
    font-weight: var(--font-weight-semibold);
}

/* ============================================================================
   PROBABILITY SPLIT
   ============================================================================ */

.probability-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.probability-split {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: var(--space-8);
    font-size: var(--font-size-sm);
}

.probability-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    flex: 1;
    text-align: center;
}

.probability-item.permanent {
    color: var(--color-success);
}

.probability-item.rebound {
    color: var(--color-warning);
}

.prob-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.5px;
}

.prob-value {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
}

.probability-divider {
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-semibold);
}

/* ============================================================================
   REASON CARD
   ============================================================================ */

.reason-card {
    grid-column: 1 / -1;
}



#trajectoryContextContainer > div > div.context-grid > div.context-card.reason-card > div.reason-text{
    line-height: var(--line-height-normal);
    font-style: italic;
    padding: var(--space-2) 0;
    color: black
}
/* ============================================================================
   DRIVERS GRID
   ============================================================================ */

.drivers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-12);
    margin-bottom: var(--space-16);
}

.drivers-section {
    padding: var(--space-12) var(--space-16);
    background: rgb(8 8 8);
    border-left: 3px solid;
    border-radius: var(--radius-sm);
    border-top: 1px solid var(--color-card-border);
    border-right: 1px solid var(--color-card-border);
    border-bottom: 1px solid var(--color-card-border);
}

.drivers-section:first-child {
    border-left-color: var(--color-success);
}

.drivers-section:last-child {
    border-left-color: var(--color-warning);
}

.drivers-label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    margin-bottom: var(--space-8);
    letter-spacing: 0.8px;

}

.drivers-section:first-child .drivers-label {
    color: var(--color-success);
}

.drivers-section:last-child .drivers-label {
    color: var(--color-warning);
}

.drivers-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.driver-item {
    font-size: var(--font-size-xs);
    line-height: var(--line-height-normal);
    padding-left: var(--space-2);

}
.factor-card > .factor-content > div >.drivers-list > .driver-item{
    color:black;
}
/* ============================================================================
   DETAILED FACTORS
   ============================================================================ */

.detailed-factors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-12);
    margin-bottom: var(--space-16);
}

.factor-card {
    padding: var(--space-12) var(--space-16);
    background: white;
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-sm);
    transition: all var(--duration-normal) var(--ease-standard);
}


.factor-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    margin-bottom: var(--space-10);
    text-transform: uppercase;
    letter-spacing: 0.8px;

}

.factor-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.factor-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-xs);
    padding: var(--space-4) 0;

}

.factor-key {
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-semibold);
}

.factor-value {
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
}

.factor-value.trend-elevated {
    color: var(--color-success);
}

.factor-value.trend-declining {
    color: var(--color-warning);
}

.factor-value.trend-neutral {
    color: var(--color-text-secondary);
}

.factor-value.sustain-high {
    color: var(--color-success);
}

.factor-value.sustain-moderate {
    color: var(--color-warning);
}

.factor-value.sustain-low {
    color: var(--color-error);
}

.factor-value.bias-bullish {
    color: var(--color-success);
}

.factor-value.bias-bearish {
    color: var(--color-error);
}

.factor-value.bias-neutral {
    color: var(--color-text-secondary);
}

.factor-value.pin-dist-high {
    color: var(--color-error);
}

.factor-value.pin-dist-moderate {
    color: var(--color-warning);
}

.factor-value.pin-dist-low {
    color: var(--color-success);
}

.factor-alignment {
    margin-top: var(--space-8);
    padding-top: var(--space-8);
    border-top: 1px solid var(--color-card-border-inner);
    font-size: var(--font-size-xs);
}

.alignment-check {
    color: var(--color-success);
    font-weight: var(--font-weight-bold);
}

.alignment-warning {
    color: var(--color-warning);
    font-weight: var(--font-weight-bold);
}

.factor-explanation {
    font-size: var(--font-size-xs);
    color: black;
    line-height: var(--line-height-normal);
    margin-top: var(--space-8);
    padding-top: var(--space-8);
    border-top: 1px solid var(--color-card-border-inner);
    font-style: italic;

}

.profitability-metrics > .metric-card > .metric-label{
    color:#060505
}
/* ============================================================================
   SUMMARY BOX
   ============================================================================ */

.context-summary {
    padding: var(--space-12) var(--space-16);
    background: var(--color-surface);
    border: 1px solid var(--color-card-border);
    border-left: 3px solid var(--color-primary);
    border-radius: var(--radius-sm);
}

.summary-text {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
    color: var(--color-text);

}

.summary-text strong {
    color: var(--color-primary);
    font-weight: var(--font-weight-bold);
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 1024px) {
    .context-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .drivers-grid {
        grid-template-columns: 1fr;
    }

    .detailed-factors {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .trajectory-context-section {
        padding: 0;
        margin-bottom: var(--space-20);
    }

    .context-grid {
        grid-template-columns: 1fr;
    }

    .context-title {
        font-size: var(--font-size-md);
    }

    .context-subtitle {
        font-size: var(--font-size-xs);
    }

    .detailed-factors {
        grid-template-columns: 1fr;
    }

    .factor-card {
        padding: var(--space-10) var(--space-12);
    }

    .factor-title {
        font-size: var(--font-size-xs);
    }
}

@media (max-width: 480px) {
    .trajectory-context-section {
        margin-bottom: var(--space-16);
    }

    .context-header {
        padding: var(--space-12) var(--space-16);
    }

    .context-title {
        font-size: var(--font-size-sm);
        letter-spacing: 1px;
    }

    .context-subtitle {
        font-size: var(--font-size-xs);
        letter-spacing: 0.3px;
    }

    .context-card,
    .factor-card,
    .drivers-section {
        padding: var(--space-8) var(--space-12);
    }

    .trajectory-type-badge {
        font-size: var(--font-size-sm);
        padding: var(--space-8) var(--space-10);
    }

    .context-grid {
        gap: var(--space-8);
    }

    .drivers-grid,
    .detailed-factors {
        gap: var(--space-8);
    }

    .probability-split {
        gap: var(--space-4);
    }

    .factor-row {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }

    .context-summary {
        padding: var(--space-10) var(--space-12);
    }
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(var(--space-10));
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.context-card {
    animation: slideIn var(--duration-normal) var(--ease-standard) forwards;
}

.context-card:nth-child(1) { animation-delay: 0.05s; }
.context-card:nth-child(2) { animation-delay: 0.1s; }
.context-card:nth-child(3) { animation-delay: 0.15s; }

.drivers-section {
    animation: slideIn var(--duration-normal) var(--ease-standard) forwards;
}

.drivers-section:nth-child(1) { animation-delay: 0.3s; }
.drivers-section:nth-child(2) { animation-delay: 0.35s; }

.factor-card {
    animation: slideIn var(--duration-normal) var(--ease-standard) forwards;
}

.factor-card:nth-child(1) { animation-delay: 0.4s; }
.factor-card:nth-child(2) { animation-delay: 0.45s; }
.factor-card:nth-child(3) { animation-delay: 0.5s; }

/* ============================================================================
   TEXT UTILITIES
   ============================================================================ */

.context-card,
.factor-card,
.drivers-section {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* ============================================================================
   PRINT MEDIA
   ============================================================================ */

@media print {
    .trajectory-context-section {
        page-break-inside: avoid;
    }

    .trajectory-context {
        break-inside: avoid;
    }
}

/* Auth Modal Styles */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000001;
}
.margin{
    margin: 20%;
}
.auth-modal {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;

    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-modal-header {
    padding: var(--space-20);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-modal-header h2 {
    margin: 0;
    font-size: var(--font-size-xl);
    color: var(--color-text);
}

.auth-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--color-text-secondary);
    padding: 0;
    line-height: 1;
}

.auth-modal-close:hover {
    color: var(--color-text);
}

.auth-modal-body {
    padding: var(--space-20);
}

.auth-modal-body p {
    margin: 0 0 var(--space-16) 0;
    color: var(--color-text);
    line-height: 1.5;
}

.auth-modal-actions {
    display: flex;
    gap: var(--space-12);
    margin-top: var(--space-20);
}

.auth-btn {
    flex: 1;
    padding: var(--space-10) var(--space-16);
    border-radius: var(--radius-base);
    border: none;
    font-size: var(--font-size-base);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-normal) var(--ease-standard);
    font-weight: var(--font-weight-medium);
}

.auth-btn-primary {
    background: var(--color-primary);
    color: var(--color-btn-primary-text);
}

.auth-btn-primary:hover {
    background: var(--color-primary-hover);
}

.auth-btn-secondary {
    background: var(--color-secondary);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.auth-btn-secondary:hover {
    background: var(--color-secondary-hover);
}

/* User info display in header (optional) */
.auth-user-info {
    display: inline-flex;
    align-items: center;
    gap: var(--space-8);
    padding: var(--space-8) var(--space-12);
    background: var(--color-secondary);
    border-radius: var(--radius-base);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.auth-user-badge {
    display: inline-block;
    padding: var(--space-2) var(--space-8);
    background: var(--color-primary);
    color: var(--color-btn-primary-text);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
}