/* Estilos globales */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
    color: #333;
    overflow-x: hidden;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
    color: #003366;
}

/* Estilos para los filtros */
.filtros {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}
.negativo {
    color: red;
}*

.filtro {
    background-color: #ffffff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
    flex: 1 1 150px;
    max-width: 45%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* Estilos específicos para el filtro de Comunidad Autónoma */
.filtro-comunidad {
    flex: 1 1 165px; /* Incrementar el flex-basis en un 10% */
    max-width: 15%; /* Incrementar el max-width en un 10% */
}

/* Estilos para el filtro más ancho (Año, Tipo de Dato, Escenario) */
.filtro-ancho {
    flex: 1 1 225px;
    max-width: 15%;
}

/* Estilos para los elementos internos del filtro */
.filtro label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #060734;
    text-align: left;
    width: 250px;
}

.filtro select {
    width: 100%;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-bottom: 10px;
}

/* Ajustes para los grupos de botones dentro del filtro */
.filtro .btn-group {
    margin-bottom: 10px;
    
}

/* Estilos para los botones de selección */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: left;
    gap: 5px;
}

.btn-group button {
    background-color: #e0e0e0;
    color: back;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 14px;
    text-align: left
}

.btn-group button.active {
    background-color: #060734;
    color: white;
}


/* Estilos para el botón de reset */
.reset-container {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.btn-reset {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 16px;
}

.btn-reset:hover {
    background-color: #c0392b;
}

/* Estilos para el contenedor principal */
.contenedor {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    width: 100%;
}

.caja{

    flex: 0 1 300px;
}

.tabla, .graficos {
    background-color: #ffffff;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    flex: 1 1 400px;
}

.tabla table {
    width: 100%;
    border-collapse: collapse;
}

.tabla th, .tabla td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

.tabla th {
    background-color: #060734;
    color: white;
    font-weight: bold;
    font-size: 14px;
    text-align: left;
}

.tabla td {
    font-size: 14px;
    color: #333;
    text-align: left;
    
}

canvas {
    max-width: 100%;
    height: 400px;
}

/* Estilos para la leyenda de KPIs */
.kpi-legend {
    text-align: center;
    margin-bottom: 10px;
}

.kpi-legend .btn-group button {
    margin: 0 5px;
}


/* Ajustes para pantallas más pequeñas */
@media (max-width: 768px) {
    .contenedor {
        flex-direction: column;
        gap: 10px; /* Reducir el espacio entre los elementos */
    }

    .tabla, .graficos {
        flex: 1 1 100%;
        padding: 15px; /* Reducir el padding en móviles */
        margin-bottom: 15px;
    }

    .filtros {
        flex-direction: column;
        gap: 15px; /* Añadir espacio entre los filtros */
    }

    .filtro, .filtro-ancho, .filtro-comunidad {
        max-width: 100%; /* Hacer que ocupen el 100% del ancho en móviles */
        flex: 1 1 100%;
        padding: 10px;
    }

    .filtro label {
        width: 100%;
    }

    .filtro select, .btn-group {
        width: 100%;
    }

    .btn-group button {
        width: calc(50% - 10px); /* Ajustar para que los botones ocupen el 50% del ancho */
        text-align: center;
    }
}

/* Ajustes adicionales para pantallas muy pequeñas (menos de 480px) */
@media (max-width: 480px) {
    .btn-group button {
        width: 100%; /* Los botones ocuparán el 100% del ancho */
        margin-bottom: 10px;
    }

    .btn-reset {
        width: 100%; /* Botón de reset ocupará todo el ancho */
        text-align: center;
    }
}

