/* Shared Stats Styles */
.stats-shared {
    flex: 0 0 auto;
    background-color: #000;
    color: #fff;
    border-top: 1px solid #333;
    padding: 10px;
    box-sizing: border-box;
}

/* Table Container Styles */
.table-container {
    flex: 0 0 auto;
    height: 100%;
    background-color: #000;
    min-width: 20%;
    max-width: 50%;
    padding-left: 10px;
    padding-right: 0;
    padding-top: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.table-scrollable {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.event-selector, .security-span-selector, .span-selector, .security-selector {
    width: 100%;
    margin-bottom: 10px;
}

.event-selector select,
.date-range-selector select,
.security-span-selector select,
.span-selector select,
.security-selector select {
    width: 100%;
    padding: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

.security-span-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-range-selector {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-range-selector label,
.span-selector label,
.security-selector label {
    font-weight: bold;
    white-space: nowrap;
}

#events-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8em;
}

#events-table th,
#events-table td {
    padding: 2px 4px;
    text-align: left;
    border: none;
    line-height: 1.1;
    color: #fff;
}

#events-table th {
    background-color: #555;
    font-weight: normal;
}

#events-table tbody td {
    text-align: right;
}

.greyed-out-date,
.greyed-out-time {
    color: #666;
}

#events-table .positive,
.stats-item .positive {
    color: #00ff00; /* Green */
}

#events-table .negative,
.stats-item .negative {
    color: #ff0000; /* Red */
}

.event-row .spx-change,
.event-row .straddle-performance,
.event-row .implied-move {
    text-align: right;
}

.event-row {
    cursor: pointer;
}

/* Splitter Styles */
.splitter {
    flex: 0 0 15px;
    background-color: #000;
    cursor: col-resize;
    height: 100%;
    pointer-events: auto;
    z-index: 10;
    user-select: none;
}

.splitter:hover {
    background-color: #333;
}

/* Tabbed View Styles */
.tabbed-view {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tab-nav {
    display: flex;
    border-bottom: 1px solid #333;
}

.tab-button {
    padding: 8px 16px;
    background-color: #222;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

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

.tab-button.active {
    background-color: #444;
    border-bottom: 2px solid #fff;
}

.tab-content {
    flex: 1;
    position: relative;
}

.tab-content > div {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Chart Container Styles */
.chart-container, .minutes-release-container {
    background-color: #000;
    min-width: 0;
    box-sizing: border-box;
    height: 100%;
    width: 100%;
    position: relative;
}



#chart-container div[style*="position: absolute"] {
    background: #000;
    color: #fff;
    padding: 2px 5px;
    font-size: 12px;
    white-space: pre; /* Preserve spaces */
}

/* Stats Container Styles */
.stats-container {
    padding: 10px;
    background-color: #000;
    color: #fff;
    overflow-y: auto;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8em;
}

.stats-table th,
.stats-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #333;
}

.stats-table th {
    background-color: #555;
    font-weight: normal;
}

#legend, #minutes-release-legend, #sequential-legend {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 1000;
    font-size: 0.8em;
    font-family: Arial, sans-serif;
    line-height: 1.1;
    font-weight: 300;
    color: #fff;
    background: rgba(0, 0, 0, 0.7);
    padding: 5px;
    display: block;
}

#sequential-legend .time-row {
    color: #fff;
    font-size: 14px;
}

.series-item {
    display: flex;
    justify-content: space-between;
}

.series-item strong {
    text-align: right;
    margin-left: 5px;
}

.series-color {
    width: 15px;
    height: 3px;
    margin-right: 10px;
    margin-top: 5px;
}

.y-axis-label {
    position: absolute;
    right: 0;
    top: 50%;
    transform: rotate(90deg) translateY(-230%);
    color: #fff;
    z-index: 1000;
}

.x-axis-label {
    position: absolute;
    bottom: 1px;
    left: 45%;
    transform: translateX(-50%);
    color: #fff;
    z-index: 1000;
    padding: 5px;
}

/* Response and Straddle Statistics Styles */
.response-stats {
    composes: stats-shared;
}

.straddle-stats {
    composes: stats-shared;
    margin-top: 15px;
}

.stats-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.stats-item {
    margin: 5px 0;
    white-space: nowrap;
    font-size: 1em;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calculate-toggle {
    display: flex;
    margin-left: auto;
}

.toggle-button {
    padding: 4px 8px;
    background-color: #222;
    color: #fff;
    border: none;
    border-right: 1px solid #333;
    cursor: pointer;
    font-size: 0.8em;
    transition: background-color 0.2s;
}

.toggle-button:last-child {
    border-right: none;
}

.toggle-button.active {
    background-color: #444;
    border-bottom: 2px solid #fff;
}

.toggle-button:hover {
    background-color: #333;
}

.toggle-button:focus {
    box-shadow: 0 0 3px #aaa;
    outline: none;
}

.stats-shared h3 {
    margin: 0;
    font-size: 1.2em;
}

.stats-shared label {
    margin-right: 10px;
}

.response-stats input[type="checkbox"] {
    margin: 0;
}

.response-stats input[type="number"] {
    width: 4em;
    margin-right: 10px;
    padding: 3px;
    font-size: 0.9em;
    background-color: #333;
    color: #fff;
    border: 1px solid #888;
}

.stats-value {
    font-weight: bold;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .table-container, .tabbed-view {
        width: 100%;
        flex: none;
    }
    .splitter {
        display: none;
    }
    .tabbed-view {
        order: -1;
        margin-bottom: 10px;
        height: 50%;
    }
    .table-container {
        order: 0;
        height: 50%;
    }
    .stats-shared {
        padding: 0;
    }
    .stats-header {
        flex-wrap: wrap;
    }
    .calculate-toggle {
        margin-left: 0;
        margin-top: 5px;
    }
    .toggle-button {
        font-size: 0.7em;
        padding: 3px 6px;
        border-right: 1px solid #333;
    }
    .toggle-button:last-child {
        border-right: none;
    }
    .toggle-button.active {
        border-bottom: 2px solid #fff;
    }
    .stats-shared h3 {
        font-size: 14px;
    }
    .response-stats input[type="number"] {
        width: 50px;
    }
    .security-span-selector {
        flex-direction: column;
        align-items: flex-start;
    }
}