:root{
    --color-1: #fff;
    --color-2: #222;
    --color-3: orange;
}
*,
*::before,
*::after {
    box-sizing: border-box;
}
html, body {
  height: 100%;
  margin: 0;
}
html {
    scroll-behavior: smooth;
}
body {
    padding: 0;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--color-2);
    color: var(--color-1);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header{
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logoApp{
  width: 50%;
  max-width: 220px;
  margin-top: 50px;
}

main{
    flex: 1;
}
h1{
    text-align: center;
    margin: 10px 0;

}
h2{
    width: 100%;
    text-align: center;
    margin-top: 50px;
}
h3{
    width: 100%;
    text-align: center;
    margin-top: 50px;
}

#tuNombre{
  display: flex;
  flex-direction: column;
  align-items: center;
}
#nombreUserCheck{
  display: flex;
}
#tuNombre input{
  height: 40px;
  background-color: #444;
  border: solid orange 2px;
  border-radius: 15px;
  color: white;
  text-align: center;
  font-size: 1.2rem;
}
#tuNombre input:focus{
  outline: none;
}
#saludoUser {
    display: none;
}

#nroDeRutinas{
  display: flex;
  flex-direction: column;
  align-items: center;
}
#cuantasRutinas{
  display: flex ;
  align-items: center;
  width: 50%;
  height: 55px;
  border: solid orange 2px;
  border-radius: 15px;
  background-color: #444;
  color: #fff;
}


#cuantasRutinas p{
  width: 100%;
  font-size: 1rem;
  margin: 5px 0 0 0;
}
#cuantasRutinas img{
  margin: 0 3px 0 0;
}

#dropdownRutinas{
  background-color: #444;
  width: 50%;
  margin-top: 5px;
  text-align: center;
  border-radius: 15px;
  padding: 10px 0;

  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition:
      max-height 0.3s ease,
      opacity 0.2s ease,
      transform 0.2s ease;
}

#dropdownRutinas hr{
  width: 70%;
}

#dropdownRutinas.show {
    max-height: 400px;
    opacity: 1;
    transform: translateY(0);
}
#cuantasRutinas img{
    height: 20px;
    transition: transform 0.25s ease;
}

#cuantasRutinas.active img{
    transform: rotate(180deg);
}


.nroRutinas{
  margin: 3px 0;
}


#botonInicial{
  display: flex;
  flex-direction: row;
  justify-content: left;
  align-items: center;
}
#textoInicial{
  color: rgb(1, 204, 1);
  opacity: 0;
  transform: translate(-30px);
  animation: slideInTexto 0.6s ease-out 2s forwards;
}

@keyframes slideInTexto {
    to {
        opacity: 1;
        transform: translate(0, 0);
    }
}

.nuevoEjercicio{
  position: relative;
  left: 10px;
  margin-top: 10px;
  margin-bottom: 10px;
  margin-right: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 35px;
  height: 35px;
  border-radius: 20px;
  background-color: rgb(1, 204, 1);
  color: white;

    border: none;
    outline: none;
}
.nuevoEjercicio p{
  font-size: 1.5rem;
}



#tituloRutinas,
#rutinas,
#btnModificarRutinas {
    display: none;
}

#rutinas{
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px;
}

#rutinas a{
    text-decoration: none;
}


.rutinaPersonal {
    background-color: orange;
    color: rgb(0, 0, 0);
    padding: 10px;
    text-align: center;
    border-radius: 10px;
}
#modRutinas{
  width: 100%;
  height: auto;
  display: flex;
  justify-content: center;
}
#btnModificarRutinas{
  width: 50%;
  background-color: #444;
  height: 40px;
  border-radius: 15px;
  margin: 20px 0;

  border: none;   
  outline: none;      
  appearance: none;     
  -webkit-appearance: none; 
}

footer{
    color: gray;
    padding: 10px;
}


#botonMenuRutinas{
  position: fixed;
  top: 10px;
  right: 10px;
  background-color: rgba(110, 110, 110, 0.7);
  color: white;
  height: 40px;
  width: 80px;
  padding: 5px;
  border-radius: 20px;
  border: solid 1px orange;

  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1;

  cursor: pointer;
  overflow: hidden;

}



#menuRutinas{
  position: fixed;
  display: flex;
  flex-direction: column;
  text-align: right;
  top: 60px;
  right: -300px;
  width: 300px;
  background: rgba(110,110,110,0.9);
  border-radius: 10px 0 0 10px;
  padding: 10px;
  color: white;

  transition: right 0.3s ease;
}

.itemRutina.activa{
  background:#444;
  border-left:4px solid orange;
  border-radius: 10px 0 0 10px;
  font-weight:bold;
  padding-right: 5px;
}

#menuRutinas.abierto{
  right: 0px;
}


#botonMenuRutinasTexto,
#botonMenuRutinasFlecha{
  position: absolute;
  transition: all 0.25s ease;
}

#botonMenuRutinasTexto{
  display: flex;
  flex-direction: row;
  align-items: center;
  opacity: 1;
  transform: translateX(0);
}
#botonMenuRutinasTexto img{
  height: 30px;
  border-radius: 50%;
  margin-left: 5px;
  rotate: 45deg;
}

#botonMenuRutinasFlecha{
  height: 20px;
  opacity: 0;
  transform: translateX(10px);
}

#botonMenuRutinas.abierto #botonMenuRutinasTexto{
  opacity: 0;
  transform: translateX(-10px);
}

#botonMenuRutinas.abierto #botonMenuRutinasFlecha{
  opacity: 1;
  transform: translateX(0);
}

#botonMenuRutinas,
.itemRutina,
.textoRutina {
  -webkit-user-select: none;    
  user-select: none;            
  -webkit-touch-callout: none;   
}

.itemRutina,
#botonMenuRutinas {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent; 
  touch-action: manipulation;
}

.itemRutina * {
  pointer-events: none;
}

.itemRutina:active,
#botonMenuRutinas:active {
  transform: scale(0.97);
}


.rutinaActiva {
  background: #444;
  border-right: 4px solid orange;
  border-radius: 10px 0 0 10px;
  font-weight: bold;
}


#headerRutina {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
}

#tituloRutina {
  color: orange;
  margin: 0;
}

#tipoRutina {
  display: inline;
  text-align: center;
  padding: 4px 0;
  font-size: 16px;
  border-bottom: 1px dashed rgba(255,255,255,0.3);
  outline: none;
  min-height: 20px;
  color: #ccc;
}

#tipoRutina.placeholder {
  color: #888;
  font-style: italic;
}

#titCol{
    display: none;
    grid-template-columns: 0.7fr 4.2fr 3.8fr 0.8fr 0.5fr;
    align-items: center;
    padding: 6px 0;
    text-align: center;
    font-weight: bold;
}
#titCol.mostrar{
  display: grid;
}
#colName{
    text-align: left;
    padding-left: 10px;
}
.colDrag{
  text-align: center;
}

#reinicioYdescanso{
  display: none;
  flex-direction: row;
  justify-content: space-between;
  padding: 10px;
}
#reinicioYdescanso.mostrar {
  display: flex;
  flex-direction: row;
}

#btnResetRoutine{
  background-color: rgb(255, 0, 0);
  height: 35px;
  width: 130px;
  gap: 5px;
  display: flex;
  justify-content: center;
  text-align: center;
  flex-direction: row;
  border-radius: 20px;
  border: none;
  outline: none;

}
#btnResetRoutine p{
  font-weight: bold;
  color: white;
  margin: 0;
  display: flex;
  align-items: center;
}

#btnIniciarCronometro{
  background-color: orange;
  height: 35px;
  width: 130px;
  gap: 5px;
  display: flex;
  justify-content: center;
  text-align: center;
  flex-direction: row;
  border-radius: 20px;
  border: none;
  outline: none;

}
#btnIniciarCronometro p{
  font-weight: bold;
  margin: 0;
  display: flex;
  align-items: center;
}

#btnIniciarCronometro img{
  display: block;
  height: 25px;
  width: auto;
  margin: 0;
  transform: translateY(3px);
}

#addExercise,
#addExercise * {
  box-sizing: border-box;
}
#addExercise {
  display: grid;

  grid-template-columns: 1fr 1fr 1fr 1fr;
  grid-template-rows: auto auto;

  gap: 6px;
  margin: 12px 2px;
}

#crearNombre {
  grid-column: 1 / 3;
  grid-row: 1;
}
#newName {
  grid-column: 1 / 3;
  grid-row: 1;
}

#crearRepeticiones {
  grid-column: 3 / 5;
  grid-row: 1;
}
#newReps {
  grid-column: 3 / 5;
  grid-row: 1;
}

#crearDescanso {
  grid-column: 1 / 3;
  grid-row: 2;
}
#newRest {
  grid-column: 1 / 3;
  grid-row: 2;
}

#btnAdd {
  grid-column: 4 / 5;
  grid-row: 2;
}

#btnCancelAdd {
  grid-column: 3 / 4;
  grid-row: 2;
}

#addExercise button {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

#addExercise input,
#addExercise textarea {
  width: 100%;
  min-width: 0;
  border-radius: 10px;
}

#addExercise.hidden {
  display: none;
}

#addExercise input,
#addExercise textarea,
#addExercise button {
  padding: 8px;
  font-size: 14px;
}

.hidden {
  display: none;
}

#btnAdd,
#btnCancelAdd {
  display: flex;
  align-items: center;
  justify-content: center;
}

#btnAdd img,
#btnCancelAdd img {
  width: 40px;
  height: 40px;
}


.ejercicio {
    display: grid;
    grid-template-columns: 0.7fr 4.3fr 3.4fr 0.8fr 0.8fr;
    align-items: center;
    padding: 6px 0;
    border-radius: 8px;
    transition: opacity 0.3s ease;
    text-align: left;
    user-select: none;
    white-space: pre-line;
    -webkit-user-select: none;      
    -webkit-touch-callout: none;   
}
.reps {
    display: block;
    width: 100%;
    text-align: center;
    white-space: pre-line;
    word-break: break-word;
    min-width: 0;
}

.form-check {
    display: flex;
    justify-content: center;
}
.nameExer {
    padding: 6px 10px;
    border-radius: 6px;
    transition: background-color 0.2s ease, transform 0.2s ease;

}
.ejercicio.active .nameExer {
    background-color: orange;
    color: black;
    transform: scale(1.05);
}
.ejercicio.disabled {
    opacity: 0.5;
}
.ejercicio.disabled .nameExer,
.ejercicio.disabled .reps {
    color: #adb5bd;
}
.ejercicio.disabled .nameExer {
    pointer-events: none;
}


#exerciseActions {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 999;
}

#exerciseActions.hidden {
  display: none;
}

#exerciseActions .sheet {
  background: rgb(113, 113, 113, 0.8);
  width: 90%;
  border-radius: 16px 16px 0 0;
  padding: 16px;
  display: flex;

  flex-direction: column;
  gap: 12px;
}

#exerciseActions button {
  padding: 12px;
  font-size: 16px;
  border-radius: 15px;
}

#exerciseActions .danger {
  background: #c62828;
  color: #fff;
}

#editModal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#editModal.hidden {
  display: none;
}

#editModal .modal {
  background: #222;
  padding: 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#editModal input {
  width: 80%;
  padding: 10px;
  font-size: 16px;
}
#editModal textarea {
  width: 80%;
  padding: 10px;
  font-size: 16px;
  border-radius: 12px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.danger {
  background: #b33;
  color: #fff;
}
.ok {
  background: #2c7004;
  color: #fff;
}



.colDrag {
  touch-action: none;
  user-select: none;
  cursor: grab;
  font-size: 20px;
  opacity: 0.6;
}

.colDrag:active {
  cursor: grabbing;
  opacity: 0.6;
}
.ejercicio.dragging {
  opacity: 0.7;
  transform: scale(1.02);
  z-index: 10;
}
.ejercicio.placeholder {
  border: 2px dashed orange;
}


#arrowBack img{
    width: 50px;
    height: auto;
    position: fixed;
    bottom: 10px;
    right: 10px;
}


.relojIco img{
    height: 30px;
    width: auto;
}
#contenedorDescanso{
    position: fixed;
    top: 10px;
    left: 5%;
    width: 90%;
    border-radius: 20px;
    background-color: rgb(34, 34, 34, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: solid 2px orange;
    padding: 10px;
    display: flex ;
    flex-direction: column;
    align-items: center;

    transform: translateY(-150%);
    opacity: 0;

    transition: transform 0.4s ease, opacity 0.3s ease;
}
#contenedorDescanso.activo,
#contenedorCrono.activo {
    transform: translateY(0);
    opacity: 1;
}
#cancelarDescanso,
#cancelarCrono {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 1.2rem;
    color: white;
    cursor: pointer;
    user-select: none;
    background:#333;
    border-radius:50%;
    width:35px;
    height:35px;
    display:flex;
    align-items:center;
    justify-content:center;
}
#cancelarDescanso:active,
#cancelarCrono:active {
    transform: scale(0.9);
}
#tituloDescanso,
#crono {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
}
#tituloDescanso p,
#crono p {
    font-size: 1.5rem;
    margin: 10px 0 5px 0;
    color: orange;
}
#countD{
    font-family: "Anta", sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 4rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}
#countD p{
    margin: 0;
}
.sep{
    margin: 0 8px;
}
.displayReloj{
    width: 2ch;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
#tiempoFinalizado{
    display: none;
    font-family: "Anta", sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 3rem;
    text-align: center;
    color: rgb(26, 247, 26);
}
.timer-alerta{
    animation: pulso 1s infinite;
}
@keyframes pulso{
    0%{
        transform:scale(1);
        color: white;
    }
    50%{
        transform:scale(1.08);
        color: red;
    }
    100%{
        transform:scale(1);
        color: white;
    }
}
#agregarTiempo{
    margin-top:10px;
    padding:5px;
    border-radius:10px;
    background:#333;
    color:white;
    cursor:pointer;
    user-select:none;
}
#agregarTiempo:active{
    transform:scale(0.95);
}


#contenedorCrono{
    position: fixed;
    bottom: 20px;
    left: 5%;
    width: 90%;
    border-radius: 20px;
    background-color: rgb(34, 34, 34, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: solid 2px orange;
    padding: 10px;
    display: flex ;
    flex-direction: column;
    align-items: center;


    transform: translateY(150%);
    opacity: 0;

    transition: transform 0.4s ease, opacity 0.3s ease;

  }


#grupoBotones{
    width: 100%;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-around;
    font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
}
#btnIniciar{
    width: 40%;
    height: 40px;
    background-color: rgb(0, 132, 255);
    color: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
#btnIniciar.active{
    background-color: rgb(88, 172, 250);
}
#btnRestablecer{
    width: 40%;
    height: 40px;
    background-color: rgb(87, 87, 87);
    color: white;
    border-radius: 20px;
    display: none;
    align-items: center;
    justify-content: center;
}
#btnRestablecer.active {
    background-color: rgb(153, 153, 153);

}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #1f1f1f;
  color: #fff;
  padding: 20px;
  width: 90%;
  max-width: 360px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  text-align: center;
  animation: scaleIn .2s ease;
}
.modal h3{
  color: orange;
}
.modal-content h3 {
  margin-bottom: 8px;
}

.modal-content p {
  font-size: 14px;
  opacity: 0.8;
}
#editModal .modal input{
  border-radius: 12px;
}
.editLabel{
  margin: 0;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.modal-actions button {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.btn-secondary {
  background: #444;
  color: #fff;
}

.btn-danger {
  background: #ff4d4d;
  color: #fff;
}

@keyframes scaleIn {
  from {
    transform: scale(.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.hidden {
  display: none;
}



#installApp {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 18px;
    background: #505050;
    color: #000000;
    border: none;
    border-radius: 8px;
    font-size: 16px;
}
#installApp.show {
    display: flex;
}

@media (min-width: 992px) {
    #installApp {
        display: none !important;
    }
}