:root {
  --bg: #06070c;
  --surface: #111522;
  --surface-2: #171d30;
  --surface-soft: #1d2438;
  --primary: #ff7b2f;
  --primary-strong: #ff9b45;
  --success: #2fd16d;
  --danger: #ff5c5c;
  --text: #f7f7f2;
  --muted: #a4b0c0;
  --border: #263047;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Montserrat", "Poppins", sans-serif;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
  background: linear-gradient(180deg, #f8fbff 0%, #eef3ff 100%);
  color: #06070c;
  padding: 0 0 40px;
}

.container {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 16px 40px;
}

.logo {
  color: var(--bg);
  padding: 8px 0;
}

.logo img {
  background-color: transparent;
  height: 45px;
  width: auto;
}

.header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 8px 4px 12px;
}

.nav-menu {
  position: absolute;
  top: 72px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #dbe3f0;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  z-index: 20;
  transform-origin: top right;
  animation: menuOpen 0.2s ease-out;
}

.nav-menu.hidden {
  display: none;
}

@keyframes menuOpen {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.nav-menu a {
  color: #111827;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 600;
}

.nav-menu a:hover {
  background: #f3f6fb;
}

.burger {
  padding: 10px;
  align-items: center;
  width: 46px;
  height: 46px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: white;
  border: 1px solid #dbe3f0;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.line {
  width: 22px;
  height: 2px;
  background: #111827;
  border-radius: 999px;
}

.hr {
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  height: 1px;
  width: 100%;
  border: 0;
  margin: 8px 0 16px;
}

#progressList > div {
  border: 1px solid black;
  padding: 20px;
  margin: 20px;
  border-radius: 10px;
  color: #06070c;
}

.progress-card {
  border: none;
  background-color: var(--surface-soft);
  color: var(--text);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.progress-card:active {
  transform: scale(0.98);
}
.progress-number {
  color: var(--success);
  font-weight: 700;
  font-size: 1.1rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  cursor: pointer;
}
.progress-header h2 {
  font-size: 1rem;
  margin: 0;
}
.progress-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-content {
  padding: 15px;
}
.progress-content p {
  display: flex;
  justify-content: space-between;
  margin: 8px 0;
}
#workoutStats {
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 10px 0 18px;
  padding: 10px;
  border: 1px solid rgba(219, 227, 240, 0.85);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

#showAllExercises {
  padding: 10px 12px;
  border: none;
  background: var(--primary-strong);
  border-radius: 12px;
  color: var(--bg);
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
  cursor: pointer;
}

#workoutStats h2,
#workoutStats p {
  margin: 15px;
}
.hidden {
  display: none;
}
.top-exercises-wrapper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.top-exercise {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin-bottom: 10px;
  border-radius: 12px;
  background-color: var(--surface-soft);
  color: var(--text);
}

.exercise-info {
  display: flex;
  flex-direction: column;
}

.exercise-info span {
  font-weight: 600;
}

.exercise-info strong {
  font-size: 14px;
  opacity: 0.7;
}

.exercise-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.exercise-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

#totalExercises {
  font-weight: 600;
  color: var(--surface);
}

.arrow svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.5;
  transition: transform 0.2s ease;
}
.arrow.open svg {
  transform: rotate(180deg);
  width: 20px;
  height: 20px;
  stroke-width: 2.5;
}

#topExercises h3 {
  margin-top: 20px;
}

#topExercises hr {
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  height: 1px;
  width: 100%;
  border: 0;
  margin: 8px 0 16px;
}

#exerciseSearch {
  width: 100%;
  padding: 11px 40px;
  border-radius: 12px;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  background: var(--text);
  color: var(--bg);
}

.search-box {
  margin-bottom: 15px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.search-box.hidden {
  display: none;
}

.search-box > svg {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  opacity: 0.7;
  z-index: 2;
}

.search-box input {
  width: 100%;
  padding-left: 40px;
  padding-right: 40px;
}

.clear-search {
  position: absolute;
  right: 8px;
  border: none;
  background: none;
  cursor: pointer;
}

.clear-search svg {
  width: 18px;
  height: 18px;
}

.history-popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.history-popup.show {
  display: flex;
}

.history-popup-content {
  background: var(--surface);
  color: var(--text);
  width: 90%;
  max-width: 420px;
  border-radius: 16px;
  padding: 20px;
  position: relative;
}

.history-close {
  position: absolute;
  right: 15px;
  top: 15px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #ddd;
}

.history-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.history-row {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 1fr 0.8fr;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #ddd;
}

.history-header {
  font-weight: bold;
}

.history-row span {
  text-align: center;
}

.historyBtn {
  padding: 6px;
  border-radius: 8px;
  border: none;
  background-color: var(--primary);
  color: var(--bg);
  font-weight: 500;
}

.history-filters button {
  background: none;
  border: none;
  color: var(--muted);
  padding: 20px 4px;
  cursor: pointer;
  position: relative;
}

.history-filters button.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: currentColor;
}

.history-filters button.active {
  color: var(--primary);
}

.history-close svg {
  width: 30px;
  height: 30px;
  color: var(--primary);
}
.history-close {
  opacity: 0.8;
  border: none;
  background: transparent;
}

.history-close:hover {
  opacity: 1;
  transform: rotate(90deg);
}
