:root {
    --bg:#faf9fc;
    --upBorder: black;
    --upgradesColor: #34495e;
    --headerColor: #2c3e50;
    --borderSize: 2px;
    --borderCurve: 8px;
    --fontSize: 16px;
    --fontColor: #333;
    --statsColor: lightgrey;
    --offWhite: #FDF4E3;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

html p, h2, h3, span{
  color: var(--offWhite);
}

body {
  height: 100vh;
  font-family: "Manrope", sans-serif;
  font-size: 16px;
  background-color: var(--bg);
  color: var(--fontColor);
  overflow: hidden;
}


header {
  height: 60px;
  background: var(--headerColor);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: var(--borderSize) solid var(--upgradesColor);
}

header .user-data {
  position: fixed;
  right: 20px;
}

header .user-data p {
  display: inline;
}

.container {
  display: flex;
  height: calc(100vh - 60px);
}

.main {
  flex: 1;
  will-change: background-position;
  height: calc(100vh - 60px);
  background: #ecf0f1;
  background-image: url("../images/barbells_falling.png");
  background-repeat: repeat;
  background-size:500px auto;
  padding: 20px;
  overflow-y: auto;
 
  animation: barbellsFall 60s linear infinite;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.main::-webkit-scrollbar {
  display: none;
}

.cards-layer-wrapper {
  position: relative;
  width: fit-content;
  margin: 8vh auto 0 auto;
  top: -30px;
}

.workout-container{
  position: relative;
  z-index: 1;
  top: -30px;
  display: grid;
  grid-template-columns: repeat(2, clamp(300px, 18vw, 700px));
  grid-auto-rows: clamp(300px, 18vw, 700px);
  gap: clamp(48px, 2vw, 48px);

  width: fit-content;
  margin: 8vh auto 0 auto;
}

.info {
  z-index: 2;
}

.action-workout-card {
  background: rgb(138, 138, 223, 0.3);
  border: none;
  margin-top: -20px;
  box-shadow: none;
  padding: 0;
  width: clamp(120px, 20vw, 400px);
  aspect-ratio: 1 / 1;
  display: inline-block;
  cursor: pointer;
  z-index: 5;
  overflow: visible;
  border-radius: 20px;
}

.action-workout-card:hover img {
  animation: growShrink 2s linear infinite;
}

.action-workout-card.expanded {
  transform: scale(1.2);
}

.action-workout-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.stats {
  position: absolute;
  z-index: 1;
  right: 31%;
  padding: 15px;
  min-width: 180px;
  background-color: var(--statsColor);
  border-radius: var(--borderCurve);
}

.stats h2, .stats p,
.main h2, .main p,
.sidebar button{
  font-weight: bold;
  background: linear-gradient(
    90deg,
    var(--upgradesColor),
    var(--headerColor),
    blue,
    indigo,
    violet,
    indigo,
    blue,
    var(--headerColor),
    var(--upgradesColor));
  background-size: 400% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rainbow 5s linear infinite;
  display: flex;
}

.sidebar h2 {
  margin-bottom: 10px;
}

.cheat-menu-container {
  margin-top: -40px;
  position: relative;
  width: fit-content;
  margin-left: auto;
  margin-bottom: 10px;
  transform: translateY(30px);
}

.cheat-buttons {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 1000;

  padding: 6px;
  border: 1px solid black;
  background: #2f4357;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);

  grid-template-columns: repeat(3, auto);
  gap: 4px;
}

.cheat-menu-container.open .cheat-buttons {
  display: grid;
}

.menu-button,
.cheat-buttons button {
  background-color: #4a637c;  
  border: 1px solid #111;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 3px 0 rgba(0, 0, 0, 0.45),
    0 5px 10px rgba(0, 0, 0, 0.28);

  transition: transform 0.12s ease, box-shadow 0.12s ease;

  font-weight: bold;
  background-image: linear-gradient(
    90deg,
    var(--upgradesColor),
    var(--headerColor),
    rgb(255, 0, 0),
    rgb(255, 57, 57),
    violet,
    rgb(255, 57, 57),
    rgb(255, 0, 0),
    var(--headerColor),
    var(--upgradesColor)
  );
  background-size: 400% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rainbow 5s linear infinite;
}


.menu-button:hover,
.cheat-buttons button:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 4px 0 rgba(0, 0, 0, 0.5),
    0 8px 14px rgba(0, 0, 0, 0.32);
}

.menu-button:active,
.cheat-buttons button:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 1px 0 rgba(0, 0, 0, 0.45),
    0 2px 5px rgba(0, 0, 0, 0.2);
}

.menu-button,
.cheat-buttons button {
  border-radius: 4px;
}

.sidebar {
  width: 30%;
  background: #34495e;
  color: white;
  padding: 20px;
  overflow-y: auto;
  border-left: var(--borderSize) solid #2c3e50;
}

.reps-count {
  position: static;
}

.sidebar button {
  width: 100px;
  height: 30px;
  padding: 4px;
}

.main::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.upgrade {
  padding: 10px;
  margin-top: 8px;
  border: var(--borderSize) solid var(--upBorder);
  user-select: none;
  -webkit-user-select: none;
  border-radius: var(--borderCurve);
  transition: transform 0.4s ease-in-out;
}

.upgrade:hover {
  transform: scale(1.05);
}
.upgrade p {
  font-size: var(--fontSize);
}

.upgrade progress {
  width: calc(100% - var(--fontSize) - var(--fontSize));
  -webkit-appearance: none;
  appearance: none;
  height: 14px;
  border-radius: var(--borderCurve);
  overflow: hidden;
  background-color: var(--offWhite);
}

.reps-count {
  position: relative;
  display: inline-block;
}

#user-reps-floating {
  position: absolute;
  left: 70px;
  top: 0;
  pointer-events: none;
}

.reps-floating {
  position: absolute;
  color: white;
  font-size: 18px;
  font-weight: bold;
  opacity: 1;
  animation: floatUp 0.8s ease-out forwards;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

.upgrade progress::-webkit-progress-value {
    box-shadow: 0 0 8px rgba(0, 200, 255, 0.7);
}

/* Keyframes for the falling barbells animation */

@keyframes barbellsFall {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 0 2000px;
  }
}
/* Keyframe for the stats header */
@keyframes rainbow {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}
/* Keyframe for floating number on clicks */
@keyframes floatUp {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-30px);
    opacity: 0;
  }
}

@keyframes growShrink {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}