@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=Syne:wght@700;800&display=swap');

:root {
  --base-clr: #11121a;
  --line-clr: #42434a;
  --hover-clr: #222533;
  --text-clr: #f5f5f5;
  --accent-clr: #5e63ff;
  --secondary-text-clr: #c5c5c5;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-rendering: geometricPrecision;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html {
  font-family: Poopins, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.5rem;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--base-clr);
  color: var(--text-clr);
  display: grid;
  grid-template-columns: auto 1fr;
}

#sidebar {
  height: 100vh;
  height: 100dvh;
  width: 250px;
  padding-top: 30px;
  background-color: var(--base-clr);
  border-right: 1px solid var(--line-clr);
  position: sticky;
  top: 0;
  align-self: start;
  overflow: hidden;
  text-wrap: nowrap;
  transition: 300ms ease-in-out;
}

.icon svg {
  display: none;
}

#sidebar.close {
  padding: 20px 0;
  width: 60px;

  .icon svg {
    display: block;
    transform: scale(1.5) translateX(11.5px);
    cursor: pointer;
  }
}

#sidebar ul {
  list-style: none;
}

#sidebar .devider {
  width: 1fr;
  padding: 1.5px;
  margin: 15px 10px;
  border-radius: 9px;
  background: var(--accent-clr);
  transform: translateX(-2px);
}

#sidebar > ul >li:first-child {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;

  .logo {
    font-weight: 700;
    font-size: 25px;
  }
}

#sidebar ul li.active a {
  color: var(--accent-clr);

  svg {
    fill: var(--accent-clr);
  }
}

#sidebar a, #sidebar .dropdown-btn, #sidebar .logo {
  border-radius: 0;
  padding: 0.85em;
  text-decoration: none;
  color: var(--text-clr);
  display: flex;
  align-items: center;
  gap: 1em;
}

#sidebar svg {
  flex-shrink: 0;
  fill: var(--text-clr);
  height: 25px;
  width: 25px;
  margin-right: 5px;
}

#toggle-btn {
  margin-left: auto;
  padding: 1em;
  border: none;
  border-radius: .5em;
  background: none;
  cursor: pointer;

  svg {
    transition: rotate 150ms ease;
    height: 35px;
    width: 35px;
    margin-top: 10px;
    transform: translateX(-5px);
  }
}

#toggle-btn svg:hover {
  fill: var(--secondary-text-clr);
  transform: scale(0.95) translateX(-7px);
  transition: 250ms ease-in-out;
}

.dropdown-btn {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
}

#sidebar a span, #sidebar .dropdown-btn span {
  flex-grow: 1;
}

#sidebar a:hover, #sidebar .dropdown-btn:hover {
  background-color: var(--hover-clr);
}

#sidebar .sub-menu {
  display: grid;
  grid-template-rows: 0fr;
  transition: 300ms ease-in-out;

  > div {
    overflow: hidden;
  }
}

#sidebar .sub-menu.show {
  grid-template-rows: 1fr;
}

.dropdown-btn svg {
  transition: 200ms ease;
}

.rotate svg:last-child {
  rotate: 180deg;
}

#sidebar .sub-menu a {
  padding-left: 2em;
  padding-right: 100%;
  overflow: hidden;
}

#sidebar .sub-menu a span {
  display: inline-block;
  color: var(--accent-clr);
  transform: translateX(-10px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

#sidebar .sub-menu a:hover span {
  transform: translateX(0);
  opacity: 1;
}

main {
  padding: min(30px, 7%);
}

main p {
  color: var(--secondary-text-clr);
  margin-top: 5px;
  margin-bottom: 15px;
}

.container {
  border: 1px solid var(--line-clr);
  border-radius: 1rem;
  margin-bottom: 20px;
  padding: min(3em, 15%);

  h2 p {margin-top: 1em;}
}

@media(max-width: 800px) {
  body {
    grid-template-columns: 1fr;
  }

  main {
    padding: 2em 1em 60px 1em;
  }

  .container {
    border: none;
    padding: 5px;
  }

  #sidebar > ul {
    padding: 0;
    display: flex;
    align-items: center;
    overflow-x: auto;
  }

  #sidebar > ul > li {
    flex-shrink: 0;
  }

  #sidebar > ul::before,
  #sidebar > ul::after {
    content: '';
    margin: auto;
  }

  #sidebar {
    height: 60px;
    width: 100%;
    border-right: none;
    border-top: 1 px solid var(--line-clr);
    padding: 0;
    position: fixed;
    top: unset;
    bottom: 0;

    .devider {
      width: 0;
      height: 30px;
      margin-left: 10px;
      margin-right: 10px;
      transform: translateX(0);
    }

    svg {
      margin-right: 0px;
    }

    ul li {
      height: 100%;
    }

    ul a, ul .dropdown-btn {
      width: 60px;
      height: 60px;
      padding: 0;
      border-radius: 0;
      justify-content: center;
    }

    ul li span, ul li:first-child, .dropdown-btn svg:last-child {
      display: none;
    }

    ul li .sub-menu.show {
      position: fixed;
      bottom: 60px;
      left: 0;
      height: 60px;
      width: 100%;
      background-color: var(--hover-clr);
      border-top: 1px solid var(--line-clr);
      display: flex;
      justify-content: center;

      > div {
        overflow-x: auto;
      }

      li {
        display: inline-flex;
      }

      a {
        padding: 1em;
        width: auto;
        justify-content: center;
      }
    }
  }
}