
/* ========================================
   WORKOUT SCREEN
   ======================================== */
/* --- Progress Bar --- */
.pwrap{
  display: flex;
  align-items: center;
  gap: 10px;
}

.plabel{
  flex: 0 0 auto;
  margin-left: auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-dark);
  border: 1px solid var(--stroke-2);
  color: var(--ink-soft);
  font-weight: 900;
  letter-spacing: .02em;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

#progressWrap{
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 12px 14px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--p-dragonfly) 75%, transparent);
  border: 1px solid var(--stroke-1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 
    var(--shadow-md),
    0 0 0 1px rgba(255, 255, 255, .04) inset;
}

#progressBar{
  height: 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .25);
  border: 1px solid rgba(255, 255, 255, .08);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15) inset;
}

/* segmented mode - tick marks */
#progressBar.pbar{
  display: flex;
  gap: 4px; /* Tighter gap so marks are closer */
  align-items: center;
  height: 16px; /* Taller for more visibility */
  border-radius: 999px;
  background: transparent;
  border: 0;
  overflow: visible;
  padding: 0 2px; /* Small padding on sides */
}

#progressBar.pbar .pstep{
  flex: 1;
  height: 16px;
  border-radius: 4px; /* Less rounded for tick mark look */
  background: rgba(255, 255, 255, .12); /* Lighter base color */
  border: 1px solid rgba(255, 255, 255, .15);
  transition: all .2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
}

#progressBar.pbar .pstep.done{
  background: var(--p-capri);
  border-color: color-mix(in srgb, var(--p-capri) 80%, #fff 20%);
  box-shadow: 
    0 0 12px color-mix(in srgb, var(--p-capri) 40%, transparent),
    0 2px 0 rgba(255, 255, 255, .25) inset,
    0 2px 6px rgba(0, 0, 0, .3);
}

#progressBar.pbar .pstep.current{
  background: var(--p-blazing-yellow);
  border-color: color-mix(in srgb, var(--p-blazing-yellow) 80%, #fff 20%);
  transform: scaleY(1.3) scaleX(1.1);
  box-shadow: 
    0 0 16px color-mix(in srgb, var(--p-blazing-yellow) 50%, transparent),
    0 2px 0 rgba(255, 255, 255, .3) inset,
    0 4px 8px rgba(0, 0, 0, .35);
  z-index: 1;
}

/* Optional: pulse animation on current */
#progressBar.pbar .pstep.current{
  animation: tickPulse 1.5s ease-in-out infinite;
}

@keyframes tickPulse{
  0%, 100%{ 
    box-shadow: 
      0 0 16px color-mix(in srgb, var(--p-blazing-yellow) 50%, transparent),
      0 2px 0 rgba(255, 255, 255, .3) inset,
      0 4px 8px rgba(0, 0, 0, .35);
  }
  50%{ 
    box-shadow: 
      0 0 24px color-mix(in srgb, var(--p-blazing-yellow) 70%, transparent),
      0 2px 0 rgba(255, 255, 255, .35) inset,
      0 4px 8px rgba(0, 0, 0, .35);
  }
}

/* --- Elapsed Time --- */

.elapsed{
  text-align: left;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: .06em;
  opacity: .9;
  margin-top: -6px;
}

/* --- Move Title + Description --- */

.move-title,
#move-title{
  text-align: center;
  font-size: clamp(22px, 6vw, 34px);
  text-shadow: 0 10px 22px rgba(0, 0, 0, .35);
  letter-spacing: .15em;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.move-title::after{
  content: "ⓘ";
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:1.2em;
  height:1.2em;
  margin-left:.35em;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.25);
  font-size:.55em;
  opacity:.65;
  vertical-align: middle;
}

.move-title[aria-expanded="true"]::after{ opacity: .8; }

.move-description{
  text-align: center;
  max-width: 480px;
  margin: 10px auto 0;
  padding: 12px 16px;

  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink-soft);

  background: var(--glass-1);
  border: 1px solid var(--stroke-1);
  border-radius: 12px;
}

.move-description[hidden]{ display:none; }

.move-title[aria-expanded="true"] + .move-description{
  animation: descFadeIn .2s ease-out;
}

@keyframes descFadeIn{
  from{ opacity:0; transform: translateY(-8px); }
  to{ opacity:1; transform: translateY(0); }
}

/* --- Timer --- */

.timer,
#timer{
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(64px, 18vw, 120px);
  font-weight: 950;
  letter-spacing: .02em;
  text-shadow: 0 18px 36px rgba(0, 0, 0, .45);
}

/* --- Next Move Label --- */

.next,
#next{
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

#next{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 8px 12px;
  margin-top: 10px;
  border-radius: 999px;

  background: var(--surface-dark);
  border: 1px solid var(--stroke-2);
  color: var(--ink-soft);
  font-weight: 800;
}

/* Add this to your workout screen CSS */

.next-description {
  margin: 12px auto 0;
  padding: 12px 16px;
  max-width: 400px;
  
  background: var(--surface-dark);
  border: 1px solid var(--stroke-3);
  border-radius: 14px;
  
  font-size: 13px;
  font-weight: 600;
  font-style: italic;
  color: var(--ink-mute);
  line-height: 1.4;
  text-align: center;
  
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .3s ease, transform .3s ease;
}

.next-description:not(:empty) {
  opacity: 1;
  transform: translateY(0);
}

/* --- Push-ups Stats --- */

#pushupsStats{
  display: flex;
  width: min(520px, calc(100% - 28px));
  margin: 14px auto 0;
  gap: 12px;
  justify-content: center;
  align-items: stretch;

  padding: 10px;
  border-radius: var(--r18);

  background: var(--surface-dark);
  border: 1px solid var(--stroke-1);
  backdrop-filter: blur(10px);

  box-shadow:
    0 10px 30px rgba(0, 0, 0, .22),
    inset 0 1px 0 rgba(255, 255, 255, .06);

  animation: pushupsStatsIn .18s ease-out;
}

#pushupsStats[style*="display:none"],
#pushupsStats[style*="display: none"]{
  display: none !important;
  animation: none;
}

@keyframes pushupsStatsIn{
  from{ opacity: 0; transform: translateY(6px); }
  to{ opacity: 1; transform: translateY(0); }
}

.pushups-stats__item{
  flex: 1 1 0;
  min-width: 0;

  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;

  padding: 10px 12px;
  border-radius: 14px;

  background: var(--glass-1);
  border: 1px solid var(--stroke-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.pushups-stats__label{
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  white-space: nowrap;
}

#pushupsLast,
#pushupsBest{
  font-size: 20px;
  font-weight: 1000;
  letter-spacing: .02em;
  color: var(--text);
  text-shadow: 0 8px 18px rgba(0, 0, 0, .35);
}

@media (max-width: 420px){
  #pushupsStats{ flex-direction: column; }
}

/* --- Session Controls (final version) --- */

.session-controls{
  margin-top: auto;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--r20);
  background: color-mix(in srgb, var(--p-dragonfly) 45%, transparent);
  border: 1px solid var(--stroke-1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, .2);
}

.ctrl{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.ctrl-label{
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1;

  color: var(--text);
  opacity: .70;

  pointer-events: none;
  user-select: none;
}

.ctrl-btn{
  width: 60px;
  height: 60px;
  border-radius: 999px;
  border: 1px solid var(--stroke-1);
  background: var(--glass-1);

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;

  cursor: pointer;
  transition: background .15s ease, transform .1s ease;
  padding: 10px 0;
}

.ctrl-btn:hover{ background: var(--glass-2); }
.ctrl-btn:active{ transform: scale(.95); }

.ctrl-btn:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .12);
}

.ctrl-ico{
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}

.ctrl-btn svg{
  width: 24px;
  height: 24px;
  fill: var(--text);
}

.ctrl-btn svg.hidden{ display: none !important; }

.ctrl-txt{
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .02em;
  line-height: 1;
  color: var(--text);
  opacity: .7;
  user-select: none;
  pointer-events: none;
}

/* Paused state */
body.paused .timer,
body.paused #timer{ opacity: .85; }
