/* Energy Sankey - Core Styles */

/* Typography - Scoped to evs-sankey wrapper */
.evs-sankey text,
.evs-sankey tspan {
    /*font-family: Fieldwork, Futura, sans-serif;*/
    font-size: 16px;
}

/* Flow Styles */
.evs-flow {
    fill: none;
    stroke-opacity: 0.8;
}

.evs-flow:hover {
    stroke-opacity: 0.9;
}

.evs-flow.evs-heat {
    stroke: #98002e;
}

.evs-flow.evs-elec, .evs-flow.evs-waste.evs-heat {
    stroke: #e49942;
}

.evs-flow.evs-waste {
    stroke: #e49942;
    opacity: 0.4 !important;
}

.evs-flow.evs-solar {
    stroke: #fed530;
}

.evs-flow.evs-nuclear {
    stroke: #ca0813;
}

.evs-flow.evs-hydro {
    stroke: #0b24fb;
}

.evs-flow.evs-wind {
    stroke: #901d8f;
}

.evs-flow.evs-geo {
    stroke: #905a1c;
}

.evs-flow.evs-gas {
    stroke: #4cabf2;
}

.evs-flow.evs-coal {
    stroke: #000000;
}

.evs-flow.evs-bio {
    stroke: #46be48;
}

.evs-flow.evs-petro {
    stroke: #095f0b;
}

/* Box Styles */
.evs-box.evs-sector {
    fill: #cccccc;
}

.evs-box.evs-solar {
    fill: #fed530;
}

.evs-box.evs-nuclear {
    fill: #ca0813;
}

.evs-box.evs-hydro {
    fill: #0b24fb;
}

.evs-box.evs-wind {
    fill: #901d8f;
}

.evs-box.evs-geo {
    fill: #905a1c;
}

.evs-box.evs-gas {
    fill: #4cabf2;
}

.evs-box.evs-coal {
    fill: #000000;
}

.evs-box.evs-bio {
    fill: #46be48;
}

.evs-box.evs-petro {
    fill: #095f0b;
}

/* Other Elements */
.evs-maxline {
    stroke: #cccccc;
    stroke-width: 1px;
}

.evs-bkgd {
    fill: #000000;
}

/* Title Container - Responsive Header Layout */
.evs-title-container {
    /*border-top: 2px solid #000000;*/
    /*border-bottom: 1px solid #000000;*/
    position: relative;
    min-height: 58px;
    padding: 8px 16px;
    /*background: white;*/
}

.evs-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 20px;
    flex-wrap: nowrap;
}

/* Logo Section */
.evs-header-logo {
    flex: 0 0 auto;
    min-width: 60px;
}

.evs-header-logo img {
    max-height: 45px;
    height: auto;
    display: block;
}

/* Main Title Section - Contains title and energy usage */
.evs-header-main {
    flex: 1;
    text-align: center;
    min-width: 160px;
    position: relative;
}

.evs-header-title-section {
    position: relative;
    min-height: 45px;
}

.evs-main-title {
    /*font-family: Fieldwork, Futura, sans-serif;*/
    font-size: 1em;
    font-weight: normal;
    color: black;
    margin: 0;
    line-height: 1.2;
    margin-bottom: 2px;
}

.evs-energy-usage-overlay {
    position: absolute;
    top: 22px;
    left: 0;
    width: 100%;
    height: 25px;
    pointer-events: none;
}

/* Year Section - Separate section for year display */
.evs-header-year {
    flex: 1;
    min-width: 80px;
    height: 45px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.evs-year-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Info Section */
.evs-header-info {
    flex: 1.9;
    min-width: 160px;
    text-align: left;
}

.evs-subtitle {
    /*font-family: Fieldwork-HumThin, Futura, sans-serif;*/
    font-size: 1em;
    color: #000000;
    font-weight: bolder;
    line-height: 1.2;
    margin-bottom: 2px;
}

.evs-attribution {
    /*font-family: Fieldwork-HumThin, Futura, sans-serif;*/
    font-size: 1em;
    color: #000000;
    font-weight: normal;
    line-height: 1.2;
}

/* Affiliation Section */
.evs-header-affiliation {
    flex: 1.7;
    text-align: center;
    min-width: 140px;
}

.evs-affiliation-text {
    /*font-family: Fieldwork-HumThin, Futura, sans-serif;*/
    font-size: 1em;
    color: #000000;
    font-weight: normal;
    line-height: 1.2;
}

/* SVG Overlay Styles */
.evs-energy-svg-overlay,
.evs-year-svg-overlay {
    z-index: 10;
}

.evs-energy-svg-overlay text,
.evs-year-svg-overlay text {
    /*font-family: Fieldwork, Futura, sans-serif;*/
    fill: black;
}

/* Legacy SVG styles for compatibility */
.evs-title-container svg {
    font-size: 15px;
}

.evs-title-container .evs-title {
    font-size: 1em;
    fill: black;
}

.evs-title-container .evs-title .evs-unit {
    font-size: .9em;
    font-weight: bold;
}

.evs-title-container .evs-title .evs-year {
    font-size: 3.1em;
    font-weight: bold;
    clear: left;
    letter-spacing: .05em;
    font-variant-numeric: tabular-nums;
}

/* Mobile Responsive Design */
@media (max-width: 1024px) {
    .evs-header-content {
        gap: 15px;
    }

    .evs-main-title {
        font-size: 0.9em;
    }

    .evs-header-logo {
        min-width: 50px;
    }

    .evs-header-main,
    .evs-header-year,
    .evs-header-info,
    .evs-header-affiliation {
        flex: 1;
        min-width: 120px;
    }

    .evs-year-svg-overlay text {
        font-size: 2.8em !important;
    }

    .evs-subtitle, .evs-attribution, .evs-affiliation-text {
        font-size: 0.9em;
    }
}

@media (max-width: 768px) {
    .evs-title-container {
        padding: 6px 12px;
    }

    .evs-header-content {
        gap: 10px;
    }

    .evs-header-logo {
        min-width: 40px;
    }

    .evs-header-logo img {
        max-height: 35px;
    }

    .evs-main-title {
        font-size: 0.8em;
    }

    .evs-header-main,
    .evs-header-year,
    .evs-header-info,
    .evs-header-affiliation {
        flex: 1;
        min-width: 100px;
    }

    .evs-header-year {
        height: 40px;
    }

    .evs-year-svg-overlay text {
        font-size: 2.5em !important;
    }

    .evs-energy-svg-overlay text {
        font-size: 0.8em !important;
    }

    .evs-subtitle, .evs-attribution, .evs-affiliation-text {
        font-size: 0.8em;
    }
}

@media (max-width: 600px) {
    .evs-header-content {
        flex-wrap: wrap;
        gap: 8px;
    }

    .evs-header-main {
        order: 1;
        flex: 1 1 100%;
        margin-bottom: 8px;
    }

    .evs-header-year {
        order: 2;
        flex: 1 1 100%;
        margin-bottom: 8px;
        justify-content: center;
        height: 50px;
    }

    .evs-header-logo {
        order: 3;
        flex: 1 1 50%;
    }

    .evs-header-info {
        order: 4;
        flex: 1 1 100%;
        margin-bottom: 8px;
    }

    .evs-header-affiliation {
        order: 5;
        flex: 1 1 50%;
        text-align: left;
    }

    .evs-main-title {
        text-align: center;
        margin-bottom: 5px;
    }

    .evs-energy-usage-overlay {
        position: relative;
        top: 0;
        text-align: center;
        margin-top: 5px;
    }
}

/* Totals */
.evs-total.evs-sector {
    font-size: 0.7em;
    font-weight: bold;
}

.evs-total.evs-waste-level {
    fill: #e49942;
    opacity: 0.4;
}

/* Visibility */
.evs-hidden {
    visibility: hidden;
}

/* Tooltip */
.evs-tooltip {
    color: #000000;
    position: absolute;
    text-align: justify;
    width: auto;
    padding: 5px;
    background: #efefef;
    border: 1px solid black;
    pointer-events: none;
    z-index: 3;
}

.evs-fuel-value {
    text-align: center;
    vertical-align: middle;
}

/* Waste Heat Visibility Control */
.evs-waste-heat-hidden .evs-flow.evs-waste {
    display: none !important;
}

.evs-waste-heat-hidden .evs-total.evs-waste-level {
    display: none !important;
}

/* Smooth transition for waste heat toggle (optional) */
.evs-flow.evs-waste,
.evs-total.evs-waste-level {
    transition: opacity 0.3s ease;
}
