@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap");
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
}
@keyframes slideInFromLeft {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(0);
  }
}
:root {
  --main-bg: hsl(230, 17%, 14%);
  --pattern-bg: hsl(232, 19%, 15%);
  --toggle-button: linear-gradient(
    to right,
    hsl(210, 78%, 56%),
    hsl(146, 68%, 55%)
  );
  --card-bg: hsl(228, 28%, 20%);
  --card-hover: hsl(228, 20%, 35%);
  --primary-text: hsl(228, 34%, 66%);
  --primary-heading: hsl(0, 0%, 100%);
  --secondary-heading: hsl(0, 0%, 100%);
}
:root .light-mode {
  --main-bg: hsl(0, 0%, 100%);
  --pattern-bg: hsl(225, 100%, 98%);
  --toggle-button: hsl(230, 22%, 74%);
  --card-bg: hsl(227, 47%, 96%);
  --card-hover: hsl(227, 50%, 92%);
  --primary-text: hsl(228, 12%, 44%);
  --primary-heading: hsl(230, 17%, 14%);
  --secondary-heading: hsl(228, 12%, 44%);
}
body {
  min-height: 100vh;
  color: var(--primary-text);
  background: var(--main-bg);
  font-size: 0.875rem;
  font-weight: 700;
  position: relative;
  transition: all 0.5s ease-in-out;
}
body::before {
  position: absolute;
  content: "";
  top: -1.7rem;
  left: 0;
  min-width: 100%;
  height: 35vh;
  background: var(--pattern-bg);
  border-bottom-left-radius: 1rem;
  border-bottom-right-radius: 1rem;
  z-index: -1;
}
h1,
h2 {
  color: var(--primary-heading);
}
/* ----------------------------------------------------------header---------------------------------------------------------- */
header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.7rem;
}
header h1 {
  font-size: 1.4rem;
}
header hr {
  height: 1px;
  background-color: var(--primary-text);
  border: 0;
  margin-top: 0.5rem;
}
header .toggle-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.toggle-button .switch {
  width: 3rem;
  height: 1.5rem;
  display: inline-block;
  position: relative;
}
.switch #switch {
  display: none;
}
.slider {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
  background: var(--toggle-button);
  border-radius: 1rem;
  cursor: pointer;
}
.slider:active,
.slider:hover {
  background: var(--toggle-button);
}
.slider::before {
  position: absolute;
  content: "";
  height: 1.2rem;
  width: 1.2rem;
  left: 0;
  top: 0;
  bottom: 0;
  background-color: var(--pattern-bg);
  margin: 0.15rem;
  border-radius: 50%;
}
.switch.active .slider::before {
  position: absolute;
  content: "";
  height: 1.2rem;
  width: 1.2rem;
  right: 0;
  left: auto;
  top: 0;
  bottom: 0;
  background-color: var(--pattern-bg);
  margin: 0.15rem;
  border-radius: 50%;
}
/* ---------------------------------------------main------------------------------------ */
.overview,
.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 0 1.7rem 3rem 1.7rem;
  animation: 0.6s ease-out 0s 1 slideInFromLeft;
}
.dashboard .square-card {
  height: 230px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  color: var(--primary-text);
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 0.3rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}
.dashboard .square-card:hover {
  background: var(--card-hover);
  transform: scale(1.02);
}
.facebook {
  border-top: 4px solid hsl(208, 92%, 53%);
}
.twitter {
  border-top: 4px solid hsl(203, 89%, 53%);
}
.instagram {
  position: relative;
}
.instagram:before {
  content: "";
  position: absolute;
  height: 4px;
  top: 4px;
  right: 0;
  left: 0;
  z-index: 1;
  background: linear-gradient(45deg, #fdc468, #df4996);
  margin: -4px 0 0 0;
  border-radius: 0.5rem 0.5rem 0 0;
}
.youtube {
  border-top: 4px solid hsl(348, 97%, 39%);
}
.square-card .name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.square-card h2 {
  font-size: 3.5rem;
}
.square-card p {
  font-size: 14px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 4px;
  margin-bottom: 1.5rem;
}
.change {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.increase {
  color: hsl(163, 72%, 41%);
}
.decrease {
  color: hsl(356, 69%, 56%);
}
.dashboard span,
.overview span {
  font-size: 13px;
}
#overview-heading {
  margin: 1.7rem;
  color: var(--secondary-heading);
}
.overview .rectan-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: var(--primary-text);
  background: var(--card-bg);
  border-radius: 0.3rem;
  padding: 1.5rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}
.overview .rectan-card:hover {
  background: var(--card-hover);
  transform: scale(1.02);
}
.rectan-card .up {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.rectan-card .down {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.down h2 {
  font-size: 2rem;
}
/* -----------------------------------------------media-query----------------------------------- */
@media (min-width: 820px) {
  header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin: 3rem 8rem;
  }
  header h1 {
    font-size: 1.8rem;
  }
  header hr {
    display: none;
  }
  header .toggle-button {
    gap: 1rem;
  }
  #overview-heading {
    margin: 1.7rem 8rem;
  }
  .dashboard,
  .overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    margin: 0 8rem 3rem 8rem;
  }
}
