/* ============ WARM UP BUTTON ============ */
.warmup-start-btn {
  width: 100%;
  padding: 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.3);
  transition: transform 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.warmup-start-btn:active {
  transform: scale(0.97);
}

.warmup-start-icon {
  font-size: 36px;
}

.warmup-start-text {
  font-size: 20px;
  font-weight: 600;
}

.warmup-start-sub {
  font-size: 13px;
  opacity: 0.85;
  font-weight: 500;
}

/* ============ WIZARD ============ */
.wizard-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0 12px;
}

.wizard-cancel-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--gray-200);
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.wizard-timer {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
}

.wizard-step-counter {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--gray-200);
  padding: 4px 12px;
  border-radius: 20px;
}

.wizard-progress {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  margin-bottom: 20px;
  overflow: hidden;
}

.wizard-progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.wizard-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 16px;
  min-height: 200px;
}

.wizard-exercise-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.wizard-exercise-icon {
  font-size: 44px;
}

.wizard-exercise-name {
  font-size: 18px;
  font-weight: 700;
}

.wizard-exercise-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.wizard-done-badge {
  background: #FEF2F2;
  color: #991B1B;
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  margin-bottom: 16px;
}

body.dark-mode .wizard-done-badge {
  background: rgba(239, 68, 68, 0.2);
  color: #EF4444;
}

.wizard-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wizard-field {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wizard-field label {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 0;
}

.wizard-field input {
  width: 100px;
  padding: 12px;
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  background: var(--gray-100);
  color: var(--text);
  transition: border-color 0.2s;
}

.wizard-field input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--card-bg);
}

/* Wizard Navigation */
.wizard-nav {
  display: grid;
  grid-template-columns: 1fr 1fr 48px 1fr;
  gap: 8px;
  padding-bottom: 8px;
}

.wizard-nav-btn {
  padding: 14px 8px;
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.wizard-nav-btn:active {
  transform: scale(0.95);
}

.wizard-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.wizard-back {
  background: var(--gray-200);
  color: var(--text);
}

.wizard-rest {
  background: #FEF9C3;
  color: #92400e;
}

body.dark-mode .wizard-rest {
  background: rgba(255, 215, 0, 0.15);
  color: #FFD700;
}

.wizard-again {
  background: var(--gray-200);
  color: var(--text-secondary);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wizard-next {
  background: var(--primary);
  color: white;
}

.wizard-finish {
  background: linear-gradient(135deg, #DC2626, #991B1B) !important;
}

/* ============ ACTIVE WORKOUT ============ */
.workout-banner {
  background: linear-gradient(135deg, #DC2626, #991B1B);
  border-radius: 20px;
  padding: 20px;
  color: white;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.3);
}

.workout-banner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.workout-banner-name {
  font-size: 18px;
  font-weight: 700;
}

.workout-banner-timer {
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.workout-banner-meta {
  display: flex;
  gap: 16px;
  font-size: 14px;
  opacity: 0.9;
}

/* Exercise Card */
.exercise-card {
  background: var(--card-bg);
  border-radius: 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.exercise-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
}

.exercise-card-name {
  font-weight: 600;
  font-size: 15px;
}

.exercise-timer {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(220, 38, 38, 0.1);
  color: var(--primary);
}

.exercise-timer.done {
  background: rgba(0, 176, 80, 0.1);
  color: #00B050;
}

.exercise-timer.active {
  animation: timerPulse 1.5s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Gamification: set completion burst */
@keyframes setBurst {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 176, 80, 0.5); }
  50% { transform: scale(1.3); box-shadow: 0 0 0 12px rgba(0, 176, 80, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 176, 80, 0); }
}
.set-check.burst { animation: setBurst 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* Fire speed badge */
@keyframes fireFloat {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-24px) scale(1.5); }
}
.speed-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 16px;
  pointer-events: none;
  animation: fireFloat 0.8s ease-out forwards;
}

/* Exercise completion flash */
@keyframes exerciseDone {
  0% { background: var(--card-bg); }
  30% { background: rgba(0, 176, 80, 0.12); box-shadow: 0 0 20px rgba(0, 176, 80, 0.2); }
  100% { background: var(--card-bg); box-shadow: none; }
}
.exercise-card.completed-anim { animation: exerciseDone 1s ease-out; }

/* Confetti pieces */
@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(80px) rotate(360deg); opacity: 0; }
}
.confetti-piece {
  width: 6px;
  height: 6px;
  position: absolute;
  border-radius: 2px;
  pointer-events: none;
  animation: confettiFall 1s ease-out forwards;
}

/* Progressive overload arrows */
.overload-arrow {
  font-size: 11px;
  margin-left: 4px;
  font-weight: 700;
  vertical-align: middle;
}
.overload-arrow.up { color: var(--success); }
.overload-arrow.down { color: var(--danger); }
.overload-arrow.same { color: var(--gray-300); }

.overload-hint {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 1px;
}
.overload-hint.suggest {
  color: #0f9d58;
  font-weight: 500;
}
.overload-hint.suggest b {
  color: #d97706;
}

/* Set row needs position relative for speed badge */
.set-row { position: relative; }

.exercise-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.exercise-card-delete {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--danger);
  font-size: 16px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.exercise-card-delete:hover {
  opacity: 1;
}

/* Sets Table */
.sets-table {
  padding: 0 16px 14px;
}

.sets-header {
  display: grid;
  grid-template-columns: 40px 1fr 1fr 44px;
  gap: 8px;
  padding: 6px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 6px;
}

.set-row {
  display: grid;
  grid-template-columns: 40px 1fr 1fr 44px;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
}

.set-row.completed {
  opacity: 0.6;
}

.set-number {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
}

.set-input {
  width: 100%;
  padding: 8px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  background: var(--gray-100);
  color: var(--text);
}

.set-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--card-bg);
}

.set-check {
  width: 36px;
  height: 36px;
  border: 2px solid var(--gray-300);
  background: transparent;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: var(--text-secondary);
}

.set-check.done {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.add-set-btn {
  width: 100%;
  padding: 8px;
  border: 2px dashed var(--gray-300);
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  margin-top: 4px;
}

.add-set-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Add Exercise & Finish */
.add-exercise-btn {
  width: 100%;
  padding: 16px;
  border: 2px dashed var(--gray-300);
  background: transparent;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  margin-bottom: 12px;
}

.add-exercise-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* Body Weight Card */
.body-weight-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin-bottom: 12px;
}
body.dark-mode .body-weight-card {
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.body-weight-label { font-size: 14px; font-weight: 600; flex: 1; }
.body-weight-input-wrap { display: flex; align-items: center; gap: 6px; }
.body-weight-input-wrap input {
  width: 70px;
  padding: 8px 10px;
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  background: var(--bg);
  color: var(--text);
}
.body-weight-input-wrap input:focus { outline: none; border-color: var(--primary); }
.body-weight-unit { font-size: 14px; color: var(--text-secondary); font-weight: 500; }

/* Workout Notes */
.workout-notes-card {
  margin-bottom: 12px;
}
.workout-notes-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--text);
  resize: vertical;
  min-height: 48px;
}
.workout-notes-input:focus { outline: none; border-color: var(--primary); }

.finish-btn {
  width: 100%;
  padding: 16px;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 16px;
}

/* Exercise Picker */
.exercise-picker-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 4px;
}

.exercise-picker-item:hover {
  background: var(--gray-100);
}

.exercise-picker-name {
  font-weight: 500;
}

/* Rest Timer — inline below workout banner */
.rest-timer-overlay {
  display: none;
  align-items: center;
  gap: 10px;
  background: rgba(220,38,38,0.12);
  border: 1px solid rgba(220,38,38,0.35);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.rest-timer-overlay.show {
  display: flex;
}

.rest-timer-circle {
  display: none; /* hidden in compact mode */
}

.rest-timer-label {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  margin: 0;
}

.rest-timer-time {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  min-width: 42px;
  text-align: center;
}

.rest-timer-buttons {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.rest-timer-btn {
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent;
  color: white;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.rest-timer-skip {
  background: var(--primary);
  border-color: var(--primary);
}

/* Workout Summary */
.summary-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.summary-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.summary-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.summary-stat {
  text-align: center;
}

.summary-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.summary-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Recent Workouts */
.recent-workout {
  display: flex;
  align-items: center;
  padding: 14px;
  background: var(--card-bg);
  border-radius: 12px;
  margin-bottom: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  gap: 12px;
}

.recent-workout-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--primary-light);
}

.recent-workout-info {
  flex: 1;
}

.recent-workout-name {
  font-weight: 600;
  font-size: 14px;
}

.recent-workout-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.recent-workout-duration {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ============ TODAY'S PLAN ============ */
.today-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: 16px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #DC2626, #991B1B);
  color: white;
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.3);
}

.today-header.recovery {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.today-header-icon {
  font-size: 36px;
}

.today-header-title {
  font-size: 20px;
  font-weight: 700;
}

.today-header-sub {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 2px;
}

/* Quick type buttons */
.type-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.type-btn {
  padding: 12px 8px;
  border: 2px solid var(--gray-200);
  background: var(--card-bg);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  color: var(--text);
}

.type-btn:active {
  transform: scale(0.95);
}

.type-btn .type-icon {
  font-size: 24px;
}

/* ============ WEEKLY SCHEDULE ============ */
.week-schedule-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.week-schedule-row::-webkit-scrollbar { display: none; }

.week-day-item {
  flex: 0 0 auto;
  width: 64px;
  padding: 10px 6px;
  background: var(--card-bg);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 1.5px solid transparent;
  transition: all 0.2s;
}

.week-day-today {
  border-color: var(--primary);
  background: rgba(220, 38, 38, 0.08);
}

.week-day-rest {
  opacity: 0.5;
}

.week-day-name {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.week-day-today .week-day-name {
  color: var(--primary);
}

.week-day-icon {
  font-size: 22px;
}

.week-day-label {
  font-size: 10px;
  color: var(--text);
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
}

/* ============ WORKOUT PICKER MODAL ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  align-items: flex-end;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-sheet {
  width: 100%;
  background: var(--card-bg);
  border-radius: 24px 24px 0 0;
  padding: 12px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  align-self: center;
  margin-bottom: 8px;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  padding: 0 4px 8px;
}

.workout-pick-btn {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.workout-pick-btn:active { transform: scale(0.98); }

.workout-pick-today {
  border-color: var(--primary);
  background: rgba(220, 38, 38, 0.06);
}

.workout-pick-icon { font-size: 28px; }

.workout-pick-info { flex: 1; }

.workout-pick-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.workout-pick-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.workout-pick-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(220, 38, 38, 0.1);
  padding: 3px 8px;
  border-radius: 20px;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 12px;
  font-size: 15px;
  cursor: pointer;
  border-radius: 12px;
}

.btn-ghost:active { opacity: 0.6; }
