Arduino Uno | Counter UP/Down

Hi Folks, i need a little guidance on how to create a countup / countdown timer for an arduino uno on a custom 7seg disp.

I have the below code which is not doing what it supposed to do. Any ideas ?

unsigned long timeLimit = 60000; //Count down time in milliseconds 1 minute
#define numberOfSeconds(_time_) ((_time_ / 1000) % 60)
#define numberOfMinutes(_time_) (((_time_ / 1000) / 60) % 60)

void countdown(){

          unsigned long timeRemaining = timeLimit - millis();
         
          while(timeRemaining > 0){
            int seconds = numberOfSeconds(timeRemaining);
            int minutes = numberOfMinutes(timeRemaining);
            int lminutes = minutes / 10;
            int rminutes = minutes % 10;
            int lseconds = seconds / 10;
            int rseconds = seconds % 10; 
            digitalWrite(latchpin, LOW);
            shiftOut(datapin, clockpin, MSBFIRST, segdisp[lminutes]); // Display hundreds tens
            shiftOut(datapin, clockpin, MSBFIRST, segdisp[rminutes]); // Display hundreds unit
            shiftOut(datapin, clockpin, MSBFIRST, segdisp[lseconds]); // Display seconds tens
            shiftOut(datapin, clockpin, MSBFIRST, segdisp[rseconds]); // Display seconds unit
            digitalWrite(latchpin, HIGH);
  
            timeRemaining = timeLimit - millis();
         }
}

I have the below code which is not doing what it supposed to do

What does it do ?

with the example i gave the code starts wierd instead of :59 it starts from 02:40 and it counts down normally and when the counter reaches 00:00 it turns into 59:59 and it counts probably to an inifite time.

I would like to know if millis() is a good idea to use with countdown, countup function and if so some ideas on what am i doing wrong.