/* web_app/static/css/exercise-timer-modal.css */
:root{
  --x-modal-bg:#fff;
  --x-radius:16px;
  --x-shadow:0 20px 60px rgba(0,0,0,.25);
}

.ex-timer-modal[aria-hidden="true"]{ display:none; }
.ex-timer-modal{
  position:fixed; inset:0; z-index:11000;
  display:grid; place-items:center;
}

.ex-timer-modal__backdrop{
  position:absolute; inset:0;
  background: rgba(17,24,39,.45);
}

.ex-timer-modal__dialog{
  position:relative; z-index:1;
  width:min(520px, calc(100vw - 28px));
  max-height: 90vh;
  overflow:auto;
  background: var(--x-modal-bg);
  border-radius: var(--x-radius);
  box-shadow: var(--x-shadow);
  padding: 16px 16px 14px;
}

.ex-timer-modal__header{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px; margin-bottom:10px;
}
.ex-timer-modal__title{ font-weight:800; font-size:18px; }
.ex-timer-modal__close{
  border:0; background:transparent;
  font-size:22px; line-height:1;
  opacity:.6; cursor:pointer;
}

/* LOCK MODE: нельзя закрыть, крестик скрыт */
.ex-timer-modal.is-locked .ex-timer-modal__close{ display:none; }
.ex-timer-modal.is-locked .ex-timer-modal__backdrop{ pointer-events:none; }

/* RUN MODE: скрываем +/- для reps в строках */
.ex-timer-modal.is-running .rep-btn{ display:none !important; }

.ex-timer-top{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:8px;
  width:100%;
}
.ex-timer-field{
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:12px;
  background:#fff;
  min-width:0;
}

.ex-timer-label{ font-size:12px; font-weight:800; opacity:.75; margin-bottom:8px; }
.ex-timer-hint{ font-size:12px; opacity:.6; margin-top:6px; }

.ex-timer-stepper{
  display:flex; align-items:center; justify-content:space-between;
  gap:8px;
}
.step-btn{
  width:40px; height:40px;
  border-radius:12px;
  border:1px solid #e5e7eb;
  background:#f8fafc;
  font-size:20px; font-weight:900;
  cursor:pointer;
}
.step-inp{
  flex:1;
  height:40px;
  border-radius:12px;
  border:1px solid #e5e7eb;
  text-align:center;
  font-weight:900;
  font-size:16px;
  outline:none;
  width:0px;
}

.ex-timer-list{
  margin-top:12px;
  border:1px solid #e5e7eb;
  border-radius:14px;
  overflow:hidden;
}

.ex-timer-row{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  background:#fff;
  border-top:1px dashed #e5e7eb;
}
.ex-timer-row:first-child{ border-top:0; }

.ex-timer-row.is-active{
  outline:2px solid rgba(46,125,50,.25);
  background:#8def9f;
}
.ex-timer-row.is-done{ opacity:.65; }

.ex-timer-row .idx{
  font-weight:900;
  width:26px;
  text-align:center;
}

/* reps stepper внутри строки */
.rep-stepper{
  display:flex;
  align-items:center;
  gap:8px;
}
.rep-btn{
  width:38px; height:38px;
  border-radius:12px;
  border:1px solid #e5e7eb;
  background:#f8fafc;
  font-size:18px; font-weight:900;
  cursor:pointer;
  line-height:1;
}
.ex-timer-row input.rep-inp{
  width:86px;
  height:38px;
  border-radius:12px;
  border:1px solid #e5e7eb;
  text-align:center;
  font-weight:900;
  font-size:16px;
}

.ex-timer-row .timer{
  font-variant-numeric: tabular-nums;
  font-weight:900;
  opacity:.8;
  min-width:80px;
  text-align:center;
}

.ex-timer-actions{
  display:flex; gap:10px; justify-content:center;
  margin-top:12px;
}

.x-btn{
  border:0;
  border-radius:12px;
  padding:12px 16px;
  font-weight:800;
  font-size:14px;
  cursor:pointer;
}
.x-btn--primary{ background:#22c55e; color:#fff; }
.x-btn--ghost{ background:#f1f5f9; color:#374151; }
.x-btn--danger{ background:#fee2e2; color:#991b1b; }

.x-btn:disabled{ opacity:.5; cursor:not-allowed; }

/* dark */
.dark .ex-timer-modal__dialog{ background:#0f1113; color:#e7efe7; }
.dark .ex-timer-field,
.dark .ex-timer-list,
.dark .ex-timer-row{ background:#0f1113; border-color:#2a2d31; }
.dark .step-inp,
.dark .ex-timer-row input.rep-inp{ background:#0f1113; color:#e7efe7; border-color:#2a2d31; }
.dark .step-btn,
.dark .rep-btn{ background:#14181b; color:#e7efe7; border-color:#2a2d31; }
.dark .x-btn--ghost{ background:#14181b; color:#e7efe7; }