/* data zone (hidden initially） */
#dataContainer {
	padding: 10px;
	background-color: #f9f9f9;
	border-top: 1px solid #ddd;
	display: none;
}

/* used for the chart */
.chart-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    width: 80vw;
    z-index: 2000;
}

.chart-header {
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.chart-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.chart-body {
    /*width: 100%;
    max-height: 60vh; 
    overflow: auto;
    padding-bottom: 40px;*/  /* avoid overlap between x-ticks and slider */
    width: 100%;
    max-height: 70vh;
    padding: 10px 15px 40px;  /* keep extra space for x-axis ticks and slider */
    overflow: hidden;         /* avoid inner scrollbars for the main chart area */
}

/* chart body */
/* .chart-body canvas {
    display: block;
    width: 100%;
    height: auto;
} */
 /* Inner wrapper that defines the real chart height */
.chart-body-inner {
    position: relative;
    width: 96%;
    height: min(60vh, 420px); /* adjust 420px if you want a taller/shorter chart */
    margin: 0 auto;
}

/* Make the canvas fill the wrapper exactly */
.chart-body-inner canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Global canvas: keep responsive width but do not fix height here */
canvas {
    max-width: 100%;
    margin-bottom: 20px;
    /* do NOT set a fixed height here, it is controlled by chart-body-inner */
}

/* chart slider */
.chart-slider-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 10px;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
}

#chartContainer {
    position: relative;
    width: 80%;
    margin: auto;
}

/* tooltips on the extrema (dash line) */
.chart-extrema-tooltip {
    position: absolute;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.85);
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 3000;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.1s ease;
}

/* slider */
.range-slider-container {
    width: 100%;
    text-align: center;
    margin-top: 5px auto;
    padding: 0;
}

.range-slider-container #range-slider {
    width: 80%;
    margin: auto;
}

#range-slider {
    margin-top: 15px;
    width: 80%;
    
    height: 30px;
}

#range-slider .noUi-connect {
    background-color: rgba(30, 30, 30, 0.5);
}


.noUi-handle {
    background: #007bff !important;
    border: 1px solid white;
    width: 1px;
    height: 20px;
    border-radius: 0;
    box-shadow: 0 0 px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.noUi-connect {
    background: #d3d3d3;
}

.noUi-base {
    background: #f0f0f0;
}

.noUi-tooltip {
    
    font-size: 12px;
    background: #007bff;
    color: white;
    padding: 2px 5px;
    border-radius: 0px;
}


#slider-values {
    text-align: center;
    font-weight: bold;
    margin-top: 10px;
}

/* adjust chart size when when windows becomes smaller */
@media (max-width: 768px) {
    .chart-popup {
        width: 80vw; /* make it 80% wide */
        max-width: 600px;
    }
}