/*
System Name: Samford Valley Weather - Weather station system for South East Queensland, Australia
Component Name: SVW Interactive Graph CSS
Description: Native SVW Interactive Graph presentation styles.
Module Version: 1.2.0
Author: Steve Parry steve.z.parry@gmail.com
*/

/* +++ CHANGE LOG ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    VER  |   DATE    |   Description
----------|-----------|---------------------------------------------------------
    1.2.0  20260914    First public release. Previous development changelog history is retained in the relevant changelog file.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */

.svwInteractiveGraph {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    border-radius: 8px;
    color: #ffffff;
    min-width: 0;
    container-type: inline-size;
}

.svwInteractiveGraph * {
    box-sizing: border-box;
}

.svwInteractiveGraph__header {
    margin: 0 0 7px;
}

.svwInteractiveGraph__title {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.25;
    font-weight: 700;
    color: #ffffff;
}

.svwInteractiveGraph__subtitle {
    margin: 3px 0 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.86rem;
}

.svwInteractiveGraph__stage {
    position: relative;
    width: 100%;
    min-height: 300px;
    touch-action: pan-y;
}

.svwInteractiveGraph__svg {
    display: block;
    width: 100%;
    height: auto;
    min-height: 300px;
    overflow: visible;
}

.svwInteractiveGraph__plotBack {
    fill: transparent;
    stroke: rgba(255, 255, 255, 0.18);
}

.svwInteractiveGraph__dryStatePanel {
    fill: rgba(255, 255, 255, 0.055);
    stroke: rgba(255, 255, 255, 0.22);
    stroke-width: 1.2;
}

.svwInteractiveGraph__dryStateTitle {
    fill: #ffffff;
    font-size: 18px;
    font-weight: 700;
}

.svwInteractiveGraph__dryStateTotal {
    fill: #d8f5a2;
    font-size: 24px;
    font-weight: 800;
}

.svwInteractiveGraph__dryStateSubvalue {
    fill: rgba(255, 255, 255, 0.78);
    font-size: 13px;
}

.svwInteractiveGraph__axis {
    stroke: rgba(255, 255, 255, 0.72);
    stroke-width: 1.2;
}

.svwInteractiveGraph__grid {
    stroke: rgba(255, 255, 255, 0.18);
    stroke-width: 1;
}

.svwInteractiveGraph__line {
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.svwInteractiveGraph__line--dashed {
    stroke-dasharray: 8 6;
}

.svwInteractiveGraph__line--dotted {
    stroke-dasharray: 2 6;
}

.svwInteractiveGraph__tick,
.svwInteractiveGraph__axisLabel,
.svwInteractiveGraph__legendText,
.svwInteractiveGraph__emptyText {
    fill: #ffffff;
    font-size: 13px;
}

.svwInteractiveGraph__axisLabel {
    font-weight: 700;
}

.svwInteractiveGraph__legendLine {
    stroke-width: 3;
    stroke-linecap: round;
}

.svwInteractiveGraph__panelTitle {
    fill: #ffffff;
    font-size: 16px;
    font-weight: 700;
}

.svwInteractiveGraph--windDirection .svwInteractiveGraph__header {
    margin-bottom: 4px;
}

.svwInteractiveGraph--windDirection .svwInteractiveGraph__stage {
    min-height: 0;
}

.svwInteractiveGraph--windDirection .svwInteractiveGraph__svg {
    display: none;
}

.svwInteractiveGraph__windLayout {
    --svw-wind-dial-size: 300px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, var(--svw-wind-dial-size)));
    justify-content: center;
    align-items: start;
    gap: 8px 24px;
    margin: 2px auto 0;
}

.svwInteractiveGraph--windDirectionStacked .svwInteractiveGraph__windLayout {
    grid-template-columns: minmax(0, var(--svw-wind-dial-size));
    gap: 10px;
}

.svwInteractiveGraph__windLayout[hidden] {
    display: none;
}

.svwInteractiveGraph__windPanel {
    display: grid;
    justify-items: center;
    gap: 2px;
    min-width: 0;
}

.svwInteractiveGraph__windPanelTitle {
    margin: 0;
    color: #ffffff;
    font-size: clamp(0.9rem, 2.1cqi, 1.05rem);
    line-height: 1.15;
    font-weight: 700;
    text-align: center;
}

.svwInteractiveGraph__windDialSvg,
.svwInteractiveGraph__windDialCanvas {
    display: block;
    width: var(--svw-wind-dial-size);
    max-width: 100%;
    height: var(--svw-wind-dial-size);
    overflow: visible;
}

.svwInteractiveGraph__windDialCanvas {
    image-rendering: auto;
}

.svwInteractiveGraph__windSupport {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: clamp(0.74rem, 1.8cqi, 0.82rem);
    line-height: 1.2;
    text-align: center;
    white-space: pre-line;
}

.svwInteractiveGraph--windDirection .svwInteractiveGraph__selectors {
    margin-top: 12px;
}

.svwInteractiveGraph--windDirection .svwInteractiveGraph__status {
    margin-top: 2px;
}

.svwInteractiveGraph__compassBezel {
    stroke: #f8fafb;
    stroke-width: 1.4;
}

.svwInteractiveGraph__compassInnerShadow {
    stroke: rgba(11, 14, 18, 0.62);
    stroke-width: 3.2;
}

.svwInteractiveGraph__compassFace {
    stroke: rgba(255, 255, 255, 0.92);
    stroke-width: 2;
}

.svwInteractiveGraph__compassRing {
    fill: none;
    stroke: rgba(40, 44, 48, 0.16);
    stroke-width: 1.1;
}

.svwInteractiveGraph__compassRange {
    fill: #1a8b87;
    stroke: #1a8b87;
    stroke-width: 0.8;
    opacity: 0.28;
}

.svwInteractiveGraph__compassNeedle {
    fill: #d7493a;
    stroke: #791d18;
    stroke-width: 1.2;
}

.svwInteractiveGraph__compassNeedleTail {
    fill: none;
    stroke: rgba(86, 32, 27, 0.66);
    stroke-linecap: round;
    stroke-width: 4;
}

.svwInteractiveGraph__compassHub {
    fill: #202529;
    stroke: #f6f4ed;
    stroke-width: 1.8;
}

.svwInteractiveGraph__instrumentDropShadow {
    pointer-events: none;
}

.svwInteractiveGraph__compassTrim,
.svwInteractiveGraph__compassFaceShadow,
.svwInteractiveGraph__instrumentForeground,
.svwInteractiveGraph__gaugeLcdBevel,
.svwInteractiveGraph__compassHubMetal,
.svwInteractiveGraph__compassHubGlint {
    pointer-events: none;
}

.svwInteractiveGraph__gaugeLcd {
    shape-rendering: geometricPrecision;
}

.svwInteractiveGraph__gaugeLcdLabel,
.svwInteractiveGraph__gaugeLcdValue,
.svwInteractiveGraph__windSpeedText {
    font-family: "Courier New", monospace;
}

.svwInteractiveGraph__compassCardinal,
.svwInteractiveGraph__compassValue,
.svwInteractiveGraph__compassSubvalue {
    fill: #ffffff;
}

.svwInteractiveGraph__compassCardinal {
    font-size: 18px;
    font-weight: 700;
}

.svwInteractiveGraph__compassCardinal--primary {
    fill: #202529;
    font-weight: 800;
}

.svwInteractiveGraph__compassCardinal--secondary {
    fill: rgba(32, 37, 41, 0.72);
    font-weight: 700;
}

.svwInteractiveGraph__compassValue {
    font-size: 20px;
    font-weight: 700;
}

.svwInteractiveGraph__compassSubvalue {
    font-size: 13px;
}

.svwInteractiveGraph__windRoseSector {
    opacity: 0.98;
}

.svwInteractiveGraph__windRoseSector:hover,
.svwInteractiveGraph__windRoseSector:focus {
    opacity: 1;
}

.svwInteractiveGraph__roseGrid,
.svwInteractiveGraph__roseSpoke,
.svwInteractiveGraph__compassTick {
    pointer-events: none;
}

.svwInteractiveGraph__degreeLabel {
    fill: rgba(25, 28, 31, 0.74);
    font-size: 9px;
}

.svwInteractiveGraph__windRoseCentre,
.svwInteractiveGraph__compassReadingBack {
    fill: rgba(246, 244, 237, 0.94);
    stroke: rgba(25, 28, 31, 0.2);
    stroke-width: 1;
}

.svwInteractiveGraph__windRoseDominant,
.svwInteractiveGraph__compassCentreBearing {
    fill: #202529;
    font-weight: 800;
}

.svwInteractiveGraph__windRoseDominantPercent,
.svwInteractiveGraph__compassCentreDirection {
    fill: rgba(32, 37, 41, 0.72);
    font-weight: 800;
}

.svwInteractiveGraph__selectors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
    gap: 8px;
    margin-top: 5px;
}

.svwInteractiveGraph__selectLabel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    font-weight: 700;
    font-size: 0.92rem;
    color: #ffffff;
}

.svwInteractiveGraph__selectLabel select {
    width: 100%;
    min-height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 8px;
    background: radial-gradient(circle at center, #168978 0%, #0d665d 60%, #084d46 100%);
    color: #ffffff;
    padding: 7px 9px;
    font: inherit;
}

.svwInteractiveGraph__selectLabel select option {
    color: #17202a;
}

.svwInteractiveGraph__selectLabel select:hover {
    border-color: #d8f5a2;
    background: radial-gradient(circle at center, #2fa88f 0%, #168978 58%, #0b5a52 100%);
}

.svwInteractiveGraph__selectLabel select:focus-visible {
    outline: 3px solid rgba(216, 245, 162, 0.4);
    border-color: #d8f5a2;
}

.svwInteractiveGraph__message {
    position: absolute;
    inset: auto 16px 16px;
    margin: 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    color: #17202a;
    text-align: center;
    font-weight: 700;
}

.svwInteractiveGraph__status {
    min-height: 0;
    margin: 4px 0 0;
    font-size: 0.9rem;
}

.svwInteractiveGraph__status:empty {
    display: none;
}

.svwInteractiveGraph__tooltip {
    position: absolute;
    z-index: 3;
    max-width: min(260px, calc(100% - 16px));
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 6px;
    background: rgba(8, 77, 70, 0.94);
    color: #ffffff;
    font-size: 0.82rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
    pointer-events: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.svwInteractiveGraph__help {
    margin-top: 5px;
    padding: 7px 9px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.18);
    color: #ffffff;
}

.svwInteractiveGraph__help[hidden] {
    display: none;
}

.svwInteractiveGraph__helpTitle,
.svwInteractiveGraph__helpText {
    margin: 0 0 3px;
    line-height: 1.28;
}

.svwInteractiveGraph__visuallyHidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.svwInteractiveGraph__fullscreenExit {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    display: none;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    height: 42px;
    min-height: 42px;
    max-height: 42px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 50%;
    background: rgba(8, 77, 70, 0.92);
    color: #ffffff;
    cursor: pointer;
    font: 700 26px/1 Arial, sans-serif;
}

.svwInteractiveGraph__fullscreenExit:hover,
.svwInteractiveGraph__fullscreenExit:focus-visible {
    border-color: #d8f5a2;
    outline: none;
}

.svwInteractiveGraph[aria-busy="true"] .svwInteractiveGraph__svg {
    opacity: 0.68;
}

.svwInteractiveGraph:fullscreen {
    width: 100vw;
    height: 100vh;
    overflow: auto;
    padding: 24px;
}

.svwInteractiveGraph:fullscreen .svwInteractiveGraph__stage {
    min-height: calc(100vh - 190px);
}

.svwInteractiveGraph:fullscreen .svwInteractiveGraph__svg {
    min-height: calc(100vh - 220px);
}

.svwInteractiveGraph:fullscreen .svwInteractiveGraph__selectors {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 220px));
    justify-content: center;
    max-width: 720px;
    margin-right: auto;
    margin-left: auto;
}

.svwInteractiveGraph--windDirection:fullscreen .svwInteractiveGraph__stage,
.svwInteractiveGraph--windDirection:fullscreen .svwInteractiveGraph__svg {
    min-height: 0;
}

.svwInteractiveGraph:fullscreen .svwInteractiveGraph__fullscreenExit:not([hidden]) {
    display: flex;
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    height: 42px;
    min-height: 42px;
    max-height: 42px;
}

.svwInteractiveGraph:-webkit-full-screen .svwInteractiveGraph__fullscreenExit:not([hidden]) {
    display: flex;
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    height: 42px;
    min-height: 42px;
    max-height: 42px;
}

@media (max-width: 760px) {
    .svwInteractiveGraph {
        padding: 12px;
    }

    .svwInteractiveGraph__header {
        align-items: flex-start;
    }

    .svwInteractiveGraph__title {
        font-size: 1rem;
    }

    .svwInteractiveGraph__selectors {
        grid-template-columns: 1fr;
    }

    .svwInteractiveGraph:fullscreen .svwInteractiveGraph__selectors {
        max-width: min(100%, 360px);
    }

    .svwInteractiveGraph:fullscreen .svwInteractiveGraph__fullscreenExit:not([hidden]),
    .svwInteractiveGraph:-webkit-full-screen .svwInteractiveGraph__fullscreenExit:not([hidden]) {
        top: 8px;
        right: 8px;
        flex-basis: 38px;
        width: 38px;
        min-width: 38px;
        max-width: 38px;
        height: 38px;
        min-height: 38px;
        max-height: 38px;
        font-size: 22px;
    }

    .svwInteractiveGraph__stage {
        min-height: 260px;
    }

    .svwInteractiveGraph__svg {
        min-height: 260px;
    }

    .svwInteractiveGraph__tooltip {
        max-width: min(220px, calc(100% - 16px));
        padding: 6px 8px;
        font-size: 0.74rem;
        line-height: 1.32;
    }

    .svwInteractiveGraph__tick,
    .svwInteractiveGraph__axisLabel,
    .svwInteractiveGraph__legendText {
        font-size: 12px;
    }
}
