/* ==========================================
   SPOTLITE Anomaly Dashboard
   Responsive / Mobile Layout
   ========================================== */

   * {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.dashboard-page {
    width: 100%;
    max-width: 100%;
}

.dashboard-control {
    width: 100%;
}


/* ==========================================
   Tablet and phone layout
   ========================================== */

@media screen and (max-width: 768px) {

    /* Overall page */
    .dashboard-page {
        padding: 10px 10px !important;
        font-size: 14px !important;
        overflow-x: hidden;
    }

    /* Header */
    .dashboard-header {
        margin-bottom: 14px !important;
    }

    .dashboard-title {
        font-size: 24px !important;
        line-height: 1.15 !important;
        margin-top: 4px !important;
    }

    .dashboard-subtitle {
        font-size: 13px !important;
        line-height: 1.35 !important;
        padding-left: 8px;
        padding-right: 8px;
    }

    /* Controls */
    .control-row {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 8px !important;
        align-items: stretch !important;
    }

    .dashboard-control {
        width: 100% !important;
        min-width: 0 !important;
        flex: none !important;
        font-size: 14px !important;
    }

    .reset-button {
        width: 100% !important;
        height: 42px !important;
        margin-top: 2px !important;
    }

    /* Year slider */
    .year-slider-container {
        margin: 16px 8px 18px 8px !important;
    }

    /* Map */
    .map-card {
        width: 100% !important;
        max-width: 100% !important;
        padding: 6px !important;
        border-radius: 8px !important;
        overflow: hidden;
    }

    .anomaly-map {
        width: 100% !important;
        max-width: 100% !important;
        height: 68vh !important;
        min-height: 500px !important;
    }

    /* Bottom dashboard section */
    .bottom-row {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 12px !important;
        align-items: stretch !important;
    }

    .time-series-card,
    .summary-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: none !important;
    }

    /* Summary */
    .summary-content {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 12px !important;
    }

    .summary-details {
        width: 100% !important;
        min-width: 0 !important;
        flex: none !important;
    }

    .summary-divider {
        display: none !important;
    }

    /* Logo */
    .logo-container {
        width: 100% !important;
        min-width: 0 !important;
        flex: none !important;
        padding: 8px 4px !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .cline-logo {
        width: 70% !important;
        max-width: 240px !important;
        max-height: 110px !important;
        margin: 0 auto !important;
    }
    .time-series-card .js-plotly-plot,
    .time-series-card .plot-container,
    .time-series-card .svg-container {
        width: 100% !important;
    }
}


/* ==========================================
   Smaller phones
   ========================================== */

@media screen and (max-width: 480px) {

    .dashboard-page {
        padding: 8px 7px !important;
    }

    .dashboard-title {
        font-size: 21px !important;
    }

    .dashboard-subtitle {
        font-size: 12px !important;
    }

    .dashboard-control {
        font-size: 13px !important;
    }

    .anomaly-map {
        min-height: 480px !important;
        height: 65vh !important;
    }

    .time-series-card,
    .summary-card,
    .map-card {
        padding: 8px !important;
    }

    .cline-logo {
        width: 65% !important;
        max-width: 200px !important;
    }
}
/* Make Dash/Plotly graphs respect their mobile containers */
.js-plotly-plot,
.plot-container,
.svg-container {
    max-width: 100% !important;
}

.time-series-card {
    overflow: hidden;
}