.strategy-detail-container {
    background-color: #0a0e27;
    color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    min-height: 10vh;
    margin-bottom: 20px;
}
.strategy-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}
.ticker-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}
.qty-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1e2548;
    padding: 5px 15px;
    border-radius: 6px;
    margin-left: 20px;
    border: 1px solid #2d355a;
}
.qty-input-group label {
    color: #a0a5ba;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin: 0;
    font-weight: bold;
}
.qty-input-group input {
    background: transparent;
    border: none;
    color: #ffffff;
    width: 60px;
    font-weight: bold;
    font-size: 1rem;
    text-align: center;
    outline: none;
}
.qty-input-group input:focus {
    color: #007bff;
}
.ticker-badge {
    background: #1e2548;
    padding: 5px 15px;
    border-radius: 4px;
    font-weight: bold;
}
.price-info {
    font-size: 1.5rem;
    font-weight: bold;
}
.change-info {
    color: #28a745;
    font-size: 0.9rem;
}
.summary-metrics {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin: 30px 0;
    text-align: center;
}
.metric-item {
    border-right: 1px solid #2d355a;
}
.metric-item:last-child {
    border-right: none;
}
.metric-label {
    color: #a0a5ba;
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-bottom: 5px;
}
.metric-value {
    font-size: 1.2rem;
    font-weight: bold;
}
.chart-container {
    position: relative;
    height: 500px;
    margin: 20px 0;
    background: #0a0e27;
    border: 1px solid #1e2548;
    border-radius: 8px;
    overflow: hidden;
}
.slider-container {
    margin: 30px 0;
    padding: 20px;
    background: #0a0e27;
    border: 1px solid #1e2548;
    border-radius: 8px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 30px;
    align-items: flex-start;
}
.slider-row {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 0;
}
.slider-label {
    width: 100%;
    white-space: nowrap;
    color: #a0a5ba;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
}
.slider-input {
    width: 100%;
    accent-color: #007bff;
}
.slider-value {
    width: 60px;
    text-align: right;
    font-weight: bold;
}

/* Strategy Insights Panel */
.insights-panel {
    background: #0a0e27;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #1e2548;
}
.insight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}
.insight-card {
    background: #1e2548;
    padding: 15px;
    border-radius: 6px;
    border-left: 3px solid #007bff;
}
.insight-title {
    font-size: 0.75rem;
    color: #a0a5ba;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.insight-value {
    font-size: 1.1rem;
    font-weight: bold;
}
.insight-sub {
    font-size: 0.7rem;
    color: #718096;
    margin-top: 5px;
}

/* Underpricing Score Panel */
.ups-panel {
    background: #0a0e27;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #1e2548;
}
.ups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}
.ups-card {
    background: #1e2548;
    padding: 15px;
    border-radius: 6px;
    border-bottom: 3px solid #007bff;
    text-align: center;
}
.ups-score-value {
    font-size: 2rem;
    font-weight: 800;
    margin: 10px 0;
}
.ups-signal-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}
.signal-strong-buy { background: rgba(40, 167, 69, 0.2); color: #28a745; border: 1px solid #28a745; }
.signal-weak-buy { background: rgba(255, 193, 7, 0.2); color: #ffc107; border: 1px solid #ffc107; }
.signal-fair { background: rgba(160, 165, 186, 0.2); color: #a0a5ba; border: 1px solid #a0a5ba; }
.signal-overpriced { background: rgba(220, 53, 69, 0.2); color: #dc3545; border: 1px solid #dc3545; }

.auto-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 123, 255, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid #007bff;
    cursor: pointer;
    transition: all 0.2s;
}
.auto-toggle.off {
    background: #2d355a;
    border-color: #4a5568;
    color: #a0a5ba;
}
.auto-toggle i { font-size: 0.8rem; }
.expiration-container {
    margin: 20px 0;
    padding: 20px;
    background: #0a0e27;
    border: 1px solid #1e2548;
    border-radius: 8px;
}
.tab-container {
    display: flex;
    background: #161b3d;
    border-radius: 4px;
    padding: 5px;
    margin-top: 20px;
}
.tab-item {
    flex: 1;
    text-align: center;
    padding: 10px 5px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 0.85rem;
    background: #1e2548;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    border: 1px solid transparent;
}
.tab-item.active {
    background: #007bff;
    border-color: #007bff;
}
.tab-item:hover:not(.active) {
    background: #2d355a;
}
.tab-day {
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 2px;
}
.legs-table-container {
    margin: 20px 0;
    background: #0a0e27;
    border: 1px solid #1e2548;
    border-radius: 8px;
    overflow: hidden;
}
.legs-table {
    width: 100%;
    border-collapse: collapse;
    color: #ffffff;
}
.legs-table th {
    background: #1e2548;
    color: #a0a5ba;
    font-size: 0.8rem;
    text-transform: uppercase;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #2d355a;
}
.legs-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #2d355a;
    font-size: 0.9rem;
}
.legs-table tr:last-child td {
    border-bottom: none;
}
.leg-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-right: 8px;
}
.leg-badge-call { background: rgba(40, 167, 69, 0.2); color: #28a745; border: 1px solid #28a745; }
.leg-badge-put { background: rgba(255, 77, 77, 0.2); color: #ff4d4d; border: 1px solid #ff4d4d; }

/* Option Chain Table Styles */
.option-chain-container {
    margin-top: 40px;
    background: #0a0e27;
    border-radius: 8px;
    border: 1px solid #1e2548;
    overflow: hidden;
}
.oc-header {
    background: #0a0e27;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1e2548;
}
.oc-table-wrapper {
    max-height: 600px;
    overflow-y: auto;
}
.oc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.oc-table th {
    position: sticky;
    top: 0;
    background: #1e2548;
    padding: 10px;
    color: #a0a5ba;
    text-transform: uppercase;
    font-size: 0.7rem;
    z-index: 10;
}
.oc-table td {
    padding: 8px 5px;
    text-align: center;
    border-bottom: 1px solid #1e2548;
    color: #ffffff;
}
.oc-strike-col {
    background: #161b3d;
    font-weight: bold;
    color: #ffffff !important;
    position: sticky;
    left: 0;
    z-index: 5;
    border-left: 2px solid #007bff;
}
.oc-call-col { background: rgba(40, 167, 69, 0.03); }
.oc-put-col { background: rgba(255, 77, 77, 0.03); }
.oc-row:hover { background: rgba(255,255,255,0.05); cursor: pointer; }
.oc-atm-row { background: rgba(0, 123, 255, 0.1) !important; }
.oc-greek { color: #718096; font-size: 0.75rem; }
.oc-add-btn {
    background: transparent;
    border: 1px solid #4a5568;
    color: #a0a5ba;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
}
.oc-add-btn:hover {
    border-color: #007bff;
    color: #007bff;
}

/* Payoff Table Styles */
.payoff-table-container {
    display: none;
    background-color: #0a0e27;
    border: 1px solid #1e2548;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    overflow: auto;
    max-height: 500px;
}
.payoff-table {
    width: 100%;
    border-collapse: collapse;
    color: #ffffff;
    font-size: 0.85rem;
}
.payoff-table th {
    background: #1e2548;
    padding: 10px;
    color: #a0a5ba;
    text-transform: uppercase;
    font-size: 0.7rem;
    position: sticky;
    top: 0;
    z-index: 100;
}
.payoff-table td {
    padding: 4px 10px;
    text-align: center;
    border-bottom: 1px solid #1e2548;
    font-size: 0.8rem;
    height: 30px;
}
.payoff-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}
.pl-positive { color: #28a745; font-weight: bold; }
.pl-negative { color: #ff4d4d; font-weight: bold; }
.price-col { font-weight: bold; background: rgba(255,255,255,0.02); }
.atm-row { background: rgba(0, 123, 255, 0.1); }

/* Payoff Matrix (Heatmap) Styles */
.payoff-matrix-container {
    display: none;
    background-color: #0a0e27;
    border: 1px solid #1e2548;
    border-radius: 8px;
    margin-top: 20px;
    overflow: hidden; /* Back to hidden as we use internal scrolling */
    position: relative;
}
.matrix-wrapper {
    overflow: auto;
    max-height: 500px;
    max-width: 100%;
}
.payoff-matrix {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: #ffffff;
    font-size: 0.75rem;
    table-layout: fixed;
}
.payoff-matrix th, .payoff-matrix td {
    padding: 2px 2px;
    text-align: center;
    border: 1px solid #1e2548;
    min-width: 60px;
    font-size: 0.7rem;
    height: 25px; /* Fixed height to fit more rows */
}
.payoff-matrix th {
    background: #161b3d;
    color: #a0a5ba;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 100; /* Increased to stay above everything else */
}
.payoff-matrix .price-header {
    position: sticky;
    left: 0;
    z-index: 110; /* Higher than top header to stay on top in corner */
    background: #161b3d;
}
.payoff-matrix .price-cell {
    position: sticky;
    left: 0;
    z-index: 90; /* High but lower than headers */
    background: #161b3d;
    font-weight: bold;
    border-right: 2px solid #007bff;
}
.matrix-cell {
    transition: transform 0.1s;
}
.matrix-cell:hover {
    transform: scale(1.1);
    z-index: 20;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}
.atm-row td {
    border-top: 1px solid #007bff;
    border-bottom: 1px solid #007bff;
}
.atm-row .price-cell {
    background: #007bff !important;
    color: white !important;
}
.cell-positive { background-color: rgba(40, 167, 69, 0.8); color: white; }
.cell-negative { background-color: rgba(255, 77, 77, 0.8); color: white; }
.cell-neutral { background-color: #1a202c; color: #718096; }

.matrix-legend {
    display: flex;
    gap: 15px;
    padding: 10px 20px;
    background: #11152b;
    border-bottom: 1px solid #1e2548;
    font-size: 0.7rem;
    color: #a0a5ba;
}
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-box { width: 30px; height: 12px; border-radius: 2px; }
.legend-box-positive { background: #28a745; background: linear-gradient(to right, rgba(40, 167, 69, 0.2), rgba(40, 167, 69, 1)); border: 1px solid #28a745; }
.legend-box-negative { background: #dc3545; background: linear-gradient(to right, rgba(220, 38, 38, 0.2), rgba(220, 38, 38, 1)); border: 1px solid #dc2626; }

.strike-slider-container {
    margin: 40px 0;
    position: relative;
    padding-top: 60px;
    padding-bottom: 20px;
}
.strike-labels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50px;
    pointer-events: none;
}
.strike-badge {
    position: absolute;
    transform: translateX(-50%);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}
.strike-badge-call {
    background: #28a745;
    top: 0;
}
.strike-badge-put {
    background: #ff4d4d;
    top: 28px;
}
.strike-badge::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid currentColor;
}
.strike-badge-call::after { color: #28a745; }
.strike-badge-put::after { color: #ff4d4d; }

.strike-input-wrapper {
    position: relative;
    height: 40px;
    display: flex;
    align-items: center;
}
.strike-main-slider {
    width: 100%;
    -webkit-appearance: none;
    background: transparent;
    cursor: pointer;
    z-index: 2;
}
.strike-main-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 2px;
    background: #2d355a;
}
.strike-main-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    margin-top: -7px;
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
}
.strike-ticks {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 20px;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    pointer-events: none;
    padding: 0 8px;
}
.tick {
    width: 1px;
    height: 6px;
    background: #4a5568;
}
.tick.major {
    height: 12px;
    background: #718096;
}
.tick-label {
    position: absolute;
    top: 15px;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: #a0a5ba;
}
.btn-action {
    background: #007bff;
    border: none;
    color: white;
    padding: 5px 15px;
    border-radius: 4px;
    margin-left: 5px;
    font-size: 0.9rem;
}
.strike-slider-item {
    background: #0a0e27;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #1e2548;
}
.strike-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.type-toggle {
    display: flex;
    gap: 5px;
}
.type-btn {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    border: 1px solid #2d355a;
    background: transparent;
    color: #a0a5ba;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 35px;
    transition: all 0.2s;
}
.type-btn.active.buy { background: #28a745; color: white; border-color: #28a745; }
.type-btn.active.sell { background: #dc3545; color: white; border-color: #dc3545; }
.type-btn.call { border-color: #28a745; color: #28a745; background: rgba(40, 167, 69, 0.1); }
.type-btn.put { border-color: #ff4d4d; color: #ff4d4d; background: rgba(255, 77, 77, 0.1); }
.type-btn.active.call { background: #28a745; color: white; border-color: #28a745; }
.type-btn.active.put { background: #ff4d4d; color: white; border-color: #ff4d4d; }

.qty-input-box {
    background: #1a202c;
    border: 1px solid #2d355a;
    border-radius: 6px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
}
.qty-input-box input {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    width: 30px;
    text-align: center;
    outline: none;
}
.qty-input-box input::-webkit-inner-spin-button,
.qty-input-box input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.remove-leg {
    color: #ff4d4d;
    cursor: pointer;
    font-size: 0.9rem;
}
.remove-leg:hover { color: #ff6666; }

.btn-add-leg {
    background: transparent;
    border: 1px dashed #007bff;
    color: #007bff;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-add-leg:hover {
    background: rgba(0, 123, 255, 0.1);
}

/* Option Chain Loader */
.oc-table-wrapper {
    position: relative;
    min-height: 200px;
}
.oc-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 35, 0.8);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 8px;
}
.oc-loader.active {
    display: flex;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Expand Link */
.oc-expand-container {
    text-align: center;
    padding: 10px;
    background: rgba(45, 53, 90, 0.3);
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}
.oc-expand-link {
    color: #007bff;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.oc-expand-link:hover {
    color: #00ccff;
    text-decoration: underline;
}

/* Saved Trades Table */
.saved-trades-container {
    background: #0a0e27;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #1e2548;
    margin-top: 40px;
}
.saved-trades-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}
.saved-trades-table th {
    color: #a0a5ba;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 10px 15px;
    border-bottom: 1px solid #1e2548;
}
.saved-trades-table td {
    padding: 15px;
    background: #151a36;
    color: #fff;
}
.saved-trades-table tr td:first-child { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.saved-trades-table tr td:last-child { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
.saved-trades-table tr:hover td { background: #1e2548; }