/* 
   File         : rethres.css
   Description  : Layout styles for columns (third, half, row)
*/

/* CSS Variables */
:root {
    --binder-color: #3F71AE;
    --other-color: #A0A0A0;
    --threshold-color: #ff0000;
}

/* Use the same bold font as fragmentprofile's Plotly plot */
@font-face {
    font-family: "DejaVuSansBoldWeb";
    src: url("../../fonts/DejaVuSans-Bold.ttf") format("truetype");
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}
/* Match fragmentprofile overflow behavior so header tooltips aren’t clipped */
.advanced-results-table thead th { overflow: visible !important; }
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
/* Make the results card span the full container width like stats-summary */
.page-card.results-card {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    display: block;
    box-sizing: border-box;
}
.page-card.results-card .search-results {
    width: 100%;
}
.controls-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
    justify-content: center;
}
.slider-group {
    min-width: 250px;
    flex: 1;
    padding: 10px; /* reduced padding to lower height */
    background-color: #f8f9fa;
    border-radius: 5px;
    font-size: 12px; /* reduce font size to prevent overflow */
}
.slider-container {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 8px;
}
.slider-container label {
    width: 90px; /* slightly narrower */
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* prevent label overflow */
}
.slider-container input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #3F71AE 0%, #3F71AE var(--slider-progress, 0%), #e0e0e0 var(--slider-progress, 0%), #e0e0e0 100%);
    outline: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3F71AE;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3F71AE;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: none;
}

.slider-container input[type="range"]::-moz-range-track {
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #3F71AE 0%, #3F71AE var(--slider-progress, 0%), #e0e0e0 var(--slider-progress, 0%), #e0e0e0 100%);
}
.slider-container .value {
    width: 44px;
    text-align: right;
    margin-left: 6px;
    font-family: monospace;
    font-size: 12px;
}
@media (max-width: 768px) {
    .split-view { flex-direction: column; }
    .slider-container { flex-direction: column; align-items: stretch; }
    .slider-container label, .slider-container .value { width: 100%; text-align: left; margin-left: 0; }
    .slider-container input[type="range"] { width: 100%; }
}
.plot-container {
    position: relative;
    height: 490px;
    width: 100%;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    font-family: DejaVuSansBoldWeb, "DejaVu Sans", Arial, sans-serif;
}
.buttons-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 12px 0; /* slightly reduced vertical spacing */
}
/* Buttons use global .button styles from main.css (same as fragmentprofile) */
/* Remove persistent row coloring for Binders */
.stats-summary {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    text-align: center;
}
.tooltip {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 10px;
    pointer-events: none;
    font-size: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    font-family: DejaVuSansBoldWeb, "DejaVu Sans", Arial, sans-serif;
}
.axis-title {
    font-size: 14px;
    fill: #292c2f; /* brand text color to match fragmentprofile */
}
.threshold-equation {
    background-color: #e9ecef;
    padding: 10px;
    border-radius: 5px;
    display: inline-block;
    margin: 10px 0;
    font-family: monospace;
}
.split-view {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}
.plot-side {
    flex: 3;
}
.info-side {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.point-detail {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.point-detail h3 {
    margin-top: 0;
    color: #3F71AE;
}
.point-detail p {
    margin: 5px 0;
}
.point-detail .label {
    font-weight: bold;
}
.legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}
.legend-color {
    width: 15px;
    height: 15px;
    border-radius: 50%;
}

.legend-color[data-color="binders"] {
    background-color: var(--binder-color);
}

.legend-color[data-color="others"] {
    background-color: var(--other-color);
}

/* SVG Elements */
.binder-circle {
    fill: var(--binder-color);
    stroke: #000000;
    stroke-width: 2px;
}

.threshold-line {
    stroke: var(--threshold-color);
}

/* Base plot styles */
.plot-container {
    width: 100%;
    height: 490px;
    border: 1px solid #ddd;
    position: relative;
    background-color: white;
}

.tooltip {
    position: absolute;
    padding: 8px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 3px;
    pointer-events: none;
    z-index: 100;
    font-size: 12px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

/* Split view layout is already defined above */

/* plot-side and info-side styles are defined above */

/* point-detail styles are defined above */

/* Legend styles */
.legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Sliders */
.slider-container {
    margin-bottom: 15px;
}

.slider-container label {
    display: block;
    margin-bottom: 5px;
}

.slider-container input[type="range"] {
    width: 100%;
    margin-bottom: 5px;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #3F71AE 0%, #3F71AE var(--slider-progress, 0%), #e0e0e0 var(--slider-progress, 0%), #e0e0e0 100%);
    outline: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3F71AE;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3F71AE;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: none;
}

.slider-container input[type="range"]::-moz-range-track {
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #3F71AE 0%, #3F71AE var(--slider-progress, 0%), #e0e0e0 var(--slider-progress, 0%), #e0e0e0 100%);
}

.value {
    font-weight: bold;
}

/* Buttons */
.buttons-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.button {
    padding: 8px 16px;
    background-color: var(--primary-blue, #3F71AE);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

.button:hover {
    background-color: var(--primary-blue-darker, #2c5182);
}

/* Table styles */
.results-container {
    margin-top: 30px;
}

/* Responsive layout */
@media (max-width: 768px) {
    .split-view {
        flex-direction: column;
    }
    
    .plot-side, .info-side {
        width: 100%;
    }
    
    .plot-container {
        height: 400px;
    }
}
.legend svg { display: block; }
