/* Contenedor principal */
.custom-tooltip-map {
    padding: 10px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.1);
    min-width: 150px;
    max-width: 250px; /* Ayuda a la responsividad */
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Título (Nombre del estado/país) */
.tooltip-header {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

/* Fila de datos */
.tooltip-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

/* El círculo de color */
.tooltip-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.tooltip-label {
    color: #666;
    flex-grow: 1;
}

.tooltip-value {
    font-weight: 600;
    color: #222;
}

/* Línea divisoria y contenedor del total */
.infoTotal {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #ddd; 
    display: flex;
    justify-content: space-between; 
    align-items: center;
}

.total-label {
    color: green;
    font-size: 12px;
    letter-spacing: 0.5px;
    font-weight: bold;
}

.total-value {
    color: #000;
    font-size: 12px;
    margin-left: 5px;
}

/* Contenedor del loading de Highcharts */
.highcharts-loading {
    opacity: 1 !important; 
    background: rgba(255, 255, 255, 0.8) !important;
}

.custom-spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* El círculo que gira */
.custom-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(4, 179, 187, 0.2); 
    border-top: 4px solid #04b3bb; 
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


.custom-tooltip-map {
    /* Permitimos que el ancho sea dinámico según el contenido */
    min-width: 180px;
    max-width: 350px; /* Evita que se haga gigante en pantallas grandes */
    width: auto !important; 
    
    padding: 12px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    
    /* IMPORTANTE: Evita que el contenido desborde visualmente */
    overflow: hidden; 
    display: block;
}

.tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Cambiamos center por flex-start por si hay varias líneas */
    gap: 15px;
    width: 100%;
    margin-bottom: 5px;
}

.tooltip-value {
    font-weight: 700;
    color: #222;
    text-align: right;
    /* Si el texto es MUY largo, esto lo obliga a quedarse dentro */
    word-break: break-word; 
    flex-shrink: 1; /* Permite que el valor se encoja si es necesario */
}

.tooltip-label {
    color: #666;
    flex-shrink: 0; /* Evita que la etiqueta se comprima */
    white-space: nowrap; /* Mantiene la etiqueta en una sola línea */
}

.custom-tooltip-map {
    max-height: 300px; /* Ajusta este valor según prefieras */
    overflow-y: auto;
    min-width: 200px;
    background: #fff;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    pointer-events: auto !important; /* IMPORTANTE para poder hacer scroll */
}

/* Personalización del scrollbar para que combine con #04b3bb */
.custom-tooltip-map::-webkit-scrollbar {
    width: 6px;
}

.custom-tooltip-map::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.custom-tooltip-map::-webkit-scrollbar-thumb {
    background: #04b3bb;
    border-radius: 10px;
}

.custom-tooltip-map::-webkit-scrollbar-thumb:hover {
    background: #039197;
}




/* Solo aplicamos esto cuando está dentro del acordeón */
#accordionTooltip .custom-tooltip-map {
    display: grid !important;
    /* CAMBIO CLAVE: auto-fit en lugar de auto-fill */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px 30px; 
    width: 100% !important;
    max-width: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 15px 0 !important;
}

/* Ajuste para que cada fila de datos se vea bien en la rejilla */
#accordionTooltip .tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding: 8px 5px;
    max-width: 100%; 
}

/* Estilo para la sección del Total dentro del acordeón */
#accordionTooltip .total {
    grid-column: 1 / -1; 
    margin-top: 20px;
    padding: 15px;
    background: #fdfdfd;
    border: 1px solid #eee;
    /*border-left: 5px solid #04b3bb;*/
    text-align: center;
    font-size: 1.1em;
    font-weight: bold;
    color: #007279;
}

/* Quitamos el HR que viene del HTML si queremos algo más limpio */
#accordionTooltip hr {
    display: none;
}

#accordionTooltip .ui-accordion-content {
    background-color: #ffffff;
    border: 1px solid #D0D3D4;
    padding: 20px !important;
}

#accordionTooltip .tooltip-label{
	font-size: 14px;
	flex-grow: 0;
}