/* Cost Map frontend styles. Scoped under .cmap so it is safe on any page. */

.cmap { position: relative; }

/* ---------------- selector row ---------------- */

.cmap-selector {
    display: flex;
    padding: 10px;
    text-align: center;
    position: relative;
    align-items: center;
}

.cmap-role,
.cmap-role-label {
    letter-spacing: 0.2px;
    margin-right: 10px;
    border: 1px solid #0089ff;
    padding: 11px 25px;
    font-size: 13px;
    border-radius: 500px;
    font-weight: 600;
    background: #e7f3fe;
    color: #0089ff;
    width: 60%;
    display: inline-block;
    text-align: center;
    box-sizing: border-box;
}

select.cmap-role {
    border: 1px solid #0089ff;
    background: #e7f3fe;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    text-align: center;
    text-align-last: center;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%230089ff' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
}

.cmap-area-wrap {
    position: relative;
    flex: 1;
    display: inline-block;
}

.cmap-area {
    -webkit-appearance: none;
    appearance: none;
    background: none;
    color: inherit;
    font-weight: 600;
    padding: 10px 40px 10px 20px;
    font-size: 13px;
    border-radius: 100px;
    border: 1px solid #00294f !important;
    max-width: 100%;
    width: 100%;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='currentColor' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
}

/* ---------------- map ---------------- */

.cmap-map {
    position: relative;
}

.cmap-svg {
    display: block;
    width: 90%;
    margin: auto;
    height: auto;
    -webkit-user-select: none;
    user-select: none;
}

.cmap-state,
.cmap-pill {
    cursor: pointer;
    outline: none;
    transition: fill 0.15s ease-in-out;
}

.cmap-pill rect {
    transition: fill 0.15s ease-in-out;
}

/* ---------------- tooltip ---------------- */

.cmap-tooltip {
    position: absolute;
    z-index: 3;
    min-width: 200px;
    pointer-events: none;
}

.cmap-tooltip-name {
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    text-align: center;
    border-radius: 100px;
    padding: 10px;
    background: #ffffffcc;
    font-weight: bold;
    line-height: 1;
}

.cmap-tooltip-comment {
    background: #ffffffcc;
    border-radius: 16px;
    margin-top: 4px;
    padding: 8px 12px;
    font-size: 11px;
    color: #000;
}

/* ---------------- info area / cards ---------------- */

.cmap-info {
    position: relative;
}

/* the live page inherits these resets from the theme; bundle them so the
   widget renders the same on any page */
.cmap-info h3,
.cmap-info p {
    margin: 0;
}

.cmap-info .card,
.cmap-info .card * {
    box-sizing: border-box;
}

.cmap-info .cmap-nodata {
    padding: 20px;
    color: #5e6e82;
}

.cmap-info .card {
    width: 48%;
    float: right;
    background: #fff;
    border-radius: 35px;
    padding: 40px;
    margin: 1%;
    box-sizing: border-box;
}

.cmap-info .card h3 {
    font-size: 22px;
    padding-bottom: 5%;
}

.cmap-info .card-va {
    clear: both;
}

.cmap-info .card-container {
    display: flex;
}

.cmap-info .saving-info {
    width: 80%;
}

.cmap-info .saving-box2 {
    padding-right: 20px;
    padding-top: 10%;
    float: left;
}

.cmap-info .saving-box {
    padding-top: 10%;
    float: left;
}

.cmap-info .subtext {
    color: #5e6e82;
    font-size: 14px;
    padding-bottom: 0.5em;
}

.cmap-info .subtext2 {
    color: #5e6e82;
    font-size: 14px;
    padding-bottom: 0.2em;
}

.cmap-info .highlight1 {
    line-height: 1;
    font-size: 55px;
    font-weight: bold;
}

.cmap-info .highlight {
    line-height: 1;
    font-size: 40px;
    font-weight: bold;
}

.cmap-info .chart-container3 {
    width: 20%;
    display: flex;
    flex-direction: column;
}

.cmap-info .chart-container2 {
    height: 100%;
}

.cmap-info .chart-container1 {
    display: flex;
    height: 100%;
}

.cmap-info .chart-container {
    width: 100%;
    display: flex;
    align-items: flex-end;
}

.cmap-info .y-axis-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 8px;
    color: #5e6e82;
}

.cmap-info .bar {
    height: 100%;
    width: 15%;
    margin: 0 15%;
    background-color: #edf3f7;
    border-radius: 30px;
    position: relative;
    overflow: hidden;
}

.cmap-info .bar-fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    border-radius: 30px 30px 0 0;
}

.cmap-info .green-fill { background-color: #0EB12D; }
.cmap-info .red-fill { background-color: #CF3636; }
.cmap-info .legend-color.green { background-color: #0EB12D; }
.cmap-info .legend-color.red { background-color: #CF3636; }

.cmap-info .legend {
    display: flex;
    flex-direction: column;
    padding-top: 20px;
}

.cmap-info .legend-item {
    padding-top: 10px;
    display: flex;
    align-items: center;
    font-size: 10px;
    line-height: 1.2;
    color: #5e6e82;
}

.cmap-info .legend-color {
    width: 10%;
    min-width: 10px;
    height: 10px;
    border-radius: 5px;
}

.cmap-info .legend-text {
    width: 90%;
    padding-left: 10px;
}

.cmap-info .card-table {
    border: none;
    margin: 0;
    border-collapse: collapse;
}

.cmap-info .card-table tr,
.cmap-info .card-table td {
    border: none !important;
    background: none !important;
    padding: 3px;
    line-height: 1.2;
}

.cmap-info .card-table th {
    border-left: 0 !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    padding: 6px 0 0 3px !important;
    border-top: 1px solid #5e6e82 !important;
    text-align: left;
    background: none !important;
}

.cmap-info .card-table th.tdcolumn2,
.cmap-info .tdcolumn2 {
    padding-left: 15px !important;
    width: 140px;
}

.cmap-info .monthly-cost-container {
    text-align: center;
    display: flex;
    padding-left: 5%;
    flex-direction: column;
}

.cmap-info .red-tag {
    margin-top: 10px;
    font-weight: 600;
    font-size: 9px;
    line-height: 1.2;
    color: #cc3232;
    background: #fcd7d7;
    border-radius: 500px;
    padding: 10px 20px;
    text-align: center;
}

.cmap-info .green-tag {
    margin-top: 10px;
    font-weight: 600;
    font-size: 9px;
    line-height: 1.2;
    color: #0cb327;
    background: #d9fcd7;
    border-radius: 500px;
    padding: 10px 20px;
    text-align: center;
}

/* ---------------- layout breakpoints (mirror the live page) ------------ */

@media (min-width: 1000px) {
    .cmap-map {
        float: left;
        width: 50%;
        margin-bottom: -60px;
    }
    /* role selector matches the map column, area selector matches the cards */
    .cmap-selector {
        padding: 10px 0;
        justify-content: space-between;
    }
    select.cmap-role,
    .cmap-role-label {
        width: 50%;
        margin-right: 0;
        flex: 0 0 50%;
    }
    .cmap-area-wrap {
        flex: 0 0 48%;
        width: 48%;
        margin-left: auto;
        margin-right: 1%;
    }
}

@media (min-width: 1350px) {
    .cmap-info .card {
        padding: 60px;
    }
}

@media screen and (min-width: 700px) {
    .cmap-info .monthly-cost-container {
        width: 40%;
    }
    .cmap-info .table-container {
        display: flex;
    }
    .cmap-info .card-table {
        width: 60%;
    }
}

@media screen and (max-width: 699px) {
    .cmap-info .monthly-cost-container {
        padding: 0;
        margin-top: 30px;
    }
}

@media (max-width: 999px) {
    .cmap-map {
        padding: 20px 0 30px 0;
    }
    .cmap-selector {
        display: block;
        width: 100%;
        padding: 10px 0;
    }
    .cmap-role,
    .cmap-role-label {
        margin: auto;
        width: 100%;
        display: block;
        padding: 10px 0;
    }
    select.cmap-role {
        padding: 10px 0;
    }
    .cmap-area-wrap {
        display: block;
        width: 100%;
        flex: none;
    }
    .cmap-area {
        margin-top: 20px;
        width: 100%;
        max-width: 100%;
    }
    .cmap-info .chart-container3 {
        margin-right: -10px;
        width: 33%;
    }
    .cmap-info .highlight1 {
        font-size: 50px;
    }
    .cmap-info .card {
        width: 98%;
        margin-bottom: 20px;
    }
    .cmap-svg {
        width: 100%;
    }
}

@media only screen and (min-width: 1150px) {
    .cmap-info .highlight1 {
        font-size: 90px;
    }
    .cmap-info .highlight {
        font-size: 50px;
    }
}
