/*********************************************************/
/*** STYLES GRÀFIQUES                                  ***/
/*********************************************************/

div.titol-grafica {
    text-align: right;
    font-weight: bold;
    padding-top: 20px;
}

div.titol-grafica-taula {
    text-align: center;
    font-weight: bold;
    margin-bottom: 15px;
    margin-top: 30px;
}

div.graf-container {
    max-width: 840px;
    margin: 0 auto;
    position: relative;
    /*padding: 2vw;*/
    /*border: 1px solid #ccc;*/
    /*border-radius: 4px;*/
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

div.graf-noborder {
    border: 0 none !important;
    padding: 0 !important;
    max-width: 750px !important;
}

div.graf-noborder div.graf-grafica {
    aspect-ratio: unset !important;
}

div.graf-maxwidth {
    width: 100% !important;
}


div.graf-grafica {
    position: relative;
    aspect-ratio: 1.6;
    display: flex;
    flex-direction: column;
}

div.graf-llegenda {
    margin-top: 1vw;
}



div.graf-capsalera {
    display: flex;
    flex-wrap:wrap;
    margin: 0;
    margin-bottom: 10px;
    padding: 0;
    font-size: 14px;
    gap: 0;
}

div.graf-capsalera.graf-capsalera-columnes {
    flex-direction: column;
    justify-content: flex-end;
    align-content: space-between;
}

div.graf-capsalera.graf-capsalera-files {
    flex-direction: row;
    justify-content: space-between;
}

div.graf-capsalera-container {
    display: flex;
    gap: 20px;
    width: 100%;
}

div.graf-capsalera-label {
    font-weight: bold;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 0;
}

div.graf-capsalera-value {
    text-align: right;
    width: 60px;
}

div.graf-capsalera-perc {
    text-align: right;
    width: 60px;
}


div.graf-taula-wrap {
    width: calc(100vw - 40px);
    overflow: auto;
    border-radius: 5px;
    border: 1px solid rgba(173, 41, 55, 0.1);
}

div.graf-taula-wrap::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

div.graf-taula-wrap::-webkit-scrollbar-track {
    border-radius: 4px;
    background-color: #f0f0f0;
    border: 1px solid #cacaca;
}

div.graf-taula-wrap::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background-color: #c0c0c0;
}


table.graf-taula {
    /* Don't change these properties */
    border-collapse: collapse;
    position: relative;

    min-width: 100%;
}

/* Fixar la primera columna body */
table.graf-taula tbody tr:nth-child(even) td:first-child {
    background-color: rgb(245, 232, 234);
}

table.graf-taula tbody tr:nth-child(odd) td:first-child {
    background-color: white;
}

/* Fixar la primera columna capçalera */
table.graf-taula thead tr th:first-child, table.graf-taula tbody tr td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
}

table.graf-taula thead th {
    background: #ad2937;
    color: white;
    padding: 4px 10px 2px 10px;
}


table.graf-taula thead th.num {
    text-align: right;
    width: 100px;
}

table.graf-taula thead th.per {
    text-align: right;
    width: 100px;
}

table.graf-taula thead th.val {
    text-align: right;
    min-width: 80px;
}

table.graf-taula thead th img {
    width: 30px;
}


table.graf-taula tbody tr:nth-child(even) {
    background-color: rgb(245, 232, 234);
}

table.graf-taula tbody tr:nth-child(odd) {
    background-color: white;
}

table.graf-taula tbody td {
    padding: 3px 10px;
}

table.graf-taula tbody td div {
    max-height: 40px;
    line-height: 20px;
    overflow: hidden;
    margin-top: 2px;
}


table.graf-taula tbody td img {
    width: 40px;
    margin: 1px;
}

table.graf-taula tbody td.img {
    text-align: center;
    width: 40px;
}

table.graf-taula tbody td.num {
    text-align: right;
    min-width: 100px;
}

table.graf-taula tbody td.per {
    text-align: right;
    min-width: 100px;
}

table.graf-taula tbody td.val {
    text-align: right;
    min-width: 80px;
}

div.graf-logpet table tbody td img {
   width: 30px !important;
}

/*** Columnes Taules ***/
.col-hide-xs {
    display: none;
}

.col-partit {
    display: none;
}

.col-sigles {
    font-weight: bold;
}

.col-eleccions {
    font-weight: bold;
    text-wrap: nowrap;
}

.col-altres {
    min-width: 300px;
}

.col-altres div {
    font-size: x-small;
    line-height: 14px !important;
    max-height: unset !important;
    overflow: unset !important;
}

/*** Loading ***/
/* https://loading.io/css/ */
.lds-ellipsis {
    /* change color here */
    color: #ad2937;
    opacity: 10%;
}
.lds-ellipsis,
.lds-ellipsis div {
    box-sizing: border-box;
}
.lds-ellipsis {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
    margin: auto;
}
.lds-ellipsis div {
    position: absolute;
    top: 33.33333px;
    width: 13.33333px;
    height: 13.33333px;
    border-radius: 50%;
    background: currentColor;
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}
.lds-ellipsis div:nth-child(1) {
    left: 8px;
    animation: lds-ellipsis1 0.6s infinite;
}
.lds-ellipsis div:nth-child(2) {
    left: 8px;
    animation: lds-ellipsis2 0.6s infinite;
}
.lds-ellipsis div:nth-child(3) {
    left: 32px;
    animation: lds-ellipsis2 0.6s infinite;
}
.lds-ellipsis div:nth-child(4) {
    left: 56px;
    animation: lds-ellipsis3 0.6s infinite;
}
@keyframes lds-ellipsis1 {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}
@keyframes lds-ellipsis3 {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(0);
    }
}
@keyframes lds-ellipsis2 {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(24px, 0);
    }
}

/*** Responsive **/
@media only screen and (hover: none) and (pointer: coarse){
    /*Mobils i tauletes*/
    div.graf-taula-wrap {
        width: calc(100vw - 20px) !important;
    }
}

@media only screen and (min-width: 576px) {
    /*Mida S */
    .col-hide-xs {
        display: table-cell;
    }

    .col-partit {
        display: table-cell;
    }

    .col-sigles {
        display: none;
    }

    div.graf-container {
        padding: 20px;
        border: 1px solid #ccc;
        border-radius: 4px;
    }

    div.graf-capsalera {
        font-size: 16px;
    }

    div.graf-capsalera-container {
        gap: 10px;
        width: calc(50% - 10px);
    }

    div.graf-capsalera-columnes {
        height: 72px;
    }
}

@media only screen and (min-width: 768px) {
    /*Mida M */
    .col-partit {
        display: none;
    }

    .col-sigles {
        display: table-cell;
    }

    div.graf-taula-wrap {
        width: 100%;
    }

    div.graf-capsalera-container {
        gap: 20px;
    }

    div.graf-capsalera-columnes {
        height: unset;
    }

    div.graf-capsalera-container {
        width: 100%;
    }
}

@media only screen and (min-width: 992px) {
    /*Mida L */
    .col-partit {
        display: table-cell;
    }

    .col-sigles {
        display: none;
    }

    div.graf-maxwidth {
        max-width: 840px !important;
        width: 100% !important;
    }

    div.graf-capsalera-columnes {
        height: 72px;
    }

    div.graf-capsalera-container {
        gap: 10px;
        width: calc(50% - 10px);
    }
}

@media only screen and (min-width: 1201px) {
    /* Mida XL*/
    .col-partit {
        display: table-cell;
    }

    .col-sigles {
        display: table-cell;
    }

    div.graf-maxwidth {
        max-width: calc(100vw - 20px) !important;
        width: 100% !important;
    }

    div.graf-capsalera-columnes {
        height: 72px;
    }

    div.graf-capsalera-container {
        width: calc(50% - 20px);
    }
}
