#plotlyChart {
    width: 100%;
    min-height: 900px;
    height: auto;
    max-height: 85vh;
    margin: 0;
    border-radius: 10px;
    padding: 0;
    background-color: white;
    position: relative;
    /* IMPORTANT: needed for corner image */
    overflow: hidden;
}

#plotlyChart .corner-image {
    position: absolute;
    bottom: 10px;
    /* distance from bottom */
    right: 10px;
    /* distance from right */
    opacity: 1;
    /* optional */
    pointer-events: none;
    /* does not block mouse interaction */
    z-index: 10;
}

#plotlyChart .corner-image2 {
    position: absolute;
    bottom: 10px;
    /* distance from bottom */
    left: 10px;
    /* distance from right */
    opacity: 1;
    /* optional */
    pointer-events: none;
    /* does not block mouse interaction */
    z-index: 10;
}

/* Responsive Plotly chart */
@media (max-width: 768px) {
    #plotlyChart {
        min-height: 400px;
        max-height: 70vh;
        border-radius: 8px;
    }

    #plotlyChart .corner-image {
        bottom: 5px;
        right: 5px;
        max-width: 60px;
        max-height: 60px;
    }
	
    #plotlyChart .corner-image2 {
        bottom: 5px;
        left: 5px;
        max-width: 60px;
        max-height: 60px;
    }
}

@media (max-width: 480px) {
    #plotlyChart {
        min-height: 350px;
        max-height: 60vh;
        border-radius: 6px;
    }

    #plotlyChart .corner-image {
        bottom: 3px;
        right: 3px;
        max-width: 50px;
        max-height: 50px;
    }
	
    #plotlyChart .corner-image2 {
        bottom: 3px;
        left: 3px;
        max-width: 50px;
        max-height: 50px;
    }
}


#chartContainer {
    width: 100%;
    min-height: 900px;
    height: auto;
    max-height: 85vh;
    margin: 0;
    border-radius: 10px;
    padding: 0;
    background-color: white;
    position: relative;
    /* fine but not needed for the img */
    overflow: hidden;
}

#chart .corner-image {
    position: absolute;
    bottom: 10px;
    right: 10px;
    opacity: 1;
    pointer-events: none;
    z-index: 10;
}

#chart .corner-image2 {
    position: absolute;
    bottom: 10px;
    left: 10px;
    opacity: 1;
    pointer-events: none;
    z-index: 10;
}

/* Responsive Chart container */
@media (max-width: 768px) {
    #chartContainer {
        min-height: 400px;
        max-height: 70vh;
        border-radius: 8px;
    }

    #chart .corner-image {
        bottom: 5px;
        right: 5px;
        max-width: 60px;
        max-height: 60px;
    }
	
    #chart .corner-image2 {
        bottom: 5px;
        left: 5px;
        max-width: 60px;
        max-height: 60px;
    }
}

@media (max-width: 480px) {
    #chartContainer {
        min-height: 350px;
        max-height: 60vh;
        border-radius: 6px;
    }

    #chart .corner-image {
        bottom: 3px;
        right: 3px;
        max-width: 50px;
        max-height: 50px;
    }
	
    #chart .corner-image2 {
        bottom: 3px;
        left: 3px;
        max-width: 50px;
        max-height: 50px;
    }
}

/* Additional responsive chart styles */
.chart-wrapper,
.chart-container,
.canvas-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Highcharts responsive */
.highcharts-container {
    width: 100% !important;
    max-width: 100% !important;
}

/* Chart.js responsive */
canvas {
    max-width: 100% !important;
    height: auto !important;
}

/* Plotly responsive */
.plotly {
    width: 100% !important;
    max-width: 100% !important;
}

/* Mobile-specific chart adjustments */
@media (max-width: 768px) {

    .chart-wrapper,
    .chart-container,
    .canvas-container {
        padding: 0.5rem;
    }

    #chartBinned,
    #chartContainer,
    #plotlyChart {
        min-height: 400px !important;
        max-height: 70vh !important;
    }
}

@media (max-width: 480px) {

    .chart-wrapper,
    .chart-container,
    .canvas-container {
        padding: 0.25rem;
    }

    #chartBinned,
    #chartContainer,
    #plotlyChart {
        min-height: 350px !important;
        max-height: 60vh !important;
    }

    /* Ensure touch-friendly chart interactions */
    .highcharts-container,
    .plotly {
        touch-action: pan-x pan-y;
    }
}
