/* CHARTS AND MAPS */

.chart {
    display: flex;

    flex: 1;
    flex-direction: column;
    gap: var(--space-sm);
    min-width: 400px;
    min-height: 500px;
    max-height: 800px;
    background-color: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);

    &:not(.table-chart) { padding: var(--space-xs); }
    &.in-card {
        border: 2px solid var(--light);
        box-shadow: none;
    }

    &.in-card-borderless {
        padding: 0;
        border: none;
        box-shadow: none;
    }

    > header {
        position: sticky;
    }

    > main {
        flex: 1;
        align-content: flex-end;
        overflow: hidden;
        > div {
            scrollbar-width: thin;
        }
        > span {
            font-size: calc(var(--font-size-xl) * 1.5);
            color: var(--info);
        }
    }

    &.kpi {
        gap: var(--space-xs);
        min-width: 200px;
        min-height: auto;

        &[data-dashboard-kpi-filterable="true"] {
            cursor: pointer;
        }
    }

    &.table-chart {
        > header {
            padding: var(--space-xs);
            padding-bottom: 0;
        }
    }

    canvas, [data-dashboard-map] {
        display: block;
        width: 100% !important;
        min-width: 0;
        max-width: 100%;
    }

    &.is-maximized {
        position: fixed;
        inset: var(--space-sm);
        z-index: var(--z-index-modal);
        width: calc(100vw - (2 * var(--space-sm)));
        min-height: calc(100vh - (2 * var(--space-sm)));
        max-height: none;
        margin: 0;
        box-shadow: var(--shadow-lg);
    }
}

.geo-chart {
    .marker-cluster-small {
        background: radial-gradient(
            circle,
            var(--info) 10%,
            transparent 100%
        ) !important;
    }

    .marker-cluster-medium {
        background: radial-gradient(
            circle,
            var(--info) 50%,
            transparent 100%
        ) !important;
    }

    .marker-cluster-large {
        background: radial-gradient(
            circle,
            var(--info) 90%,
            transparent 100%
        ) !important;
    }

    .marker-cluster-small div,
    .marker-cluster-medium div,
    .marker-cluster-large div {
        background-color: var(--info) !important;
    }
    .marker-cluster span { font-weight: 700; color: var(--white); }

    .leaflet-container {
        z-index: 0;
        background-color: var(--white);
        border-radius: var(--radius-md);
    }
    .leaflet-control-attribution { display: none; }
}
