/* ============================================
   CHARTS EMBALSES - CSS UNIFICADO
   ============================================ */

/* === RESET === */
*,
*:before,
*:after {
    box-sizing: border-box;
}

/* === CONTENEDOR TÍTULO COMÚN === */
.container-title-embalses {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

.container-title-embalses h2 {
    max-width: 640px;
    width: 100%;
    color: #000000;
    margin: 15px 0px 0px 0px;
    font-family: 'Encode Sans', sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 24px;
    letter-spacing: 0px;
    text-align: left;
}

.container-title-embalses h4 {
    width: 100%;
    text-align: left;
    color: #444444;
    font-size: 14px;
    margin: 30px 0px 0px 0px;
    font-family: 'Encode Sans', sans-serif;
    font-weight: 700;
    text-align: left;
}

.container-title-embalses p {
    max-width: 640px;
    width: 100%;
    text-align: left;
    font-size: 14px;
    font-family: 'Encode Sans', sans-serif;
    line-height: 18px;
    margin: 10px 0px 20px 0px;
    color: #181818;
}

.container-title-embalses .border-embalses {
    margin: 10px 0px 0px 0px;
    box-sizing: border-box;
    max-width: 640px;
    height: 5.38px;
    text-decoration-line: line-through;
    text-decoration-color: #018571;
    text-decoration-style: wavy;
    text-decoration-thickness: 3px;
}

/* === TOOLTIP COMÚN === */
.tooltip-embalses {
    position: absolute;
    z-index: 10;
    visibility: hidden;
    color: black;
    padding: 8px;
    background-color: white;
    border-radius: 0px;
    font-size: 12px;
    font-family: 'Encode Sans', sans-serif;
    box-shadow: 0 2px 2px 0 #ccc;
    border: 1px solid #ccc;
    margin-left: 2px;
    pointer-events: none;
    line-height: 1.5;
}

.tooltip-embalses h3 {
    margin-bottom: 5px;
    margin-top: 5px;
    font-size: 14px;
}

.tooltip-embalses .columna-datos {
    text-align: right;
    padding-bottom: 0px;
    padding-top: 0px;
    border-bottom: 1px solid #ddd;
}

.tooltip-embalses .primeracolumna {
    border-bottom: 1px solid #ddd;
    padding-bottom: 0px;
    padding-top: 0px;
}

.tooltip-embalses p {
    font-size: 12px;
}

/* Clases para tablas dentro de tooltips */
.columna-datos-eldiarioes {
    text-align: right;
    padding-bottom: 0px;
    padding-top: 0px;
    border-bottom: 1px solid #ddd;
}

.primeracolumna-eldiarioes {
    border-bottom: 1px solid #ddd;
    padding-bottom: 0px;
    padding-top: 0px;
}

/* === LEYENDA COMÚN === */
.legend-embalses-comun {
    font-family: 'Encode Sans', sans-serif;
    font-size: 12px;
}

/* === DROPDOWN COMÚN === */
.dropdown-embalses {
    font-family: 'Encode Sans', sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 24px;
    letter-spacing: 0px;
    border: 1px solid #cecece;
    color: #000000;
    background-color: white;
}

/* ============================================
   1. CARTOGRAMA EMBALSES
   ============================================ */

#div-containers-mapa-embalses {
    display: flex;
    flex-direction: column;
    position: relative;
}

#container-cartograma-embalses {
    width: 100%;
    position: relative;
}

#legend-porcentaje-reserva {
    position: absolute;
    left: 30px;
    top: 110px;
}

.legendLlenadoEmbalse {
    font-family: 'Encode Sans';
    font-size: 12px;
}

#container-button-mapa-embalses {
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    font-family: 'Encode Sans';
}

#buttons-selector-tipo-embalse {
    flex: 1 1 auto;
    display: flex;
    font-size: 14px !important;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin: 10px 0px;
    text-align: center;
}

#buttons-selector-tipo-embalse button {
    color: black;
    min-width: 100px;
    height: 30px;
    border: 2px solid #c5c5c5;
    font-family: 'Encode Sans', sans-serif;
    font-size: 14px;
    margin: 5px 3px;
    background-color: white;
    cursor: pointer;
    opacity: 1;
}

#buttons-selector-tipo-embalse button:focus {
    outline: none;
}

#buttons-selector-tipo-embalse .button-mapa-active {
    border: 2px solid #018571;
    background-color: #018571;
    color: white;
    opacity: 1;
}

/* Leyenda visual embalse */
.legend-embalse {
    font-family: 'Encode Sans';
    font-size: 12px;
    position: absolute;
    left: 60px;
    top: 40px;
    line-height: 12px;
}

.legend-embalse .square-legend-embalse {
    width: 50px;
    height: 50px;
    background-color: #fff;
    border: 2px solid black;
    position: relative;
    display: flex;
    justify-content: center;
    font-weight: 700;
    text-align: center;
}

.legend-embalse .text-legend-embalse {
    top: -15px;
    position: absolute;
}

.legend-embalse .reserva-legend-embalse {
    position: absolute;
    bottom: -2px;
    width: 50px;
    height: 35px;
    background-color: #018571;
    border: 2px solid black;
}

.legend-embalse .text-reserva-legend-embalse {
    position: absolute;
    bottom: 5px;
    left: 0px;
    font-weight: 400;
    color: white;
}

/* Labels del cartograma */
.labeltext-embalse {
    font-family: 'Encode Sans', sans-serif;
    pointer-events: none;
    fill: #000000;
    stroke: none;
    font-weight: 400;
    text-transform: uppercase;
}

.shadowlabel-embalse {
    font-family: 'Encode Sans', sans-serif;
    pointer-events: none;
    fill: black;
    stroke: white;
    stroke-width: 3px;
    opacity: 0.8;
    text-transform: uppercase;
}

/* Iconos flechas */
.flechaazul {
    background-image: url(https://lab.eldiario.es/elections-maps/mapas-catalunya-14f/leyendas/arrowgreen.svg);
    width: 10px;
    height: 10px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px;
    display: inline-block;
}

.flecharoja {
    background-image: url(https://lab.eldiario.es/elections-maps/mapas-catalunya-14f/leyendas/arrowred.svg);
    width: 10px;
    height: 10px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px;
    display: inline-block;
}

.flechaigual {
    background-image: url(https://www.eldiario.es/documentos/Cfakepathigualsvg_EDIFIL20191025_0005.svg);
    width: 10px;
    height: 10px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px;
    display: inline-block;
}

/* Texto desliza mobile */
.text-slide-mobile {
    font-family: 'Encode Sans', sans-serif;
    margin-top: 30px;
    margin-left: 0px;
    text-align: left;
    display: none;
    font-size: 12px;
}

.map-text__hand {
    animation: shake 1.5s infinite;
    width: 30px;
    vertical-align: middle;
}

@keyframes shake {
    50% {
        margin-right: 15px;
    }
    100% {
        margin-right: 0px;
    }
}

/* ============================================
   2. CUENCAS BARRAS AJUSTADAS
   ============================================ */

#contenedor-grafico-barras-cuencas {
    width: 100%;
}

#grafico-barras-cuencas .lineabarrasmedia10year {
    stroke-width: 1.5px;
    stroke: #ffffff;
}

#grafico-barras-cuencas .textoAnnotacion {
    font-family: 'Encode Sans', sans-serif;
    font-size: 13px;
    font-weight: 400;
    text-anchor: end;
}

#grafico-barras-cuencas .labelbarras {
    font-family: 'Encode Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    -webkit-text-stroke-width: 2px;
    -webkit-text-stroke-color: white;
}

#grafico-barras-cuencas .xTexto {
    font-family: 'Encode Sans', sans-serif;
    font-size: 13px;
}

#grafico-barras-cuencas .yTexto {
    font-family: 'Encode Sans', sans-serif;
    font-size: 13px;
}

#grafico-barras-cuencas .eje-horizontal-barras path {
    stroke-width: 0;
}

#grafico-barras-cuencas .eje-horizontal-barras line {
    stroke: #a1a1a1;
    stroke-dasharray: 3;
    stroke-width: 0.5;
}

#grafico-barras-cuencas .eje-horizontal-barras-zero path {
    stroke-width: 0;
}

#grafico-barras-cuencas .eje-horizontal-barras-zero line {
    stroke: #383838;
    stroke-width: 1.5;
}

#grafico-barras-cuencas .eje-horizontal-barras-zero text {
    display: none;
}

/* ============================================
   3. EVOLUCIÓN CUENCAS (LÍNEAS)
   ============================================ */

#contenedor-curva-embalse-reserva {
    width: 100%;
}

#curvas-embalse-reserva {
    width: 100%;
}

#curvas-embalse-reserva text {
    font-size: 14px;
    font-family: 'Encode Sans', sans-serif;
}

#curvas-embalse-reserva .nombre-pais-curva {
    font-size: 14px;
    font-family: 'Encode Sans', sans-serif;
    fill: #2020;
    font-weight: 700;
}

#curvas-embalse-reserva .ncasostotales {
    font-size: 11px;
    font-family: 'Encode Sans', sans-serif;
    fill: #939393;
}

#curvas-embalse-reserva .eje-vertical-embalse-reserva line {
    stroke: #c5c5c5;
    stroke-dasharray: 3;
    stroke-width: 0.5;
}

#curvas-embalse-reserva .eje-vertical-embalse-reserva text {
    fill: #939393;
}

#curvas-embalse-reserva .eje-vertical-embalse-reserva path {
    stroke-width: 0;
}

#curvas-embalse-reserva .eje-horizontal path {
    stroke-width: 0;
}

#curvas-embalse-reserva .eje-horizontal text {
    fill: #939393;
}

#curvas-embalse-reserva .eje-horizontal line {
    stroke: #939393;
    stroke-width: 1;
}

#cuencaMenu {
    font-family: 'Encode Sans', sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 24px;
    letter-spacing: 0px;
    border: 1px solid #cecece;
    color: #000000;
    background-color: white;
}

/* ============================================
   4. PRECIPITACIONES CUENCAS (BARRAS)
   ============================================ */

#contenedor-barras-precipitaciones-cuencas {
    width: 100%;
}

#precipitaciones-cuencas {
    width: 100%;
}

#precipitaciones-cuencas text {
    font-size: 14px;
    font-family: 'Encode Sans', sans-serif;
}

#precipitaciones-cuencas .nombre-pais-curva {
    font-size: 14px;
    font-family: 'Encode Sans', sans-serif;
    fill: #333333;
    font-weight: 700;
}

#precipitaciones-cuencas .ncasostotales {
    font-size: 11px;
    font-family: 'Encode Sans', sans-serif;
    fill: #939393;
}

#precipitaciones-cuencas .eje-vertical-precipitaciones-cuencas line {
    stroke: #c5c5c5;
    stroke-dasharray: 3;
    stroke-width: 0.5;
}

#precipitaciones-cuencas .eje-vertical-precipitaciones-cuencas text {
    fill: #939393;
    font-size: 14px;
}

#precipitaciones-cuencas .eje-vertical-precipitaciones-cuencas path {
    stroke-width: 0;
}

#precipitaciones-cuencas .eje-horizontal path {
    stroke-width: 0;
}

#precipitaciones-cuencas .eje-horizontal text {
    fill: #939393;
}

#precipitaciones-cuencas .eje-horizontal line {
    stroke: #939393;
    stroke-width: 1;
}

#precipitaciones-cuencas .label-media {
    font-size: 11px !important;
}

/* ============================================
   5. PRECIPITACIONES EVOLUCIÓN TOTAL
   ============================================ */

#contenedor-curva-precipitaciones-totales {
    width: 100%;
}

#curvas-precipitaciones-totales {
    width: 100%;
}

#curvas-precipitaciones-totales text {
    font-size: 14px;
    font-family: 'Encode Sans', sans-serif;
}

#curvas-precipitaciones-totales .nombre-pais-curva {
    font-size: 14px;
    font-family: 'Encode Sans', sans-serif;
    fill: #333333;
    font-weight: 700;
}

#curvas-precipitaciones-totales .ncasostotales {
    font-size: 11px;
    font-family: 'Encode Sans', sans-serif;
    fill: #939393;
}

#curvas-precipitaciones-totales .eje-vertical-precipitaciones-totales line {
    stroke: #c5c5c5;
    stroke-dasharray: 3;
    stroke-width: 0.5;
}

#curvas-precipitaciones-totales .eje-vertical-precipitaciones-totales text {
    fill: #939393;
}

#curvas-precipitaciones-totales .eje-vertical-precipitaciones-totales path {
    stroke-width: 0;
}

#curvas-precipitaciones-totales .eje-horizontal path {
    stroke-width: 0;
}

#curvas-precipitaciones-totales .eje-horizontal text {
    fill: #939393;
}

#curvas-precipitaciones-totales .eje-horizontal line {
    stroke: #939393;
    stroke-width: 1;
}

#curvas-precipitaciones-totales .label-media {
    font-size: 11px !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
    /* Cartograma */
    #div-containers-mapa-embalses {
        display: flex;
        flex-direction: column;
    }

    #container-cartograma-embalses {
        width: 100%;
        overflow: scroll;
        overflow-y: hidden;
        position: relative;
    }

    .text-slide-mobile {
        display: block;
        position: absolute;
        right: 0;
    }

    .legend-embalse {
        left: 20px;
        top: 15px;
    }

    #legend-porcentaje-reserva {
        position: absolute;
        left: 125px;
        top: 0px;
    }
}

/* ============================================
   UTILIDADES
   ============================================ */

.fuente-embalses {
    font-size: 12px;
    text-align: left;
    font-family: 'Encode Sans', sans-serif;
    line-height: 20px;
    color: #181818;
}

/* ============================================
   TIRA RESUMEN EMBALSES
   ============================================ */

#actualizacion-datos-fecha {
    font-family: 'Encode Sans', sans-serif;
    width: 100%;
    font-size: 12px;
    text-transform: uppercase;
    text-align: center;
    color: #777777;
    margin-bottom: 20px;
}

#wrapper-reserva-agua-embalses {
    width: 100%;
    display: flex;
    font-family: 'Encode Sans', sans-serif;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 70px;
}

.reserva-actual-embalses {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: start;
    padding-top: 20px;
    text-align: center;
    flex: 5;
    border-right: 1px dashed #c5c5c5;
    padding-right: 20px;
}

.embalses-peor-situacion {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: start;
    padding-top: 20px;
    text-align: center;
    flex: 5;
}

.reserva-actual-embalses .title-reserva-actual-embalses {
    display: flex;
    flex-direction: column;
    justify-content: left;
    align-items: start;
    text-align: left;
    margin-right: 10px;
    font-family: 'Encode Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
    margin-left: 10px;
    margin-bottom: 20px;
    line-height: 19px;
    max-width: 120px;
}

.embalses-peor-situacion .title-embalses-peor-situacion {
    display: flex;
    flex-direction: column;
    justify-content: left;
    align-items: start;
    text-align: left;
    margin-right: 10px;
    font-family: 'Encode Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
    margin-left: 10px;
    margin-bottom: 20px;
    line-height: 19px;
    max-width: 120px;
}

.reserva-actual-embalses .situacion-reserva-peninsular {
    position: relative;
    width: 300px;
}

.reserva-actual-embalses .div-reserva-peninsular {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.reserva-actual-embalses #evolucion-reserva-peninsular {
    font-size: 14px;
    font-weight: 400;
    line-height: 18px;
    text-align: left;
    margin-top: 20px;
    width: 250px;
    margin-left: 80px;
}

.reserva-actual-embalses #text-average-10-years {
    font-size: 12px;
    font-weight: 400;
    line-height: 13px;
    text-align: right;
    position: absolute;
    max-width: 50px;
    text-transform: uppercase;
    transform: translateY(50%);
}

.reserva-actual-embalses #line-average-10-years {
    width: 180px;
    margin-left: 60px;
    position: absolute;
    border-top: 1px dashed #367E7F;
}

.reserva-actual-embalses #number-average-10-years {
    margin-top: -9px;
    right: 10px;
    background: white;
    padding: 3px;
    margin-left: 3px;
    font-size: 12px;
    font-weight: 400;
    line-height: 12px;
    text-align: left;
    display: inline-block;
    position: absolute;
    max-width: 50px;
    color: #367E7F;
    transform: translateY(50%);
}

.reserva-actual-embalses .square-reserva-peninsular {
    height: 150px;
    width: 150px;
    border: 2px solid #CFE9E5;
    border-radius: 5px;
    position: relative;
    margin-left: 80px;
}

.reserva-actual-embalses #number-capacidad-total {
    margin-top: -9px;
    font-size: 12px;
    font-weight: 400;
    text-align: center;
    margin-bottom: 3px;
}

.reserva-actual-embalses #number-capacidad-total span {
    background: white;
    padding: 3px;
}

.reserva-actual-embalses #text-capacidad-total {
    font-size: 12px;
    font-weight: 700;
    line-height: 12px;
    text-align: center;
    text-transform: uppercase;
    color: #80CDC1;
}

.reserva-actual-embalses .axis-element-reserva-peninsular {
    width: 10px;
    border: 0.1px solid #80CDC1;
    position: absolute;
}

.reserva-actual-embalses #fill-reserva-peninsular {
    width: 100%;
    background: #CFE9E5;
    bottom: 0px;
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 0px 0px 3px 3px;
    transition: height 3s ease-in;
}

.reserva-actual-embalses #drop-reserva-peninsular {
    position: absolute;
    background-color: #CFE9E5;
    top: 2px;
    right: 5px;
    width: 15px;
    height: 15px;
    border-radius: 0% 100% 100% 100%;
    -webkit-transform: rotate(45deg);
    transform: rotate(45deg);
    animation: fluidDrop 2s infinite;
}

.reserva-actual-embalses #text-fill-reserva-peninsular {
    font-size: 16px;
    line-height: 18px;
    text-align: center;
    color: #367E7F;
}

/* Cuencas en peor situación */
.embalses-peor-situacion .square-reserva-peor-situacion {
    width: 50px;
    border: 2px solid #CFE9E5;
    border-radius: 5px;
    position: relative;
}

.embalses-peor-situacion .div-embalses-peor-situacion {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    width: 100%;
    flex: 1;
}

.embalses-peor-situacion .container-embalses-peor-situacion {
    display: flex;
    height: 200px;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.embalses-peor-situacion .number-capacidad-total-peor-situacion {
    margin-top: -9px;
    font-size: 12px;
    font-weight: 400;
    text-align: center;
}

.embalses-peor-situacion .number-capacidad-total-peor-situacion span {
    background: white;
    padding: 3px;
}

.embalses-peor-situacion .text-fill-reserva-peor-situacion {
    font-size: 14px;
    line-height: 18px;
    text-align: center;
    color: #367E7F;
    margin: 4px;
    font-weight: 700;
}

.embalses-peor-situacion .text-name-reserva-peor-situacion {
    font-size: 12px;
    font-weight: 400;
    line-height: 12px;
    text-align: center;
    max-width: 100px;
    text-transform: uppercase;
    height: 20px;
}

.embalses-peor-situacion .fill-reserva-peor-situacion {
    width: 100%;
    background: #CFE9E5;
    bottom: 0px;
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 0px 0px 3px 3px;
    transition: height 3s ease-in;
}

.embalses-peor-situacion .line-average-10-years-peor-situacion {
    width: 46px;
    position: absolute;
    border-top: 1px dashed #367E7F;
    z-index: 1;
}

.embalses-peor-situacion .number-average-10-years-peor-situacion {
    margin-left: 50px;
    background: white;
    font-size: 12px;
    font-weight: 400;
    line-height: 12px;
    text-align: left;
    position: absolute;
    max-width: 50px;
    color: #367E7F;
    transform: translateY(50%);
}

/* Animación gota */
@keyframes fluidDrop {
    from {
        top: 0px;
        animation-timing-function: cubic-bezier(0.7, 0.22, 0.725, 0.61);
    }
    13.33% {
        top: 20px;
        animation-timing-function: cubic-bezier(0.16, 0.1875, 0.24, 0.094);
    }
    23.66% {
        top: 40px;
        animation-timing-function: cubic-bezier(0.234, 0.15, 0.88, 0.85);
    }
    65% {
        top: 80px;
        animation-timing-function: linear;
    }
    to {
        top: 115px;
    }
}

/* Responsive tira embalses */
@media (max-width: 900px) {
    .reserva-actual-embalses {
        flex-direction: column;
        flex: 1;
        border-right: 0px dashed #c5c5c5;
        padding-right: 0px;
        border-bottom: 1px dashed #c5c5c5;
        padding-bottom: 20px;
    }

    .reserva-actual-embalses .title-reserva-actual-embalses {
        max-width: 400px;
    }

    .embalses-peor-situacion {
        flex-direction: column;
        flex: 1;
    }

    .embalses-peor-situacion .title-embalses-peor-situacion {
        max-width: 400px;
    }
}