/* LiteFit - mobile-first fitness app */

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
  padding: 0;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
}

a { color: #38bdf8; text-decoration: none; }
a:hover { text-decoration: underline; }

.notice {
  background: #166534;
  color: #dcfce7;
  padding: 12px 16px;
  margin: 0;
}
.alert {
  background: #b91c1c;
  color: #fecaca;
  padding: 12px 16px;
  margin: 0;
}

.container { max-width: 640px; margin: 0 auto; padding: 16px; }

/* Admin */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
}
.admin-header h1 { margin: 0; font-size: 1.25rem; }
.admin-nav a { margin-left: 16px; }

/* Cards */
.card {
  background: #1e293b;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid #334155;
}
.card h2 { margin: 0 0 12px; font-size: 1.125rem; }

/* Forms */
input, select, textarea, button {
  font-size: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #475569;
  background: #0f172a;
  color: #e2e8f0;
  width: 100%;
  margin-bottom: 12px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #38bdf8;
}
button, .btn {
  background: #0ea5e9;
  color: #0f172a;
  border: none;
  cursor: pointer;
  font-weight: 600;
  width: auto;
  padding: 12px 24px;
  display: inline-block;
  text-align: center;
}
button:hover, .btn:hover { background: #38bdf8; }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #ef4444; }
.btn-secondary { background: #475569; }
.btn-secondary:hover { background: #64748b; }

label { display: block; margin-bottom: 4px; color: #94a3b8; font-size: 0.875rem; }
input[type=checkbox] { width: auto; margin: 0 8px 0 0; vertical-align: middle; }
.form-group { margin-bottom: 16px; }
.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #334155; }
th { color: #94a3b8; font-weight: 500; font-size: 0.875rem; }

/* Workout page */
.workout-header {
  padding: 20px 16px;
  text-align: center;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
}
.workout-header h1 { margin: 0 0 8px; font-size: 1.5rem; }
.workout-header p { margin: 0; color: #94a3b8; }

.exercise-block {
  background: #1e293b;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  border-left: 4px solid #0ea5e9;
}
.exercise-block.superset { border-left-color: #8b5cf6; }
.exercise-block h3 { margin: 0 0 12px; font-size: 1rem; }
.set-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.set-row input { margin: 0; width: 80px; text-align: center; }
.set-row .set-label { width: 60px; color: #94a3b8; }

/* Step-by-step workout */
.workout-step {
  display: none;
}
.workout-step.active {
  display: block;
}
.workout-step-card {
  background: #1e293b;
  border-radius: 16px;
  padding: 28px 24px;
  margin-bottom: 16px;
  border-left: 6px solid #0ea5e9;
  min-height: 280px;
}
.workout-step-card .exercise-name {
  margin: 0 0 24px;
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
}
.workout-step-card .set-inputs {
  margin-bottom: 20px;
}
.workout-step-card .set-exercise-label {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: #94a3b8;
}
.workout-step-card .input-row {
  display: flex;
  gap: 16px;
}
.workout-step-card .input-row label {
  flex: 1;
  margin: 0;
}
.workout-step-card .label-text {
  display: block;
  color: #94a3b8;
  font-size: 0.8rem;
  margin-bottom: 6px;
}
.workout-step-card .input-row input {
  margin: 0;
  font-size: 1.25rem;
  text-align: center;
  padding: 14px;
}
.workout-step-card .btn-done {
  width: 100%;
  margin-top: 24px;
  padding: 18px;
  font-size: 1.2rem;
  border-radius: 12px;
}
.workout-complete.hidden {
  display: none;
}

/* Superset drag & drop */
.superset-edit-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 768px) {
  .superset-edit-layout { grid-template-columns: 1fr; }
}
.superset-exercises-bank .exercises-bank-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}
.exercise-bank-item {
  cursor: grab;
  margin-bottom: 0;
  padding: 12px 16px;
}
.exercise-bank-item:active { cursor: grabbing; }
.superset-entry-card { cursor: default; }
.sort-handle {
  cursor: grab;
  color: #64748b;
  font-size: 1.2rem;
  user-select: none;
  padding: 4px;
}
.sort-handle:active { cursor: grabbing; }
/* Blocks drag & drop (workout edit) */
.merge-hint {
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 8px 0 16px;
  font-size: 0.95rem;
}
.btn-merge {
  background: #7c3aed !important;
  color: white !important;
}
.btn-merge:hover { background: #8b5cf6 !important; }
.blocks-list { display: flex; flex-direction: column; gap: 8px; }
.block-card { display: flex; align-items: stretch; }
.block-card .sort-handle { align-self: center; }
.block-merge-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  color: #64748b;
  flex-shrink: 0;
}
.block-merge-checkbox input { margin: 0; }

.sortable-ghost {
  opacity: 0.4;
  background: #334155;
}
.sortable-chosen { background: #334155; }
.sortable-drag { opacity: 0.9; }
.text-muted { color: #64748b; font-size: 0.875rem; }
.text-muted small { font-size: inherit; }

/* Devise */
.devise-links { margin-top: 16px; }
.devise-links a { display: block; margin-bottom: 8px; }
