@import url('https://fonts.googleapis.com/css2?family=Bitter:wght@700&family=Roboto:wght@300;700&display=swap');

body {
    font-family: 'Bitter', serif;
    background-color: #fff;
    margin: 0;
    padding: 0;
}

.container {
    width: 936px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

h1 {
    text-align: center;
}


/* ESTILOS PARA EL GRÁFICO DE RESULTADOS */
#resultadoFinal {
    width: 100%;
    text-align: center;
    margin: 30px 0 50px 0;
    font-family: 'Bitter', serif;
}

#resultadoFinal h6 {
    font-size: 18px;
    font-weight: bold;
    color: #333333;
    margin: 0 0 10px 0;
    text-transform: uppercase;
}

#resultado {
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px; /* Reducir gap de 10px a 5px */
}

#resultado.aprobado {
    color: #357a38;
}

#resultado.no-aprobado {
    color: #d16968;
}

#resultado i {
    font-size: 16px;
    color: white;
    background-color: currentColor;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
}

#resultado.aprobado i {
    background-color: #357a38;
}

#resultado.no-aprobado i {
    background-color: #d16968;
}

.vote-numbers {
    display: flex;
    justify-content: center;
    gap: 80px;
    margin: 20px 0;
    position: relative;
    width: 100%;
    height: 80px; /* Dar altura fija para evitar solapamiento */
    z-index: 10;
}

.vote-number-container {
    text-align: center;
    position: absolute;
    top: 0;
    opacity: 0;
    transform: translateX(-20px); /* Solo desde la izquierda */
    transition: all 0.6s ease-out;
    z-index: 10;
}

.vote-number-container.initial-hidden {
    opacity: 0;
    transform: translateX(-20px); /* Solo desde la izquierda */
}

.vote-number-container.animated {
    opacity: 1;
    transform: translateX(0); /* Solo movimiento horizontal */
}

.vote-number-container:first-child {
    left: 0;
    transform: translateX(-20px); /* Posición inicial desde la izquierda */
}

.vote-number-container:last-child {
    left: 50%;
    transform: translateX(-20px); /* Quitar el centrado, solo movimiento desde izquierda */
}

.vote-number-container.animated:first-child {
    transform: translateX(0); /* Sin centrado */
}

.vote-number-container.animated:last-child {
    transform: translateX(0); /* Sin centrado, alineado desde el inicio */
}

.vote-number {
    font-size: 45px;
    font-weight: bold;
    font-family: 'Bitter', serif;
    color: #333333;
    margin-bottom: 5px;
}

.vote-label {
    font-size: 14px;
    font-weight: bold;
    font-family: 'Roboto', sans-serif;
    color: white;
    padding: 5px 10px;
    text-transform: uppercase;
    position: relative;
    border-radius: 8px;
}

.vote-label.favor {
    background-color: #357a38;
}

.vote-label.contra {
    background-color: #d16968;
}

.custom-chart-container {
    position: relative;
    width: 100%;
    margin: 20px 0; /* Reducir margen superior */
    z-index: 1;
}

.custom-chart-bar {
    display: flex;
    width: 100%;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1;
}

.chart-section {
    height: 100%;
    width: 0;
    transition: width 0.8s ease-out;
    z-index: 1;
}

.chart-section.initial-load {
    width: 0; /* Solo para carga inicial */
}

.chart-section.favor {
    background-color: #357a38;
}

.chart-section.contra {
    background-color: #d16968;
}

.chart-section.abstencion {
    background-color: #b0b0b0;
}

.chart-section.ausente {
    background: repeating-linear-gradient(
        -45deg,
        #e9e9e9,
        #e9e9e9 3px,
        #fff 3px,
        #fff 6px
    );
}

.mayoria-line {
    position: absolute;
    top: -10px;
    height: 117px;
    width: 2px;
    background-color: #333333;
    opacity: 0;
    transition: opacity 0.5s ease-out, left 0.5s ease-out;
    z-index: 5;
    left: 50%;
    display: block; /* Asegurar que sea visible */
    visibility: visible; /* Asegurar visibilidad */
}

.mayoria-line.fade-in {
    opacity: 1 !important; /* Forzar opacidad */
}

.mayoria-line.fade-out {
    opacity: 0;
}

.mayoria-text {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: bold;
    font-family: 'Roboto', sans-serif;
    color: #333333;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: inherit;
    display: block; /* Asegurar que sea visible */
    visibility: visible; /* Asegurar visibilidad */
}

.chart-references {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 15px;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    color: #666;
    gap: 15px;
}

.reference-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ref-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.ref-color.abstencion {
    background-color: #b0b0b0;
}

.ref-color.ausente {
    background: repeating-linear-gradient(
        -45deg,
        #e9e9e9,
        #e9e9e9 2px,
        #fff 2px,
        #fff 4px
    );
}

.reference-separator {
    color: #999;
}

@keyframes fadeInLine {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Media queries para el gráfico */
@media (max-width: 767px) {
    #resultadoFinal {
        margin: 20px 0 30px 0;
        padding: 0 10px; /* Agregar padding horizontal */
    }
    
    #resultadoFinal h6 {
        font-size: 16px;
    }
    
    #resultado {
        font-size: 20px;
    }
    
    .vote-numbers {
        gap: 40px;
    }
    
    .vote-number {
        font-size: 35px;
    }
    
    .vote-label {
        font-size: 12px;
    }
    
    .custom-chart-bar {
        height: 50px;
    }
    
    .mayoria-line {
        height: 117px;
        top: -10px;
    }
    
    .chart-references {
        flex-direction: column;
        gap: 5px;
        align-items: flex-end;
    }
    
    .reference-separator {
        display: none;
    }
}

.toggle-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 5px;
    margin-bottom: 50px;
    background-color: #2083AF;
    border-radius: 40px;
    padding: 5px;
    margin-right: auto;
    margin-left: auto;
    width: 330px;
}

.toggle-option {
    flex: 1;
    text-align: center;
    padding: 10px 20px;
    border-radius: 40px;
    cursor: pointer;
    font-family: 'Bitter', serif;
    font-weight: bold;
    font-size: 21px;
    color: #fff;
}

.toggle-option.active {
    background-color: #063f6a;
}

/* Estilo para opción única - no clickeable */
.toggle-option.single-option {
    cursor: default;
    opacity: 0.9;
}

.toggle-option.single-option:hover {
    background-color: #063f6a; /* Mantener el mismo color en hover */
}

.filter-section {
    text-align: center;
    margin-bottom: 20px;
    padding-top: 5px;
}

.filter-title {
    font-size: 17px;
    margin-bottom: 30px;
    font-weight: bold;
}

.filters {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.filter-btn {
    background-color: initial;
    color: #333333;
    border: none;
    padding: 0;
    cursor: pointer;
    margin: 0 11px;
    border-radius: 5px;
    transition: background-color 0.3s;
    font-weight: 500;
    font-size: 14px;
    font-family: 'Bitter', serif;
}

.filter-btn:first-child {
    margin-left: 0;
}

.filter-btn:last-child {
    margin-right: 0;
}

.filter-btn:hover,
.filter-btn.active {
    color: #2083AF;
}

.separator {
    display: inline-block;
    width: 1px;
    height: 26px;
    background-color: #333333;
}

.results {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 0;
}

.result-group {
    width: 100%;
    margin-bottom: 40px;
    padding: 0 20px;
}

.result-group h3 {
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333333;
    font-size: 19px;
    text-transform: uppercase;
    font-weight: bold;
}

.party-list {
    font-size: 0.9em;
    margin-bottom: 20px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.party-list .party-group {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px 10px;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    width: 100%;
    box-sizing: border-box;
}

.party-list .party {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    width: auto;
}

.party-list .party span.party-circle {
    width: 19px;
    height: 19px;
    border-radius: 5px;
}

.party-list .party-name {
    font-weight: 300;
    flex: none;
    text-align: left;
    white-space: nowrap;
}

.result-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    width: 100%;
    margin: auto;
    padding: 0px;
    position: static;
}

.result-card {
    background: #fff;
    border-radius: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 98px;
    height: auto; 
    opacity: 0;
    animation: 1s appear forwards;
    transition: opacity .5s;
    position: static;
}

.cargo {
    margin: 5px 0;
    font-size: 0.75em;
    font-family: 'Roboto', sans-serif;
}

span.expand-symbol {
    color: #2083af;
    font-size: 13px;
    cursor: pointer;
}

.photo-container {
    position: relative;
    width: 100%;
    height: calc(98px + 5px);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.photo-container img {
    width: 100%;
    height: 98px;
    object-fit: cover;
}

.result-card h3 {
    font-size: 0.9em;
    margin: 10px 0;
    line-height: 1.2em;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.result-card p {
    margin: 5px 0;
    font-size: 0.75em;
    font-family: 'Roboto', sans-serif;
    display: flex;
    align-items: normal;
    justify-content: center;
    box-sizing: border-box;
    text-align: center;
}

.result-card .comment {
    font-size: 0.7em;
    color: #666;
    display: flex;
    align-items: normal;
    justify-content: center;
    box-sizing: border-box;
    text-align: center;
}

.search-container {
    position: relative;
    display: inline-block;
    float: initial;
    margin-top: 10px;
    margin-bottom: 20px;
}

.search-input {
    float: right;
    padding: 8px;
    margin-top: 12px;
    border: 1px solid #333333;
    border-radius: 5px;
    font-size: 13px;
    color: #333333;
    margin-right: 0;
}

.clear-search {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-26%);
    cursor: pointer;
    font-size: 1.4em;
    color: #ccc;
    display: none;
}

.search-input:focus + .clear-search,
.search-input:not(:placeholder-shown) + .clear-search {
    display: inline;
}

.change-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    cursor: help;
    margin-left: 4px;
    vertical-align: middle;
    background-color: #2083AF;
}

.change-indicator i {
    font-size: 8px;
    color: white;
}

.tooltip-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999999;
}

.tooltip-content {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Roboto', sans-serif;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    transform: translateX(-50%);
    z-index: 999999;
}

.tooltip-content::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

.vicepresidenta {
    font-family: 'Bitter', serif;
    font-size: 11px;
    margin-top: -10px;
    text-transform: uppercase;
    color: #2083af;
}

.metodologia-section {
    text-align: center;
    margin-top: 50px;
    padding: 0 20px;
}

.metodologia-title {
    font-family: 'Bitter', serif;
    font-weight: 400;
    font-size: 15px;
    color: #000000;
    margin-bottom: 0;
}

.metodologia-text {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 13px;
    color: #000000;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    margin-block-start: 8px;
}

.credits-title {
    font-family: 'Bitter', serif;
    font-weight: 400;
    font-size: 15px;
    color: #000000;
    margin-bottom: 0px;
}

.credits-text {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 13px;
    color: #000000;
    margin-bottom: 50px;
    margin-block-start: 8px;
}

.credits-text strong {
    font-weight: 700;
}

@keyframes appear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Reglas específicas para desktop (pantallas grandes) */
@media (min-width: 1025px) {
    .party-list .party-group {
        width: fit-content;
        margin: 5px auto;
    }

    .party-list .party {
        width: auto;
        min-width: fit-content;
        margin: 0 15px;
        white-space: nowrap;
    }

    .party-list .party-name {
        flex: none;
        width: auto;
        white-space: nowrap;
    }
}

/* Ajustes para tablets */
@media (min-width: 768px) and (max-width: 1024px) {
    #resultadoFinal {
        padding: 0 10px; /* Agregar padding horizontal */
    }
    
    .tooltip-content {
        white-space: normal!important;
        text-align: center!important;
        max-width: 90px;
    }

    .container {
        width: 98%;
        max-width: 100%;
        overflow: hidden;
    }

    .filters {
        justify-content: center;
        row-gap: 7px;
    }

    .search-container {
        margin-left: auto;
        margin-right: auto;
        float: unset;
    }

    .search-input {
        float: unset;
        margin-right: 0;
    }

    .separator {
        height: 16px;
    }

    .party-list .party-group {
        width: 550px;
        gap: 10px;
    }

    .party-list .party {
        width: auto;
        justify-content: space-between;
    }

    .result-cards {
        gap: 5px;
        row-gap: 12px;
    }

    .result-card {
        width: 25%;
        max-width: 100px;
        margin: 0 2px;
    }

    .result-group {
        padding: 0px;
    }

    .result-card h3 {
        margin-bottom: 0;
    }

    .result-card p {
        margin: 1px 0;
    }

    .toggle-switch {
        width: 90%;
        margin-bottom: 40px;
    }

    .vicepresidenta {
        margin-top: 0px!important;
    }
}

/* Ajustes para móviles */
@media (max-width: 767px) {
    #resultadoFinal {
        margin: 20px 0 30px 0;
        padding: 0 10px; /* Agregar padding horizontal */
    }
    
    .tooltip-content {
        white-space: normal!important;
        text-align: center!important;
        max-width: 90px;
    }

    .container {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

        h1 {
        font-size: 1.3em;
        margin-left: 20px !important;
        margin-right: 20px !important;
    }

    p.filter-title {
    padding-top: 20px;
    margin-bottom: 10px;
    }

    .filters {
        justify-content: center;
        row-gap: 7px;
    }

    .search-container {
        margin-left: auto;
        margin-right: auto;
        float: unset;
    }

    .search-input {
        float: unset;
        margin-right: 0;
    }

    .separator {
        height: 16px;
    }

    .party-list .party-group {
        width: 100%;
        gap: 10px;
    }

    .party-list .party {
        width: auto;
        justify-content: space-between;
    }

    .result-cards {
        gap: 5px;
        row-gap: 12px;
    }

    .result-card {
        width: 25%;
        max-width: 100px;
        margin: 0 auto;
    }

    .result-group {
        padding: 0px;
    }

    .result-card h3 {
        margin-bottom: 0;
    }

    .result-card p {
        margin: 1px 0;
    }

    .toggle-switch {
        width: 90%;
        margin-bottom: 40px;
    }

    .clear-search {
        right: 6px;
    }

    p.no-results {
        padding-left: 10px;
        padding-right: 10px;
    }

    .vicepresidenta {
        margin-top: 0px!important;
    }
}

.custom-chart-container {
    width: 94%;
}

.error {
    color: #d32f2f;
    background-color: #ffebee;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
    border: 1px solid #ffcdd2;
    font-weight: 500;
}
