﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ebf0 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 95%;
    width: 100%;
    margin: 0 auto;
}

header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 20px 30px;
    text-align: center;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

header h1 {
    font-size: 2em;
    margin-bottom: 15px;
}

.header-branding {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin: 0;
}

.header-logo {
    max-width: 320px;
    height: auto;
    flex-shrink: 0;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.header-divider {
    font-size: 3em;
    font-weight: 100;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1;
    user-select: none;
}

.header-subtitle {
    font-size: 1.4em;
    font-weight: 400;
    margin: 0;
    color: white;
    letter-spacing: 0.5px;
    line-height: 1.4;
    max-width: 320px;
    text-align: left;
}

/* Controls Section */
.controls-section {
    background: white;
    padding: 15px 30px;
    border-radius: 0 0 12px 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.single-row-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: nowrap;
}

.contract-buttons-group {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.contract-toggle-header .contract-toggle-btn {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ebf0 100%);
    color: #1e3c72;
    border: 2px solid #d0d5dd;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
}

.contract-toggle-header .contract-toggle-btn:hover {
    background: linear-gradient(135deg, #e8ebf0 0%, #d0d5dd 100%);
    border-color: #1e3c72;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 60, 114, 0.2);
}

.contract-toggle-header .contract-toggle-btn.active {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border-color: #1e3c72;
    box-shadow: 0 4px 15px rgba(30, 60, 114, 0.4);
}

/* Status info in single row */
.status-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.8em;
    flex-shrink: 0;
}

.status-box .status-label {
    font-size: 0.75em;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-box .status-content {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #1e3c72;
    font-weight: 500;
}

.status-separator {
    font-size: 1.5em;
    color: #ccc;
    margin: 0 10px;
    user-select: none;
}





.loading-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75em;
    color: #1e3c72;
    padding: 6px 12px;
    background: #fff3e0;
    border-radius: 8px;
    border: 2px solid #ff9800;
    flex-shrink: 0;
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

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

.status-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #gray;
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
}

.status-dot.connected {
    background: #4caf50;
    animation: pulse-glow 2s infinite;
}

.status-dot.disconnected {
    background: #f44336;
    animation: none;
}

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

.btn-reconnect {
    background: #ff9800;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-reconnect:hover {
    background: #f57c00;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.4);
}

/* Toggle Controls */
.toggle-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 26px;
    background: #d0d5dd;
    border-radius: 13px;
    transition: background 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
    background: #4caf50;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.toggle-label {
    font-size: 0.95em;
    font-weight: 600;
    color: #1e3c72;
}

main {
    padding: 0;
}

/* Cards Container */
.cards-container {
    display: grid;
    grid-template-columns: 58% 42%;
    gap: 20px;
    margin-bottom: 20px;
}

/* Card Styling */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.card-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 15px 20px;
}

.card-header h2 {
    font-size: 1.3em;
    margin: 0;
    font-weight: 600;
}

.card-header h3 {
    font-size: 1em;
    margin: 0;
    font-weight: 600;
}

.card-body {
    padding: 15px;
    height: calc(100% - 51px); /* Subtract header height */
}

.chart-card .card-body {
    padding: 15px;
    height: calc(100% - 51px);
}

/* Calendar Card */
.calendar-card {
    grid-column: 1;
    max-height: 700px;
}

.calendar-card .card-body {
    overflow-y: auto;
    max-height: 650px;
}

/* Charts Container */
.charts-container {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chart-card {
    flex: 1;
    max-height: 350px;
}

.chart-container {
    height: 100%;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.chart-placeholder {
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 8px;
    color: #999;
    font-size: 0.9em;
}

.chart-placeholder p {
    color: #666;
    font-style: italic;
}

/* DCA Calc Card, Economic Calendar Card, and StradControl Card - Full Width */
.dca-calc-card,
.economic-calendar-card,
.stradcontrol-card {
    grid-column: 1 / -1;
    max-width: 100%;
}

.treasury-selector {
    margin-bottom: 30px;
}

.treasury-selector h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.button-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.treasury-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.treasury-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.treasury-btn:active {
    transform: translateY(0);
}

.treasury-btn .symbol {
    display: block;
    font-size: 1.2em;
    margin-bottom: 5px;
}

.treasury-btn .name {
    display: block;
    font-size: 0.85em;
    opacity: 0.9;
    margin-bottom: 8px;
}

.treasury-btn .price {
    display: block;
    font-size: 1em;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    margin-top: 5px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.options-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.spinner {
    text-align: center;
    padding: 40px;
    color: #667eea;
    font-size: 1.1em;
}

.progress-container {
    width: 80%;
    max-width: 600px;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    margin: 20px auto;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    transition: width 0.5s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.4);
}

.progress-text {
    margin-top: 10px;
    font-size: 0.95em;
    color: #1e3c72;
    font-weight: 600;
}

.options-data {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
}

.contract-info {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.contract-info h3 {
    color: #1e3c72;
    margin-bottom: 15px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.info-item {
    padding: 10px;
    background: #f9f9f9;
    border-radius: 6px;
}

.info-label {
    font-weight: 600;
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.info-value {
    color: #333;
    font-size: 1.1em;
}

.options-table {
    width: 100%;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.options-table table {
    width: 100%;
    border-collapse: collapse;
}

.options-table th {
    background: #1e3c72;
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.options-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.options-table tr:hover {
    background: #f5f5f5;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #c62828;
}

.empty-message {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.1em;
}

.loading-prices {
    text-align: center;
    padding: 40px;
    color: #667eea;
    font-size: 1.2em;
    font-weight: 600;
}

.loading-prices .spinner-icon {
    display: inline-block;
    animation: rotate 2s linear infinite;
}

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

/* Straddle table specific styles */
.straddle-table-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.straddle-table-container h3 {
    color: #1e3c72;
    margin-bottom: 15px;
}

.straddle-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.straddle-table thead th {
    background: #ff9800;
    color: white;
    padding: 12px;
    font-weight: 600;
    border: 1px solid #f57c00;
    text-align: center;
}

.straddle-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.straddle-table tbody tr:hover {
    background: #fff3e0;
}

.straddle-table td {
    padding: 10px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
}

.straddle-table td.expiration {
    font-weight: 600;
    color: #ff9800;
    white-space: nowrap;
}

.straddle-table td.straddle-cost {
    font-weight: 700;
    color: #1e3c72;
    font-size: 1.05em;
}

.straddle-table td.breakeven-up {
    color: #4caf50;
}

.straddle-table td.breakeven-down {
    color: #f44336;
}

.straddle-table td.avg-iv {
    color: #667eea;
    font-weight: 600;
}

/* Options table specific styles */
.options-table-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.options-table-container h3 {
    color: #1e3c72;
    margin-bottom: 15px;
}

.options-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.options-table thead tr:first-child th {
    background: #1e3c72;
    color: white;
    padding: 12px;
    font-weight: 600;
    border: 1px solid #2a5298;
}

.options-table thead tr:last-child th {
    background: #2a5298;
    color: white;
    padding: 10px;
    font-size: 0.9em;
    border: 1px solid #1e3c72;
}

.calls-header {
    background: #4caf50 !important;
    text-align: center;
}

.strike-header, .expiry-header {
    background: #ff9800 !important;
    text-align: center;
}

.puts-header {
    background: #f44336 !important;
    text-align: center;
}

.options-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.options-table tbody tr:hover {
    background: #f5f5f5;
}

.options-table tbody tr.atm-row {
    background: #fff3e0;
    font-weight: 600;
}

.options-table tbody tr.atm-row:hover {
    background: #ffe0b2;
}

.options-table td {
    padding: 10px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
}

.options-table td.strike, .options-table td.expiration {
    font-weight: 600;
    background: #fafafa;
    color: #ff9800;
    white-space: nowrap;
}

.call-bid, .call-ask {
    color: #2e7d32;
}

.call-iv {
    color: #2e7d32;
    font-weight: 600;
}

.put-bid, .put-ask {
    color: #c62828;
}

.put-iv {
    color: #c62828;
    font-weight: 600;
}

.events-header {
    background: #9c27b0 !important;
    text-align: center;
}

.options-table td.events {
    font-size: 0.85em;
    white-space: nowrap;
}

.event-high-impact {
    display: inline-block;
    background: #ff5722;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    margin: 0 2px;
    font-weight: 700;
    font-size: 0.9em;
}

.event-normal {
    display: inline-block;
    background: #607d8b;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    margin: 0 2px;
    font-weight: 500;
    font-size: 0.9em;
}

/* Historical data table styles */
.historical-table-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.historical-table-container h3 {
    color: #1e3c72;
    margin-bottom: 15px;
}

.table-wrapper {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.historical-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.9em;
}

.historical-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.historical-table thead th {
    background: #1e3c72;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #2a5298;
}

.historical-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.historical-table tbody tr:hover {
    background: #f5f5f5;
}

.historical-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.historical-table tbody tr:nth-child(even):hover {
    background: #f0f0f0;
}

.historical-table td {
    padding: 8px 12px;
    font-family: 'Courier New', monospace;
}

.historical-table td.date-col {
    font-weight: 600;
    color: #1e3c72;
    white-space: nowrap;
}

.historical-table td.volume-col {
    text-align: right;
    color: #666;
}

.historical-table td.volume-combined {
    font-weight: 700;
    color: #1e3c72;
    background: #e3f2fd;
}

.historical-table td.tr-col {
    text-align: right;
    color: #667eea;
    font-weight: 600;
}

/* Calendar button */
.btn-calendar {
    background: #9c27b0;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
    margin-left: 10px;
}

.btn-calendar:hover {
    background: #7b1fa2;
}

/* DCA Calc button */
.btn-dca-calc {
    background: #00897b;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
    margin-left: 10px;
}

.btn-dca-calc:hover {
    background: #00695c;
}

/* Calendar section */
.calendar-section {
    margin-top: 30px;
}

.calendar-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.calendar-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.calendar-summary {
    margin-bottom: 15px;
    color: #666;
    font-size: 1em;
    font-weight: 600;
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.calendar-table thead th {
    background: #9c27b0;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #7b1fa2;
}

.calendar-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.calendar-table tbody tr:hover {
    background: #f5f5f5;
}

.calendar-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.calendar-table tbody tr:nth-child(even):hover {
    background: #f0f0f0;
}

.calendar-table td {
    padding: 10px 12px;
}

.calendar-table td.calendar-date {
    font-weight: 600;
    color: #1e3c72;
    white-space: nowrap;
    width: 120px;
}

.calendar-table td.calendar-day {
    color: #666;
    width: 60px;
    font-weight: 600;
}

.calendar-table td.calendar-events {
    font-size: 0.9em;
}

/* Monthly Calendar Grid */
.contract-toggle {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

.contract-toggle-btn {
    background: #e0e0e0;
    color: #333;
    border: 2px solid transparent;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 600;
    transition: all 0.3s;
}

.contract-toggle-btn:hover {
    background: #d0d0d0;
    transform: translateY(-2px);
}

.contract-toggle-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.month-calendar-wrapper {
    /* Styles removed - now handled by card-body */
}

/* Header row with day names - Mon-Fri only */
.month-calendar-header-row {
    display: grid;
    grid-template-columns: 70px repeat(5, minmax(90px, 1fr));
    gap: 6px;
    margin-bottom: 6px;
}

.labels-spacer {
    width: 70px;
}

.month-calendar-day-name {
    text-align: center;
    font-weight: 700;
    color: #1e3c72;
    padding: 8px;
    font-size: 0.85em;
}

/* Each week row - Mon-Fri only */
.calendar-week {
    display: grid;
    grid-template-columns: 70px repeat(5, minmax(90px, 1fr));
    gap: 6px;
    margin-bottom: 4px;
}

/* Week labels column */
.week-labels-column {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 0;
    width: 70px;
}

.row-label {
    height: 24px; /* Match row height */
    margin-bottom: 3px; /* Match day-row margin-bottom */
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    font-weight: 700;
    font-size: 0.75em;
    color: #1e3c72;
    text-transform: uppercase;
}

.row-label:first-of-type {
    margin-top: 28px; /* Account for day number height + margin-bottom */
}

/* Week days grid - Mon-Fri only */
.week-days {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    grid-column: span 5;
}

.month-calendar-day {
    min-height: 100px;
    height: auto;
    border: 2px solid #d0d5dd;
    border-radius: 6px;
    padding: 6px;
    background: white;
    transition: all 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.month-calendar-day:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.month-calendar-day.empty {
    border: none;
    background: transparent;
}

.month-calendar-day.other-month {
    background: #fafafa;
    border-color: #f0f0f0;
}

.month-calendar-day.other-month .day-number {
    color: #999;
}

.month-calendar-day.today {
    border-color: #ff9800;
    background: #fff3e0;
    box-shadow: 0 0 12px rgba(255, 152, 0, 0.3);
}

.month-calendar-day .day-number {
    font-weight: 700;
    font-size: 0.95em;
    color: #333;
    margin-bottom: 4px;
}

.month-calendar-day.today .day-number {
    color: #ff9800;
}

/* Calendar day rows */
.day-row {
    height: 24px;
    min-height: 24px;
    margin-bottom: 3px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding-bottom: 2px;
}

.day-dca-row {
    justify-content: center;
}

.day-events-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    white-space: nowrap;
    justify-content: center;
}

.day-status-row {
    justify-content: center;
}

.day-options-row {
    justify-content: center;
}

.day-sum-row {
    justify-content: center;
}

.event-badge, .event-badge-high {
    display: inline-block;
    font-size: 0.6em;
    padding: 1px 3px;
    border-radius: 2px;
    font-weight: 600;
    white-space: nowrap;
}

.event-badge {
    background: #9e9e9e;
    color: white;
}

.event-badge-high {
    background: #9e9e9e;
    color: white;
    font-weight: 700;
}

/* Status badges */
.status-badge {
    display: inline-block;
    font-size: 0.7em;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-align: center;
}

.status-badge.status-live {
    background: #4caf50;
    color: white;
}

.status-badge.status-expiring {
    background: #ff9800;
    color: white;
}

.status-badge.status-expired {
    background: #9e9e9e;
    color: white;
    opacity: 0.7;
}

.status-badge.status-pending {
    background: #2196f3;
    color: white;
    font-size: 0.65em;
}

.option-badge {
    display: inline-block;
    font-size: 0.75em;
    padding: 3px 6px;
    border-radius: 4px;
    margin: 2px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.option-badge.cached {
    border: 2px solid #ff9800;
    box-shadow: 0 0 4px rgba(255, 152, 0, 0.5);
}

.option-badge.no-data {
    background: #9e9e9e;
    color: white;
    opacity: 0.6;
}

/* O/E badges */
.oe-badge {
    display: inline-block;
    font-size: 0.7em;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-align: center;
}

.oe-badge.oe-expired {
    background: #9e9e9e;
    color: white;
    opacity: 0.7;
}

.oe-badge.oe-listing {
    background: #2196f3;
    color: white;
}

.oe-badge.oe-active {
    background: transparent;
    color: #4caf50;
    position: relative;
    padding-left: 18px;
}

.oe-badge.oe-active::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4caf50;
    animation: pulse 2s infinite;
}

/* DCA badge */
.dca-badge {
    display: inline-block;
    font-size: 0.7em;
    padding: 3px 6px;
    border-radius: 3px;
    font-weight: 700;
    text-align: center;
    min-width: 40px;
}

/* SUM display with data bar */
.sum-display {
    position: relative;
    width: 100%;
    height: 20px;
    background: #f5f5f5;
    border-radius: 3px;
    overflow: hidden;
}

.sum-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 3px 0 0 3px;
}

.sum-text {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
    font-weight: 700;
    z-index: 1;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.5);
}

/* Greeks Modal */
.greeks-modal {
    display: block;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.greeks-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.greeks-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.greeks-modal-close:hover,
.greeks-modal-close:focus {
    color: #000;
}

.greeks-modal-content h2 {
    color: #1e3c72;
    margin-bottom: 10px;
    font-size: 1.8em;
}

.greeks-expiration {
    color: #666;
    margin-bottom: 25px;
    font-size: 1.1em;
}

.greeks-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.greeks-column h3 {
    color: #2a5298;
    margin-bottom: 15px;
    font-size: 1.3em;
    border-bottom: 2px solid #2a5298;
    padding-bottom: 8px;
}

.greek-row {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    margin-bottom: 8px;
    background: #f5f5f5;
    border-radius: 6px;
}

.greek-label {
    font-weight: 600;
    color: #333;
}

.greek-value {
    font-family: 'Courier New', monospace;
    color: #1e3c72;
    font-weight: 700;
}

.no-greeks {
    color: #999;
    font-style: italic;
    padding: 20px;
    text-align: center;
}

/* DCA Calc Section */
.dca-calc-section {
    margin: 30px 0;
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #00897b;
}

.dca-calc-section h2 {
    color: #00897b;
    margin-bottom: 25px;
    font-size: 1.8em;
    border-bottom: 2px solid #00897b;
    padding-bottom: 10px;
}

.dca-calc-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.calc-explanation,
.calc-formula,
.calc-interpretation,
.calc-example,
.calc-usage,
.calc-note {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
}

.calc-explanation h3,
.calc-formula h3,
.calc-interpretation h3,
.calc-example h3,
.calc-usage h3 {
    color: #1e3c72;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.calc-explanation p,
.calc-formula p,
.calc-usage ul {
    color: #333;
    line-height: 1.6;
}

.formula-box {
    background: #263238;
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
}

.formula-box code {
    color: #4fc3f7;
    font-size: 1.1em;
    font-family: 'Courier New', monospace;
}

.formula-note {
    font-size: 0.9em;
    color: #666;
    font-style: italic;
    margin-top: 10px;
}

.interpretation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.interpretation-item {
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid;
}

.interpretation-item.positive {
    background: #e8f5e9;
    border-left-color: #4caf50;
}

.interpretation-item.positive strong {
    color: #2e7d32;
}

.interpretation-item.negative {
    background: #ffebee;
    border-left-color: #f44336;
}

.interpretation-item.negative strong {
    color: #c62828;
}

.interpretation-item.neutral {
    background: #fff8e1;
    border-left-color: #ffc107;
}

.interpretation-item.neutral strong {
    color: #f57f17;
}

.interpretation-item p {
    margin-top: 8px;
    font-size: 0.9em;
}

.example-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.example-table thead {
    background: #1e3c72;
    color: white;
}

.example-table th,
.example-table td {
    padding: 12px;
    text-align: left;
    border: 1px solid #ddd;
}

.example-table tbody tr:nth-child(even) {
    background: #f9f9f9;
}

.example-table tbody tr:hover {
    background: #e3f2fd;
}

.positive-value {
    color: #2e7d32;
    font-weight: 700;
}

.negative-value {
    color: #c62828;
    font-weight: 700;
}

.neutral-value {
    color: #f57f17;
    font-weight: 700;
}

/* Edge column colors (for StradControl and DCA Adjusted IV) */
.edge-positive {
    color: #2e7d32;
    font-weight: 700;
}

.edge-negative {
    color: #c62828;
    font-weight: 700;
}

.edge-neutral {
    color: #666;
    font-weight: 600;
}

.calc-usage ul {
    list-style: none;
    padding-left: 0;
}

.calc-usage li {
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}

.calc-usage li:last-child {
    border-bottom: none;
}

.calc-usage strong {
    color: #00897b;
}

.calc-note {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.calc-note p {
    color: #1565c0;
    margin: 0;
}

/* StradControl Table Styles */
.stradcontrol-table-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stradcontrol-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.stradcontrol-table thead th {
    background: #667eea;
    color: white;
    padding: 12px;
    font-weight: 600;
    border: 1px solid #5a75d6;
    text-align: center;
    font-size: 1em;
}

.stradcontrol-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.stradcontrol-table tbody tr:hover {
    background: #f5f5f5;
}

.stradcontrol-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.stradcontrol-table tbody tr:nth-child(even):hover {
    background: #f0f0f0;
}

.stradcontrol-table td {
    padding: 12px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
}

.stradcontrol-table td.date-col {
    font-weight: 600;
    color: #667eea;
    white-space: nowrap;
}

.stradcontrol-table td.black76-col {
    font-weight: 700;
    color: #1e3c72;
    font-size: 1.05em;
}

.stradcontrol-table td.dca25-col {
    color: #999;
    font-style: italic;
}

/* DCA Events Grid - Compact Layout */
.dca-events-list {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
}

.dca-events-list h3 {
    color: #1e3c72;
    margin-bottom: 5px;
    font-size: 1.3em;
}

.dca-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.dca-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid #ddd;
    transition: all 0.2s;
}

.dca-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.dca-item .event-name {
    font-weight: 600;
    color: #333;
    font-size: 0.85em;
}

.dca-item .atr-value {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 0.9em;
}

.dca-item .atr-value.high {
    color: #d32f2f;
    border-left-color: #d32f2f;
}

.dca-item:has(.atr-value.high) {
    border-left-color: #d32f2f;
    background: #ffebee;
}

.dca-item .atr-value.med {
    color: #1976d2;
}

.dca-item:has(.atr-value.med) {
    border-left-color: #1976d2;
}

.dca-item .atr-value.low {
    color: #757575;
}

.dca-item:has(.atr-value.low) {
    border-left-color: #9e9e9e;
}

/* Collapsible section styles */
.collapsible-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.collapsible-header:hover {
    opacity: 0.8;
}

.collapse-icon {
    display: inline-block;
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.collapsible-content {
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Hide only the logo header when page is in an iframe */
body.in-iframe header {
    display: none;
}

body.in-iframe {
    padding: 10px;
}

body.in-iframe .container {
    max-width: 100%;
}

body.in-iframe .controls-section {
    border-radius: 12px;
    margin-top: 0;
}
