/* Page specific styles */
.ev-simulator {
    max-width: 1920px;
    width: 100%;
    margin: 0 auto;
    padding: 50px;
    background-color: #000000;
    color: #FFFFFF;
    border-radius: 8px;
    overflow: hidden;
}

/* Main Container (2 column layout) */
.simulator-container {
    display: grid;
    grid-template-columns: 1fr;
}

@media screen and (min-width: 670px) {
    .simulator-container {
        grid-template-columns: minmax(0, 45%) 1fr;
    }
}

@media screen and (min-width: 1024px) {
    .simulator-container {
        grid-template-columns: minmax(0, 490px) 1fr;
    }
}

/* Coluna da esquerda (controlos) */
.simulator-controls {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

@media screen and (min-width: 670px) {
    .simulator-controls {
        padding: 32px;
    }
}

/* Coluna da direita (resultados) */
.simulator-results {
    padding: 16px;
    background-color: #1a1a1a;
}

@media screen and (min-width: 670px) {
    .simulator-results {
        padding: 32px;
    }
}

/* --- ESTILOS PARA SEPARADORES (TABS) (DARK MODE) --- */
.simulator-tabs {
    background-color: #000;
    border-bottom: 1px solid #333;
}

.tab-list {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 10px 16px 0 16px;
    overflow-x: auto;
}

.tab-button {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
    padding: 12px 20px;
    border: none;
    background: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.4);
    border-bottom: 3px solid transparent;
    transition: color 0.3s, border-color 0.3s;
    white-space: nowrap;
}

.tab-button:hover {
    color: #fff;
}

.tab-button.active {
    color: #fff;
    border-bottom-color: #89BABE;
}

.simulator-panels .tab-panel {
    display: none;
}

.simulator-panels .tab-panel.active {
    display: block;
}

/* --- ESTILOS PARA CONTROLOS (DARK MODE) --- */
.control-group {
    border: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.control-legend {
    width: 100%;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
    color: #fff;
}

@media screen and (min-width: 1024px) {
    .control-legend {
        font-size: 1.8rem;
    }
}

.climate-control,
.eco-control {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 1.4rem;
    line-height: 1;
}

.eco-control {
    margin-top: 16px;
}

.slider-label-container {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    width: 100%;
}

.slider-value-display {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 0.95;
}

.slider-unit {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    margin-left: 4px;
}

.slider-wrapper {
    width: 100%;
    margin-top: 10px;
}

/* --- RADIO BUTTONS (DARK MODE) --- */
.radio-group {
    display: grid;
    grid-gap: 8px;
    grid-template-columns: repeat(3, 1fr);
}

@media screen and (min-width: 1024px) {
    .radio-group.compact {
        grid-template-columns: repeat(auto-fit, minmax(0, max-content));
    }
}

.radio-box-input {
    display: none;
}

.radio-box-label {
    text-align: center;
    cursor: pointer;
    user-select: none;
    background-color: transparent;
    border: 1px solid #89BABE;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 10px 20px;
    min-height: 40px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1;
    color: #89BABE !important;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.radio-box-input:checked+label:before {
    background-color: transparent !important;
    border: none !important;
}

.radio-box-input+label:before {
    content: none !important;
}

.radio-box-input:checked+.radio-box-label {
    background-color: #89BABE;
    color: #ffffff !important;
    border-color: #89BABE;
}

.radio-label-icon {
    fill: currentColor;
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

/* --- SWITCH (Toggle) (DARK MODE) --- */
.toggle-switch {
    --toggle-bg-off: #333;
    --toggle-bg-on: #89BABE;
    --toggle-border-off: #888;
    --toggle-border-on: #89BABE;
    --toggle-circle-off: #fff;
    --toggle-circle-on: #000;
    --toggle-text-off: #fff;
    --toggle-text-on: #000;
    user-select: none;
    align-items: center;
    display: inline-flex;
    position: relative;
    cursor: pointer;
}

.toggle-switch.medium {
    width: 48px;
    height: 24px;
    --toggle-labels-size: 8px;
    --toggle-labels-padding: 6px;
}

.toggle-switch.medium .toggle-slider:before {
    width: 17px;
    left: 3px;
}

.toggle-switch.medium.checked .toggle-slider:before {
    transform: translate(22px, -50%);
}

.toggle-slider {
    border: 1px solid var(--toggle-border-off);
    background-color: var(--toggle-bg-off);
    color: var(--toggle-text-off);
    border-radius: 32px;
    transition: all .4s;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
}

.toggle-slider:before {
    content: "";
    background-color: var(--toggle-circle-off);
    aspect-ratio: 1;
    border-radius: 50%;
    transition: all .4s;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.toggle-input {
    display: none;
}

.toggle-input:checked+.toggle-slider {
    border-color: var(--toggle-border-on);
    background-color: var(--toggle-bg-on);
    color: var(--toggle-text-on);
}

.toggle-input:checked+.toggle-slider:before {
    background-color: var(--toggle-circle-on);
}

.toggle-switch.labeled .toggle-slider {
    align-items: center;
    height: auto;
    display: flex;
}

.toggle-switch.labeled .toggle-slider:after {
    content: "off";
    right: var(--toggle-labels-padding);
    font-size: var(--toggle-labels-size);
    text-transform: uppercase;
    font-weight: 400;
    line-height: 1;
    position: absolute;
}

.toggle-input:checked+.toggle-slider:after {
    content: "on";
    left: var(--toggle-labels-padding);
    right: auto;
}

.toggle-label-switch {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    cursor: pointer;
}

/* --- SLIDERS MODERNOS (input[type="range"]) (DARK MODE) --- */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: #333;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: #fff;
    border: 1px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -10px;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s, box-shadow 0.2s;
}

input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: #fff;
    border: 1px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}

input[type="range"]:active::-webkit-slider-thumb,
input[type="range"]:focus::-webkit-slider-thumb {
    background-color: #f0f0f0;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

input[type="range"]:active::-moz-range-thumb,
input[type="range"]:focus::-moz-range-thumb {
    background-color: #f0f0f0;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

.slider-wrapper.dark-mode input[type="range"] {
    background: rgba(255, 255, 255, 0.3);
}

.slider-wrapper.dark-mode input[type="range"]::-webkit-slider-thumb {
    background: #fff;
    border-color: #fff;
}

.slider-wrapper.dark-mode input[type="range"]::-moz-range-thumb {
    background: #fff;
    border-color: #fff;
}


/* --- RESULTADOS AUTONOMIA (DARK MODE com Efeito Original) --- */
.autonomy-results .info-text {
    font-size: 1.2rem;
    line-height: 1.4;
    margin-bottom: 16px;
    color: #ccc;
}

.result-heading {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 8px 0;
}

.progress-display {
    background-color: #fff;
    margin-top: 16px;
    padding: 32px 16px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.progress-bar-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    z-index: 1;
}

.progress-bar-inner {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    /* CORREÇÃO: Gradiente de cinza para preto */
    background: linear-gradient(to right, #484848, #000000);
    transition: width 0.3s ease-out;
    z-index: 2;
    width: var(--progress-value, 0%);
}

.progress-bar-overlay {
    position: relative;
    z-index: 3;
    mix-blend-mode: difference;
    color: #fff;
}

.progress-gradient-overlay {
    content: "";
    z-index: 4;
    pointer-events: none;
    opacity: .3;
    background: linear-gradient(90deg, #000 0%, transparent 100%);
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.distance-value {
    font-variant-numeric: tabular-nums;
    font-size: 5.6rem;
    font-weight: 700;
    line-height: 0.8;
}

.distance-unit {
    font-size: 2rem;
    font-weight: 700;
    line-height: 0.95;
    margin-left: 5px;
}

/* --- DETALHES COLAPSÁVEIS (DARK MODE) --- */
.collapsible-section {
    margin-top: 32px;
}

.collapsible-summary {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
}

.collapsible-summary::-webkit-details-marker {
    display: none;
}

.toggle-arrow {
    fill: currentColor;
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease-out;
}

.collapsible-section[open] .toggle-arrow {
    transform: rotate(180deg);
}

.charge-level-display {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    width: 100%;
    font-size: 1.6rem;
    font-weight: 400;
    line-height: 1;
    margin: 8px 0 -12px;
}

/* --- RESULTADOS CARREGAMENTO (DARK MODE) --- */
.charge-results .result-heading {
    margin-bottom: 8px;
}

.charge-heading {
    text-align: center;
    display: grid;
    gap: 24px;
}

@media screen and (min-width: 670px) {
    .charge-heading {
        text-align: left;
        grid-template-rows: auto auto;
        grid-template-columns: 1fr auto;
        gap: 0 16px;
    }

    .charge-duration-display {
        grid-area: 1 / 2 / -1 / 3;
    }
}

.charge-duration-display {
    font-variant-numeric: tabular-nums;
    font-size: 5.6rem;
    font-weight: 700;
    line-height: 0.8;
}

.charge-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 24px;
    margin-bottom: 32px;
}

@media screen and (min-width: 670px) {
    .charge-results-list {
        margin-top: 16px;
    }
}

.charge-result-item {
    background-color: #2a2a2a;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 4px;
}

.charge-icon {
    fill: currentColor;
    flex-shrink: 0;
    width: 0px;
    /* Ícones removidos */
}

.charge-text {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
}

.charge-description {
    display: block;
    font-weight: 400;
    color: #ccc;
}

.charge-item-duration {
    font-variant-numeric: tabular-nums;
    margin-left: auto;
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 0.95;
}

.charge-footer {
    text-align: center;
}

@media screen and (min-width: 670px) {
    .charge-footer {
        text-align: left;
    }
}

.autonomy-regained-box {
    text-align: center;
    border: 2px solid #fff;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin: 16px 0;
    padding: 16px;
}

@media screen and (min-width: 670px) {
    .autonomy-regained-box {
        flex-direction: row;
    }
}

.regained-value {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    width: auto;
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 0.95;
    margin-left: 8px;
}

@media screen and (min-width: 1024px) {
    .regained-value {
        font-size: 2.8rem;
    }
}

/* --- SLIDER DUPLO (Carregamento) (DARK MODE) --- */

/* (CORREÇÃO: .range-label-container foi removido do HTML) */

.dual-slider-container {
    position: relative;
    /* height: 30px; */
    /* REMOVIDO: Cortava os labels */
    height: 24px;
    /* ADICIONADO: Altura base para os thumbs */
    padding-top: 30px;
    /* ADICIONADO: Espaço para os labels flutuarem */
    user-select: none;
}

.dual-slider-track {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    width: 100%;
    background: #333;
    border-radius: 6px;
    z-index: 1;
}

.dual-slider-range {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    background: #89BABE;
    /* NOVA COR */
    border-radius: 6px;
    z-index: 2;
}

.dual-slider-thumb {
    position: absolute;
    width: 24px;
    height: 24px;
    background: #fff;
    border: 1px solid #fff;
    border-radius: 50%;
    top: 50%;
    transform: translate(-12px, -50%);
    /* O JS trata do 'left' */
    cursor: grab;
    z-index: 3;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}

.dual-slider-thumb:active {
    cursor: grabbing;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

/* (NOVO) Estilo para os labels DENTRO dos thumbs */
.thumb-label {
    position: absolute;
    bottom: 30px;
    /* Posição acima do thumb */
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    pointer-events: none;
    /* Para não interferir com o drag */
}


@media screen and (min-width: 670px) {
    .dual-slider-container {
        margin-top: 10px;
        margin-bottom: 10px;
    }
}


/* --- RESULTADOS CUSTOS (DARK MODE) --- */
.costs-results .info-text {
    font-size: 1.2rem;
}

.savings-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 0 32px;
}

@media screen and (min-width: 670px) {
    .savings-header {
        flex-direction: row-reverse;
        justify-content: flex-start;
        gap: 16px;
        padding: 0 0 32px;
    }
}

.savings-value {
    font-size: 5.6rem;
    font-weight: 700;
    line-height: 0.8;
}

.savings-label {
    width: min-content;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

@media screen and (min-width: 1024px) {
    .savings-label {
        font-size: 1.8rem;
    }
}

.savings-comparison {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.comparison-column {
    background-color: #222;
    color: #fff;
    padding: 24px 16px;
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 16px;
    border-radius: 4px;
}

@media screen and (min-width: 670px) {
    .comparison-column {
        padding: 32px 20px;
    }
}

.comparison-column.is-ev {
    color: #fff;
    background-color: #000;
    border: 1px solid #333;
}

.comparison-header {
    text-align: center;
    display: flex;
    flex-direction: column-reverse;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

@media screen and (min-width: 1024px) {
    .comparison-header {
        text-align: left;
        flex-direction: row;
        gap: 32px;
    }
}

.comparison-title {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
}

@media screen and (min-width: 1024px) {
    .comparison-title {
        font-size: 1.8rem;
    }
}

.comparison-cost-value {
    font-size: 3.6rem;
    font-weight: 700;
    line-height: 0.95;
}

.comparison-cost-label {
    font-size: 1.2rem;
    line-height: 1.4;
    color: #ccc;
}

@media screen and (min-width: 1024px) {
    .comparison-cost-label {
        text-align: right;
        white-space: nowrap;
    }
}

.comparison-legend {
    margin-bottom: 16px;
    font-size: 1.4rem;
    line-height: 1.4;
}

.comparison-summary {
    min-height: 40px;
    display: flex;
}

.comparison-summary-button {
    text-align: left;
    width: 100%;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: inherit;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nested-slider {
    margin-top: 16px;
}

.inline-result {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 8px;
    margin: 0;
    font-size: 1.2rem;
}

/* Font para números (tabular) */
.number-font {
    font-feature-settings: "tnum";
}

/* --- CUSTOM SELECT (Dropdown) (DARK MODE) --- */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    padding: 10px 30px 10px 12px;
    border: 1px solid #888;
    border-radius: 4px;
    background-color: #333;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1.4;
}

/* Seta do dropdown */
.custom-select-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    border-bottom: 2px solid #fff;
    border-right: 2px solid #fff;
    pointer-events: none;
}

.custom-select-wrapper.dark-mode .custom-select-input {
    background-color: #222;
    border-color: #555;
}

.custom-select-wrapper.dark-mode::after {
    border-bottom-color: #fff;
    border-right-color: #fff;
}

/* Placeholder para ícones de carregamento */
.charge-icon {
    display: inline-block;
    width: 0px;
    height: 0px;
    background-color: #555;
    border-radius: 4px;
    flex-shrink: 0;
}