* {
  padding: 0;
  margin: 0;
  font-family: sans-serif;
  box-sizing: border-box;
}

body {
  background: radial-gradient(
    circle at top left,
    #a8edea 30%, #fed6e3 80%
    );
  color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  text-align: center;
  flex-direction: column;
  padding: 1rem;
}

.Whole {
  display: flex;
  justify-content: space-around;
  gap: 15em;
  flex-wrap: wrap;
  padding: 1rem;
}

span{
  font-family: monospace;
}

/* Digital Clock */

.digital-clock {
  max-width: 90%;
  width: 500px;
  padding: 2rem;
  background: linear-gradient(
    to right,
    rgba(33, 31, 31, 0.3),
    rgba(48, 46, 46, 0.4)
  );
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.clock {
  padding-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clock span {
  font-size: 3rem;
  margin: 0 1rem;
  position: relative;
  font-weight: bold;
}

.clock span:nth-child(1):after {
  content: "Hrs";
  position: absolute;
  top: 3em;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.2rem;
  font-weight: normal;
}
.clock span:nth-child(3):after {
  content: "Min";
  position: absolute;
  top: 3em;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.2rem;
  font-weight: normal;
}
.clock span:nth-child(5):after {
  content: "Sec";
  position: absolute;
  top: 3em;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.2rem;
  font-weight: normal;
}

.nav {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem 0 2rem 0;
  gap: 70px;
  border-bottom: 2px solid rgb(54, 53, 53);
  margin-bottom: 2rem;
}

.toggle {
  width: 60px;
  height: 30px;
  background-color: rgb(146, 146, 142);
  border-radius: 20px;
  display: flex;
  align-items: center;
  border: none;
  outline: none;
  padding: 3px;
  color: #fff;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
}
.toggle #toggle-element {
  width: 25px;
  height: 25px;
  background-color: rgb(1, 2, 2);
  border-radius: 50%;
  z-index: 10;
  transition: 0.3s ease;
  text-align: center;
  font-size: 16px;
  padding: 3px;
  font-weight: 600;
}

#hr {
  position: relative;
  left: 5px;
  font-size: 16px;
  transition: 0.3s ease;
}

/* Stop watch */

.stop-watch {
  max-width: 90%;
  width: 500px;
  background-color: #383636;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  padding: 2rem;
  flex-direction: column;
  border-radius: 8px;
}

.stop-watch h1 {
  font-size: 2em;
  margin-bottom: 2rem;
}
.watch {
  font-size: 3rem;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.watch span {
  font-size: 2.5rem;
  margin: 0 1rem;
  position: relative;
  font-weight: bold;
}

.watch span:nth-child(1):after {
  content: "Hrs";
  position: absolute;
  top: 2.5em;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.2rem;
  font-weight: normal;
}
.watch span:nth-child(3):after {
  content: "Min";
  position: absolute;
  top: 2.5em;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.2rem;
  font-weight: normal;
}
.watch span:nth-child(5):after {
  content: "Sec";
  position: absolute;
  top: 2.5em;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.2rem;
  font-weight: normal;
}
.watch span:nth-child(7):after {
  content: "Ms";
  position: absolute;
  top: 2.5em;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.2rem;
  font-weight: normal;
}

.sw-btns {
  display: flex;
  margin-top: 3.5em;
  gap: 40px;
}

.sw-btns button {
  padding: 5px 10px;
  font-size: 16px;
  border-radius: 8px;
  border: none;
  outline: none;
  color: white;
  transition: all 0.2s ease;
}

.sw-btns button:nth-child(1) {
  background-color: hsl(120, 95%, 37%);
}
.sw-btns button:nth-child(2) {
  background-color: hsl(12, 90%, 50%);
}
.sw-btns button:nth-child(3) {
  background-color: hsl(212, 100%, 54%);
}

.sw-btns button:nth-child(1):hover {
  background-color: hsl(120, 65%, 37%);
  transform: scale(1.1);
}
.sw-btns button:nth-child(2):hover {
  background-color: hsl(12, 60%, 50%);
  transform: scale(1.1);
}
.sw-btns button:nth-child(3):hover {
  background-color: hsl(212, 60%, 54%);
  transform: scale(1.1);
}


/* Mobile responsiveness */

@media (max-width: 600px) {
  .digital-clock {
    padding: 1rem;
    max-width: 100%;
    width: 400px;
  }
  .stop-watch {
    padding: 1.5rem;
    max-width: 100%;
    width: 400px;
  }

  .clock span {
    font-size: 2.5rem;
    margin: 0 0.8rem;
  }

  .watch span {
    font-size: 2.5rem;
    margin: 0 0.5rem;
  }
}