/********************************************************************
**  File: style.css
**  Project: WorkoutSensei
**  Author: Armin Jänisch
**  Date: 2026-03-20
********************************************************************/

:root {
  --bg: darkgray;
  --surface: dimgray;
  --text: white;
  --muted: dimgray;
  --border: dimgray;
  --border-soft: white;
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  --shadow-overlay: 0 10px 30px rgba(0, 0, 0, 0.25);

  --green: green;
  --yellow: yellow;
  --red: red;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button,
input,
select {
  border: 1px solid var(--border);
  border-radius: 8px;
}

input {
  border: 1px solid var(--text);
  border-radius: 8px;
}

button {
  padding: 10px 14px;
  background: var(--surface);
  cursor: pointer;
  font-size: 16px;
  color: var(--text); 
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

input,
select {
  width: 100%;
  padding: 8px;
  background: var(--surface);
  color: var(--text);
}

input[readonly] {
  border: none;
  background: transparent;
  padding: 8px 0;
  color: var(--text);
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid darkgray;
  outline-offset: 2px;
}

.app {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
}

.hidden {
  display: none !important;
}

/* ========================
   Top / Navigation
======================== */

.menu-button {
  margin-bottom: 12px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}

#current-date {
  flex: 1;
  text-align: center;
  font-weight: bold;
  font-size: 18px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* ========================
   Cards / Content
======================== */

.card {
  margin-bottom: 12px;
  padding: 14px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.empty {
  padding: 18px;
  text-align: center;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.exercise-name {
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: bold;
}

.split-line {
  margin: 20px;
  font-size: 20px;
  color: var(--text);
  text-align: center;
}

.exercise-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
}

.exercise-row:last-child {
  border-bottom: none;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ========================
   Workout Sets
======================== */

.set-row {
  display: grid;
  grid-template-columns: 60px 90px 1fr 60px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.delta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.delta-dot {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
}

.delta-dot.green {
  background: green;
}

.delta-dot.yellow {
  background: yellow;
}

.delta-dot.red {
  background: red;
}

.delta-dot.delta-empty {
  background: white;
  border: 1px solid var(--border-soft);
}

/* ========================
   Overlay
======================== */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.overlay-panel {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow-overlay);
}

.overlay-panel-left {
  top: 0;
  left: 0;
  width: min(320px, 85vw);
  height: 100%;
}

.overlay-panel-center {
  top: 50%;
  left: 50%;
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  transform: translate(-50%, -50%);
  border-radius: 14px;
  overflow: hidden;
}

.overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
}

.overlay-title {
  font-size: 18px;
  font-weight: bold;
}

.overlay-body {
  padding: 16px;
  overflow: auto;
}

.nav-item {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  text-align: left;
}

/* ========================
   Editors / Forms
======================== */

.form-grid {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.set-editor {
  margin-bottom: 16px;
}

.set-editor-row {
  display: grid;
  grid-template-columns: 60px 1fr 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.set-editor-label {
  font-weight: bold;
}

.weekday-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.weekday-grid label {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ========================
   Step-Up
======================== */

.stepup-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}

.stepup-dots {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.stepup-dot {
  display: block;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  border-radius: 50%;
  border: none;
  padding: 0;
  margin: 0;
  box-shadow: none;
  background: white;
}

.stepup-dot.green {
  background: green;
}

.stepup-dot.yellow {
  background: yellow;
}

.stepup-dot.red {
  background: red;
}

.stepup-dot.empty {
  background: white;
}

.stepup-button {
  margin-left: auto;
  white-space: nowrap;
  flex: 0 0 auto;
}

/* ========================
   Mobile
======================== */

@media (max-width: 480px) {
  .app {
    padding: 12px;
  }

  .set-row {
    grid-template-columns: 52px 72px 1fr 52px;
    gap: 6px;
  }

  .set-editor-row {
    grid-template-columns: 52px 1fr 1fr;
    gap: 6px;
  }

  button {
    padding: 10px 12px;
  }
}