/* Respect HTML hidden attribute */
[hidden] {
  display: none !important;
}

:root {
  --bg: #0f172a;
  --panel: #111827;
  --card: #1f2933;
  --border: #334155;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #38bdf8;
  --accent-hover: #0ea5e9;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #020617, #0f172a);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}


..app-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(6px);
}

.app-header h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}


main {
  padding: 1rem;
}

button {
  cursor: pointer;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 500;
  border: none;
  transition: all 0.15s ease;
}

button.primary {
  background: var(--accent);
  color: #020617;
}

button.primary:hover {
  background: var(--accent-hover);
}

button.secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}

button.secondary:hover {
  background: #273449;
}

button.link {
  background: none;
  color: var(--accent);
  padding: 0;
}

button.link:hover {
  text-decoration: underline;
}

button.delete-template-btn {
  background: none;
  color: var(--danger);
  font-size: 14px;
}

section {
  padding: 20px;
}

#workout-list,
#active-workout,
#view-workout,
#workout-summary {
  max-width: 600px;
  margin: 0 auto;
}

#workout-list ul,
#template-list,
#workout-history {
  list-style: none;
  padding: 0;
  margin: 0;
}
#template-list li {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

#template-list li span {
  font-weight: 500;
}

.primary {
  background: #007aff;
  color: white;
}

.secondary {
  background: #e0e0e0;
}

.input {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  outline: none;
}

.input::placeholder {
  color: var(--muted);
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}


.exercise-card {
  background: #e0e0e0;
  color: #000000;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.set-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-top: 0.25rem;
  color: #000;
}


.set-row input {
  flex: 1;
  padding: .5rem;
}

.set-row button {
  width: 40px;
  background: #ff3b30;
  color: white;
  border-radius: 6px;
}
.workout-history-item {
  padding: .75rem;
  margin-top: .5rem;
  background: #089BC9;
  border-radius: 6px;
  font-size: .95rem;
}
.previous-note {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 0.5rem;
  font-style: italic;
}
#view-workout-title {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 0.25rem;
}

#view-workout-date {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1rem;
}

.timer {
  font-size: 36px;
  font-weight: 600;
  text-align: center;
  margin: 16px 0;
}

.rest-timer {
  background: #020617;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

#rest-time-display {
  font-size: 8rem;
  font-weight: bold;
  margin-bottom: 8px;
}

.rest-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Rest complete alert */
.rest-complete {
  animation: pulse 1s infinite;
  background: #d1ffd6;
}

@keyframes pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.exercise-picker {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  padding: 16px;
  border-radius: 8px;
  width: 300px;
  z-index: 9999;
}
.exercise-suggestions {
  position: absolute;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 6px;
  width: 100%;
  max-height: 180px;
  overflow-y: auto;
  z-index: 10;
}

.exercise-suggestions li {
  padding: 10px;
  cursor: pointer;
}

.exercise-suggestions li:hover {
  background: var(--card);
}
button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}
button i {
  margin-right: 6px;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--danger);
}

.delete-template-btn {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
}
#workout-history {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.workout-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.workout-card:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}
.workout-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}
.workout-date {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
}

/* =========================
   Modal
   ========================= */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal-content {
  background: #fff;
  width: 90%;
  max-width: 400px;
  padding: 1.25rem;
  border-radius: 12px;
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.modal-actions button {
  flex: 1;
}

.workout-history-item {
  position: relative;
  z-index: 2;
  cursor: pointer;
}
#workout-list {
  position: relative;
  z-index: 1;
}
.background,
.app-background,
.overlay {
  pointer-events: none;
}
.app-version {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-top: 4px;

  .app-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-header h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
input,
textarea,
select {
  font-size: 16px;
}
html,
body {
  height: 100%;
  overflow: hidden;
  touch-action: manipulation;
}

#app,
main {
  height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
* {
  touch-action: manipulation;
}
