﻿:root {
    --waves-dashboard-navy: #123f4d;
    --waves-dashboard-blue: #087da6;
    --waves-dashboard-teal: #00a5a5;
    --waves-dashboard-background: #f3f9fb;
    --waves-dashboard-light: #eef8fb;
    --waves-dashboard-surface: #ffffff;
    --waves-dashboard-border: #d4e7ec;
    --waves-dashboard-text: #173d4b;
    --waves-dashboard-muted: #627d88;
    --waves-dashboard-shadow: 0 6px 20px rgba(18, 63, 77, 0.07);
    --waves-dashboard-radius: 16px;
}


/* =========================================================
   PAGE
========================================================= */

.waves-dashboard-page {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: -2rem;
    overflow-x: hidden;
    background: var(--waves-dashboard-background);
    color: var(--waves-dashboard-text);
}


.dashboard-shell {
    width: min(1450px, calc(100% - 48px));
    margin-inline: auto;
}


/* =========================================================
   HERO
========================================================= */

.dashboard-hero {
    min-height: 280px;
    display: flex;
    align-items: center;
    background-image: linear-gradient( to right, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.78) 55%, rgba(255, 255, 255, 0.72) 100% ), url('/Image/BG_image.jpeg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-bottom: 1px solid #d9edf2;
}


.dashboard-hero-content {
    max-width: 880px;
    padding: 34px 0;
}


.dashboard-eyebrow {
    margin: 0 0 7px;
    color: var(--waves-dashboard-blue);
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}


.dashboard-hero h1 {
    margin: 0 0 20px;
    color: #123f4d;
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    padding-left: 2%;
}


.dashboard-description {
    max-width: 900px;
    margin: 0;
    color: #163b46;
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1.7;
    padding-left: 2%;
}

/* =========================================================
   DASHBOARD CONTENT
========================================================= */

.dashboard-content {
    padding: 24px 0 48px;
}


/* =========================================================
   COMMON CARD STYLE
========================================================= */

.dashboard-filter-card,
.dashboard-overview-card,
.dashboard-map-card {
    background: var(--waves-dashboard-surface);
    border: 1px solid var(--waves-dashboard-border);
    border-radius: var(--waves-dashboard-radius);
    box-shadow: var(--waves-dashboard-shadow);
}


/* =========================================================
   SECTION HEADINGS
========================================================= */

.dashboard-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}


.dashboard-heading-icon,
.dashboard-map-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #e4f5f8;
    color: var(--waves-dashboard-blue);
    font-size: 1.22rem;
}


.dashboard-section-heading h2,
.dashboard-map-title-area h2 {
    margin: 0;
    color: var(--waves-dashboard-navy);
    font-size: 1.3rem;
    font-weight: 750;
    line-height: 1.2;
}


.dashboard-section-heading p,
.dashboard-map-title-area p {
    margin: 3px 0 0;
    color: var(--waves-dashboard-muted);
    font-size: 0.9rem;
}


/* =========================================================
   FILTER PANEL
========================================================= */

.dashboard-filter-card {
    padding: 22px 24px;
}


.dashboard-filters-grid {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(170px, 1fr) minmax(190px, 1.15fr) minmax(175px, 1fr) minmax(160px, 0.9fr);
    gap: 15px;
    align-items: end;
}


.dashboard-filter-field {
    min-width: 0;
}


    .dashboard-filter-field label {
        display: flex;
        align-items: center;
        gap: 7px;
        margin-bottom: 7px;
        color: var(--waves-dashboard-navy);
        font-size: 0.88rem;
        font-weight: 700;
    }


        .dashboard-filter-field label i {
            color: var(--waves-dashboard-blue);
        }


    .dashboard-filter-field .form-select {
        width: 100%;
        min-height: 44px;
        padding: 9px 38px 9px 12px;
        border: 1px solid #cbdfe5;
        border-radius: 9px;
        background-color: #ffffff;
        color: var(--waves-dashboard-text);
        font-size: 0.92rem !important;
        box-shadow: none;
    }


        .dashboard-filter-field .form-select:hover {
            border-color: #aed2dc;
        }


        .dashboard-filter-field .form-select:focus {
            border-color: var(--waves-dashboard-teal);
            box-shadow: 0 0 0 3px rgba(0, 165, 165, 0.12);
        }


/* =========================================================
   SPECIFIC WEEK
========================================================= */

.dashboard-specific-week {
    max-width: 330px;
    margin-top: 16px;
}


    .dashboard-specific-week[hidden] {
        display: none !important;
    }


/* =========================================================
   FILTER BUTTONS
========================================================= */

.dashboard-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 18px;
}


.dashboard-apply-btn,
.dashboard-reset-btn {
    min-height: 44px;
    padding: 9px 19px;
    border-radius: 9px;
    font-size: 0.92rem;
    font-weight: 700;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}


.dashboard-apply-btn {
    border: 1px solid var(--waves-dashboard-blue);
    background: var(--waves-dashboard-blue);
    color: #ffffff;
}


    .dashboard-apply-btn:hover {
        background: #066b8e;
        border-color: #066b8e;
    }


.dashboard-reset-btn {
    border: 1px solid var(--waves-dashboard-blue);
    background: #ffffff;
    color: var(--waves-dashboard-blue);
}


    .dashboard-reset-btn:hover {
        background: #edf8fb;
    }


    .dashboard-apply-btn:active,
    .dashboard-reset-btn:active {
        transform: translateY(1px);
    }


/* =========================================================
   MAIN TWO-COLUMN DASHBOARD
========================================================= */

.dashboard-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(390px, 0.88fr);
    gap: 18px;
    align-items: stretch;
    margin-top: 20px;
}


/* =========================================================
   REPORT OVERVIEW
========================================================= */

.dashboard-overview-card {
    min-width: 0;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
}


/* =========================================================
   SUMMARY CARDS
========================================================= */

.dashboard-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}


.dashboard-summary-card {
    min-width: 0;
    min-height: 132px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid #deedf1;
    border-radius: 14px;
}


.dashboard-summary-total {
    background: #eff8fc;
}


.dashboard-summary-week {
    background: #edfaf7;
}


.dashboard-summary-location {
    background: #f5f1fc;
}


.dashboard-summary-icon {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.82);
    color: var(--waves-dashboard-blue);
    font-size: 1.55rem;
}


.dashboard-summary-week .dashboard-summary-icon {
    color: var(--waves-dashboard-teal);
}


.dashboard-summary-location .dashboard-summary-icon {
    color: #6754c7;
}


.dashboard-summary-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
}


.dashboard-summary-label {
    color: var(--waves-dashboard-muted);
    font-size: 0.84rem;
    font-weight: 600;
}


.dashboard-summary-number {
    margin: 2px 0;
    color: var(--waves-dashboard-navy);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.05;
}


.dashboard-summary-note {
    color: var(--waves-dashboard-muted);
    font-size: 0.8rem;
    line-height: 1.3;
}


/* =========================================================
   MAIN CHART CARD
========================================================= */

.dashboard-chart-card {
    flex: 1;
    margin-top: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    border: 1px solid #dcebef;
    border-radius: 14px;
    background: #ffffff;
}


.dashboard-chart-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e5eef1;
}


    .dashboard-chart-header h3 {
        margin: 0;
        color: var(--waves-dashboard-navy);
        font-size: 1.08rem;
        font-weight: 750;
    }


    .dashboard-chart-header p {
        margin: 4px 0 0;
        color: var(--waves-dashboard-muted);
        font-size: 0.85rem;
    }


.dashboard-chart-badge {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    border-radius: 20px;
    background: #eaf7fb;
    color: var(--waves-dashboard-blue);
    font-size: 0.82rem;
    font-weight: 700;
}


/* =========================================================
   CHART CONTENT
========================================================= */

.dashboard-chart-content {
    flex: 1;
    min-height: 410px;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    align-items: center;
    gap: 24px;
    padding: 20px 8px 4px;
}


.dashboard-chart-visual {
    width: 100%;
    min-width: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}


    .dashboard-chart-visual svg {
        width: min(100%, 420px);
        height: auto;
        overflow: visible;
    }


/* =========================================================
   PIE CHART
========================================================= */

.dashboard-pie-slice {
    stroke: #ffffff;
    stroke-width: 2;
    transition: opacity 0.15s ease, transform 0.15s ease;
    transform-origin: center;
}


    .dashboard-pie-slice:hover {
        opacity: 0.88;
    }


.dashboard-pie-label {
    fill: #ffffff;
    font-weight: 700;
    pointer-events: none;
}


.dashboard-pie-label-name {
    font-size: 12px;
}


.dashboard-pie-label-percent {
    font-size: 13px;
}


/* Legend is intentionally hidden because
   pie labels are displayed inside slices. */

.dashboard-chart-legend {
    display: none;
}


/* =========================================================
   BAR CHART
========================================================= */

.dashboard-bar-chart {
    width: min(100%, 900px);
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 18px 8px;
}


.dashboard-bar-row {
    display: grid;
    grid-template-columns: 145px minmax(0, 1fr);
    gap: 15px;
    align-items: center;
}


.dashboard-bar-label {
    color: var(--waves-dashboard-navy);
    font-size: 0.9rem;
    font-weight: 700;
    text-align: right;
    overflow-wrap: anywhere;
}


.dashboard-bar-area {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 78px;
    gap: 10px;
    align-items: center;
}


.dashboard-bar-track {
    width: 100%;
    height: 30px;
    overflow: hidden;
    border-radius: 8px;
    background: #edf4f6;
}


.dashboard-bar-fill {
    height: 100%;
    min-width: 4px;
    border-radius: 8px;
    transition: width 0.35s ease;
}


.dashboard-bar-value {
    color: var(--waves-dashboard-text);
    font-size: 0.84rem;
    font-weight: 700;
    white-space: nowrap;
}


/* =========================================================
   TREND CHART
========================================================= */

.dashboard-trend-svg {
    width: min(100%, 900px) !important;
    height: auto;
    overflow: visible;
}


.dashboard-trend-grid {
    stroke: #dfecef;
    stroke-width: 1;
}


.dashboard-trend-line {
    fill: none;
    stroke: var(--waves-dashboard-blue);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}


.dashboard-trend-point {
    fill: #ffffff;
    stroke: var(--waves-dashboard-blue);
    stroke-width: 4;
    cursor: pointer;
}


    .dashboard-trend-point:hover {
        fill: #e6f7fa;
    }


.dashboard-trend-axis {
    fill: var(--waves-dashboard-muted);
    font-size: 13px;
}


.dashboard-trend-label {
    fill: var(--waves-dashboard-text);
    font-size: 13px;
    font-weight: 600;
}


.dashboard-trend-value {
    fill: var(--waves-dashboard-navy);
    font-size: 14px;
    font-weight: 800;
}


/* =========================================================
   TREND GUIDANCE
========================================================= */

.dashboard-chart-guidance {
    width: min(100%, 600px);
    min-height: 270px;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    color: var(--waves-dashboard-muted);
}


    .dashboard-chart-guidance i {
        width: 58px;
        height: 58px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: #e9f7fa;
        color: var(--waves-dashboard-blue);
        font-size: 1.7rem;
    }


    .dashboard-chart-guidance strong {
        color: var(--waves-dashboard-navy);
        font-size: 1.1rem;
    }


    .dashboard-chart-guidance p {
        max-width: 480px;
        margin: 0;
        line-height: 1.55;
    }


/* =========================================================
   LOADING + NO DATA
========================================================= */

.dashboard-chart-message {
    flex: 1;
    min-height: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    color: var(--waves-dashboard-muted);
}


    .dashboard-chart-message[hidden] {
        display: none !important;
    }


    .dashboard-chart-message strong {
        color: var(--waves-dashboard-navy);
        font-size: 1.05rem;
    }


    .dashboard-chart-message i {
        color: var(--waves-dashboard-blue);
        font-size: 2rem;
    }


.dashboard-loading-spinner {
    width: 38px;
    height: 38px;
    border: 4px solid #d7edf2;
    border-top-color: var(--waves-dashboard-blue);
    border-radius: 50%;
    animation: dashboard-spin 0.8s linear infinite;
}


@keyframes dashboard-spin {

    to {
        transform: rotate(360deg);
    }
}


/* =========================================================
   WATER SITE MAP
========================================================= */

.dashboard-map-card {
    min-width: 0;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
}


.dashboard-map-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}


.dashboard-map-title-area {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}


.dashboard-map-full-button {
    flex-shrink: 0;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--waves-dashboard-blue);
    border-radius: 8px;
    background: #ffffff;
    color: var(--waves-dashboard-blue);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}


    .dashboard-map-full-button:hover {
        background: #eef9fc;
    }


    .dashboard-map-full-button:active {
        transform: translateY(1px);
    }


.dashboard-map-container {
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--waves-dashboard-border);
    border-radius: 13px;
    background: #eef6f8;
}


#waterSiteMap {
    width: 100%;
    height: 100%;
    min-height: 545px;
}


/* =========================================================
   SELECTED LOCATION
========================================================= */

.dashboard-selected-location {
    margin-top: 12px;
    min-height: 72px;
    padding: 13px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--waves-dashboard-border);
    border-radius: 12px;
    background: #f7fbfc;
}


.dashboard-selected-location-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e6f6fa;
    color: var(--waves-dashboard-blue);
    font-size: 1.1rem;
}


.dashboard-selected-location strong {
    display: block;
    color: var(--waves-dashboard-navy);
    font-size: 0.9rem;
}


.dashboard-selected-location span {
    display: block;
    margin-top: 2px;
    color: var(--waves-dashboard-muted);
    font-size: 0.82rem;
}


/* =========================================================
   LEAFLET POLISH
========================================================= */

.leaflet-container {
    font-family: inherit;
}


.leaflet-popup-content-wrapper {
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(18, 63, 77, 0.16);
}


.leaflet-popup-content {
    color: var(--waves-dashboard-text);
    font-size: 0.88rem;
    line-height: 1.4;
}


    .leaflet-popup-content strong {
        color: var(--waves-dashboard-navy);
    }


/* =========================================================
   FULL MAP MODE
========================================================= */

.dashboard-map-card.dashboard-map-expanded {
    position: fixed;
    inset: 16px;
    z-index: 9999;
    margin: 0;
    overflow: auto;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
}


    .dashboard-map-card.dashboard-map-expanded #waterSiteMap {
        height: calc(100vh - 185px);
        min-height: 500px;
    }


body.dashboard-map-open {
    overflow: hidden;
}

/* =========================================================
   LAPTOP SCREEN SIZE
========================================================= */

@media (min-width: 1201px) and (max-width: 1700px) {

    .dashboard-shell {
        width: min(1240px, calc(100% - 80px));
    }

    .dashboard-filters-grid {
        gap: 12px;
    }

    .dashboard-main-grid {
        grid-template-columns: minmax(0, 1.12fr) minmax(380px, 0.88fr);
    }
}

/* =========================================================
   RESPONSIVE - LARGE TABLETS
========================================================= */

@media (max-width: 1200px) {

    .dashboard-filters-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-summary-card {
        min-height: 120px;
    }

    #waterSiteMap {
        height: 460px;
        min-height: 460px;
    }
}


/* =========================================================
   RESPONSIVE - TABLETS
========================================================= */

@media (max-width: 850px) {

    .dashboard-shell {
        width: min(100% - 28px, 1450px);
    }

    .dashboard-filters-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-summary-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-summary-card {
        min-height: 105px;
    }

    .dashboard-chart-content {
        min-height: 350px;
    }
}


/* =========================================================
   RESPONSIVE - SMALL DEVICES
========================================================= */

@media (max-width: 700px) {

    .dashboard-map-header {
        flex-direction: column;
    }

    .dashboard-map-full-button {
        width: 100%;
    }

    #waterSiteMap {
        height: 380px;
        min-height: 380px;
    }

    .dashboard-bar-row {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .dashboard-bar-label {
        text-align: left;
    }

    .dashboard-bar-area {
        grid-template-columns: minmax(0, 1fr) 70px;
    }

    .dashboard-map-card.dashboard-map-expanded {
        inset: 6px;
    }

        .dashboard-map-card.dashboard-map-expanded #waterSiteMap {
            height: calc(100vh - 225px);
        }
}


/* =========================================================
   RESPONSIVE - MOBILE
========================================================= */

@media (max-width: 600px) {

    .dashboard-hero {
        min-height: 195px;
    }

    .dashboard-hero-content {
        padding: 27px 0;
    }

    .dashboard-hero h1 {
        font-size: 2.35rem;
    }

    .dashboard-description {
        font-size: 0.92rem;
    }

    .dashboard-filters-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-filter-actions {
        flex-direction: column;
    }

    .dashboard-apply-btn,
    .dashboard-reset-btn {
        width: 100%;
    }

    .dashboard-specific-week {
        max-width: none;
    }

    .dashboard-overview-card,
    .dashboard-map-card,
    .dashboard-filter-card {
        padding: 17px;
    }

    .dashboard-chart-card {
        padding: 16px;
    }

    .dashboard-chart-header {
        flex-direction: column;
    }

    .dashboard-chart-content {
        min-height: 0;
        padding-inline: 0;
    }

    .dashboard-chart-visual svg {
        width: min(100%, 340px);
    }
}


/* =========================================================
   EXTRA SMALL MOBILE
========================================================= */

@media (max-width: 430px) {

    .dashboard-shell {
        width: min(100% - 20px, 1450px);
    }

    .dashboard-summary-card {
        padding: 15px;
    }

    .dashboard-summary-icon {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
        font-size: 1.4rem;
    }

    .dashboard-summary-number {
        font-size: 1.8rem;
    }

    .dashboard-chart-badge {
        padding: 6px 10px;
    }
}
