﻿:root {
    --field-accent: var(--theme-accent, #e96b74);
}

.scorecard-section-title {
    font-size: 30px;
    color: #3d4449;
    font-family: "Roboto Slab", serif;
    font-weight: 700;
    line-height: 1.5;
    margin: 0 0 1em 0;
}

.scorecard-checkbox .form-check-label {
    position: relative;
    padding-left: 36px; /* reserve space for the custom box */
    cursor: pointer;
}

.scorecard-likert-scale .btn-check + .btn {
    border-color: rgba(0,0,0,0.08);
}

/* base box */
.scorecard-checkbox .form-check-label::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 6px;
    box-sizing: border-box;
    border: 2px solid rgba(0,0,0,0.12);
    background: transparent;
}

/* check (hidden by default) centered in the box */
.scorecard-checkbox .form-check-label::after {
    content: "\2713";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 800; /* bold check */
    line-height: 1;
    color: transparent;
    pointer-events: none;
    transition: color .08s linear, transform .08s linear;
}

/* when the input is checked, color the box and reveal the centered bold check */
.scorecard-checkbox .form-check-input:checked + .form-check-label::before {
    background-color: var(--field-accent);
    border-color: var(--field-accent);
}

.scorecard-checkbox .form-check-input:checked + .form-check-label::after {
    color: #ffffff; /* white check on accent */
    transform: translate(-50%, -50%) scale(1);
}

/* keep the native input accessible (don't hide) but ensure visual alignment */
.scorecard-checkbox .form-check-input {
    margin-left: 0; /* keep flow; visual provided by label pseudo elements above */
    position: relative;
    z-index: 2;
    width: 22px;
    height: 22px;
    opacity: 0; /* visually hide native glyph so label::before/after are visible */
}

/* Buttons for likert choices */
.scorecard-likert-scale .btn-check + .btn {
    position: relative;
    display: flex;
    align-items: center;
    padding-left: 36px; /* allow space for custom circle/check */
    padding-right: 8px;
    gap: .35rem;
    color: #333;
    background-color: transparent;
    width: 100%; /* ensure each button fills the container horizontally */
}

.scorecard-likert-scale .btn-check:checked + .btn,
.scorecard-likert-scale .btn-check:checked + .btn:hover,
.scorecard-likert-scale .btn-check:checked + .btn:focus {
    background-color: var(--field-accent) !important;
    border-color: var(--field-accent) !important;
    color: #fff !important;
    box-shadow: none !important;
}

.scorecard-likert-scale .btn-check + .btn:hover {
    border-color: rgba(0,0,0,0.08);
}

/* circular pseudo before element for each button */
.scorecard-likert-scale .btn-check + .btn::before {
    content: "" !important; /* keep pseudo-element */
    position: absolute;
    left: 10px; /* tuned for vertical, inside left padding */
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: transparent;
    border: 2px solid rgba(0,0,0,0.12);
    box-sizing: border-box;
}

.scorecard-likert-scale .btn-check:checked + .btn::before {
    background-color: #fff;
    border-color: rgba(0,0,0,0.12);
}

.scorecard-likert-scale .btn-check:checked + .btn::after {
    content: "\2713";
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    color: var(--field-accent);
    pointer-events: none;
}

/* Make btn-group behave vertically and look neat when we want stacked options */
.scorecard-likert-scale .btn-group.d-flex.flex-column {
    flex-direction: column;
    gap: .5rem; /* space between stacked buttons */
    align-items: stretch; /* ensure children fill width */
}

.scorecard-likert-scale .btn-group {
    /* fallback or other groups: keep center alignment for non-vertical flows */
    align-items: center;
}

/* Global resets for charts responsiveness */
.radar-chart,
.bar-chart {
    /*width: 100%;
    max-width: 840px;*/ /* default desktop width */
    box-sizing: border-box;
    margin: 0 auto;
    display: block;
}

.gauges {
    /*width: 100%;
    max-width: 840px;*/
    box-sizing: border-box;
    margin: 0 auto 20px auto;
    display: block;
    /*aspect-ratio: 21 / 7;*/
    /*height: 320px;*/ /* fallback for older browsers */
}

.gauge-arc {
    opacity: 1.0;
}

.gauge-arc-shaded {
    opacity: 0.2;
}

.gauge-needle {
    stroke: #3d4449;
    stroke-width: 3px;
    fill: #3d4449;
}

.gauge-needle-cap {
    stroke: #666;
    fill: #3d4449;
}

.gauge-score {
    font-size: 36px;
    font-weight: 900;
}

.gauge-title {
    font-family: "Roboto Slab", serif;
    font-size: 24px;
    font-weight: 600;
    fill: #3d4449;
}

/* Prefer aspect-ratio for modern browsers, with height:auto fallback */
.radar-chart {
    /* 840 / 640 ≈ 21 / 16 */
    /*aspect-ratio: 21 / 16;*/
    /*height: auto;*/ /* fallback for browsers that support aspect-ratio */
    /*max-height: 900px;*/ /* prevents excessive growth on very large screens */
}

.bar-chart {
    /* 840 / 400 = 21 / 10 */
    /*aspect-ratio: 21 / 10;
    height: auto;
    max-height: 600px;*/
}

/* Default explicit heights as fallback for older browsers */
.radar-chart {
    /*height: 640px;*/
}

.bar-chart {
    /*height: 400px;*/
}

/* Container sizing */
.scorecard-container {
    /*margin: 20px auto;
    width: 840px;
    max-width: 840px;*/
}

/* Large screens */
@media (min-width: 1200px) {
    .scorecard-container {
        /*width: 1100px;
        max-width: 1100px;*/
    }

    .radar-chart {
        /*max-width: 1100px;*/
        /* prefer aspect-ratio but provide explicit fallback */
        /*aspect-ratio: 1100 / 800;
        height: 800px;*/
    }

    .bar-chart {
        /*max-width: 1100px;
        aspect-ratio: 1100 / 520;
        height: 520px;*/
    }

    .gauges {
        /*max-width: 1100px;
        aspect-ratio: 1100 / 400;
        height: 400px;*/
    }
}

/* Desktop / small-laptop */
@media (min-width: 992px) and (max-width: 1199px) {
    .scorecard-container {
        /*width: 940px;
        max-width: 940px;*/
    }

    .radar-chart {
        /*max-width: 940px;
        aspect-ratio: 940 / 720;
        height: 720px;*/
    }

    .bar-chart {
        /*max-width: 940px;
        aspect-ratio: 940 / 480;
        height: 480px;*/
    }

    .gauges {
        /*max-width: 940px;
        aspect-ratio: 940 / 360;
        height: 360px;*/
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 991px) {
    .scorecard-container {
        /*width: 720px;
        max-width: 720px;*/
    }

    .radar-chart {
        /*max-width: 720px;
        aspect-ratio: 720 / 580;
        height: 580px;*/
    }

    .bar-chart {
        /*max-width: 720px;
        aspect-ratio: 720 / 420;
        height: 420px;*/
    }

    .gauges {
        /*max-width: 720px;
        aspect-ratio: 720 / 320;
        height: 320px;*/
    }
}

/* Small tablet / large phone */
@media (min-width: 576px) and (max-width: 767px) {
    .scorecard-container {
        /*width: 540px;
        max-width: 540px;*/
    }

    .radar-chart {
        /*max-width: 540px;
        aspect-ratio: 540 / 480;
        height: 480px;*/
    }

    .bar-chart {
        /*max-width: 540px;
        aspect-ratio: 540 / 360;
        height: 360px;*/
    }

    .gauges {
        /*max-width: 540px;
        aspect-ratio: 540 / 280;
        height: 280px;*/
    }
}

/* Mobile */
@media (max-width: 575px) {
    .scorecard-container {
        /*width: 360px;
        max-width: 100%;
        padding: 0 12px;*/
    }

    .radar-chart {
        /*max-width: 360px;
        aspect-ratio: 1 / 1;
        height: 360px;*/
    }

    .bar-chart {
        /*max-width: 360px;
        aspect-ratio: 1 / 1;
        height: 360px;*/
    }

    .gauges {
        /*max-width: 360px;
        aspect-ratio: 1 / 0.8;
        height: 240px;*/
    }
}

/* Very small phones (legacy rule kept and aligned with mobile) */
@media screen and (max-width: 360px) {
    .radar-chart {
        /*width: 100%;
        max-width: 360px;
        height: 360px;*/
        margin: 0 auto;
    }

    .bar-chart {
        /*width: 100%;
        max-width: 360px;
        height: 360px;*/
        margin: 0 auto;
    }
}

canvas {
    display: block;
    margin: 0.1em auto;
    border: 1px solid #ccc;
}

.scorecard-title {
    text-align: center;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 4em;
    margin-bottom: 0.1em;
}

.card {
    margin-bottom: 1rem;
}

.indicator-header-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .indicator-header-text.header-red {
        color: rgba(156, 0, 0, 1.0);
    }

    .indicator-header-text.header-yellow {
        color: rgba(156, 87, 0, 1.0);
    }

    .indicator-header-text.header-green {
        color: rgba(0, 97, 0, 1.0);
    }

.badge-red {
    background-color: rgba(156, 0, 0, 1.0);
    color: rgba(255, 199, 206, 1.0);
    font-size: 1.5em;
}

.badge-yellow {
    background-color: rgba(156, 87, 0, 1.0);
    color: rgba(255, 235, 156, 1.0);
    font-size: 1.5em;
}

.badge-green {
    background-color: rgba(0, 97, 0, 1.0);
    color: rgba(198, 239, 206, 1.0);
    font-size: 1.5em;
}

.rotate-icon {
    transition: transform 0.3s ease-in-out;
}

[aria-expanded="true"] .rotate-icon {
    transform: rotate(180deg);
}

.metric-header-red {
    color: rgba(156, 0, 0, 1.0);
    font-weight: bold;
}

.metric-header-yellow {
    color: rgba(156, 87, 0, 1.0);
    font-weight: bold;
}

.metric-header-green {
    color: rgba(0, 97, 0, 1.0);
    font-weight: bold;
}

.metric-badge-red {
    background-color: rgba(156, 0, 0, 1.0);
    color: rgba(255, 199, 206, 1.0);
    font-size: 1.5em;
}

.metric-badge-yellow {
    background-color: rgba(156, 87, 0, 1.0);
    color: rgba(255, 235, 156, 1.0);
    font-size: 1.5em;
}

.metric-badge-green {
    background-color: rgba(0, 97, 0, 1.0);
    color: rgba(198, 239, 206, 1.0);
    font-size: 1.5em;
}

.web-axis-line {
    stroke: #aaa;
    stroke-width: 1px;
}

.web-grid-line {
    stroke: #ddd;
    stroke-width: 1px;
}

.web-grid-area {
}

    .web-grid-area.red {
        fill: rgba(255, 199, 206, 0.2);
    }

    .web-grid-area.yellow {
        fill: rgba(255, 235, 156, 0.2);
    }

    .web-grid-area.green {
        fill: rgba(198, 239, 206, 0.2);
    }

.web-data-polygon {
    stroke-width: 4px;
}

    .web-data-polygon.red {
        fill: rgba(255, 199, 206, 0.6);
        stroke: rgba(255, 199, 206, 0.8);
    }

    .web-data-polygon.yellow {
        fill: rgba(255, 235, 156, 0.6);
        stroke: rgba(255, 235, 156, 0.8);
    }

    .web-data-polygon.green {
        fill: rgba(198, 239, 206, 0.6);
        stroke: rgba(198, 239, 206, 0.8);
    }

.web-data-point {
    cursor: pointer;
}

.web-label {
    font-size: 18px;
    cursor: pointer;
}

.web-data-label {
    font-size: 16px;
    text-anchor: middle;
    cursor: pointer;
}

.raisef-score {
    /*font-size: 288px;*/
    text-anchor: middle;
}

.red {
    fill: rgba(156, 0, 0, 0.8);
}

.yellow {
    fill: rgba(156, 87, 0, 0.8);
}

.green {
    fill: rgba(0, 97, 0, 0.8);
}

.bar {
}

    .bar:hover {
        fill: orange;
        box-shadow: 0 0 50px 15px #48abe0;
        stroke-width: 3px;
    }

.bar-x-axis-label {
    font-size: 16px;
    text-anchor: middle;
}

.bar-data-label {
    font-size: 14px;
    text-anchor: middle;
}

.bar-y-axis-label {
    font-size: 18px;
}

.bar-axis-line {
    stroke: #aaa;
}

.bar-grid {
}

.bar-grid-line {
    stroke: #ddd;
}

.bar-back-panel {
}

    .bar-back-panel.red {
        fill: rgba(255, 199, 206, 0.2);
    }

    .bar-back-panel.yellow {
        fill: rgba(255, 235, 156, 0.2);
    }

    .bar-back-panel.green {
        fill: rgba(198, 239, 206, 0.2);
    }

.details-toggle::after {
    content: "▾";
    display: inline-block;
    margin-left: .35rem;
    transition: transform 150ms ease;
}

.details-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}
