@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

:root {
  /* Colores de fondo */
  --background: rgb(242, 240, 240);
}

[data-theme="dark"] {
  /* Colores de fondo */
  --background: black;
}

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

body {
  height: 100vh;
  padding: 10px;
  display: flex;
  background-color: var(--background);
}

.sidebar {
  width: 280px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  background-color: rgb(255, 255, 255);
  border-radius: 15px;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.033);
  overflow: hidden;
  transition: width 0.3s ease;

  a {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    text-decoration: none;
    font-weight: 400;
    font-size: 1em;
    color: rgb(135, 134, 134);

    .icon {
      height: 100%;
      padding: 0 10px 0 20px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.6em;
    }
  }

  .title {
    width: 100%;
    height: 90px;
    padding: 5px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-bottom: 1px solid rgb(204, 204, 205);

    /* img {
      width: 60px;
    } */

    .menuToggle {
      width: 50px;
      height: 50px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: flex-start;

      &::before {
        content: "";
        position: absolute;
        width: 40px;
        height: 2px;
        background: #333;
        transform: translateY(0px) rotate(45deg);
        transition: 0.5s;
      }

      &::after {
        content: "";
        position: absolute;
        width: 40px;
        height: 2px;
        background: #333;
        transition: 0.5s;
        transform: translateY(0px) rotate(-45deg);
        box-shadow: 0 0 0 #333;
      }
    }

    h1 {
      color: rgb(11, 23, 73);
    }

    span {
      color: rgb(160, 159, 159);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }

  .menu_container {
    width: 100%;
    flex-grow: 1;

    .menu {
      width: 100%;
      display: flex;
      flex-direction: column;
      gap: 15px;

      .item {
        height: 40px;
        width: 100%;
        transition: 0.2s ease;

        &:hover {
          background-color: rgb(240, 240, 240);
        }
      }

      .selected {
        border-left: 4px solid rgb(0, 106, 255);

        a {
          color: rgb(0, 106, 255);
          font-weight: 500;
        }
      }
    }
  }

  .bottom {
    width: 100%;
    margin-top: 30px;
    margin-bottom: 15px;
    padding-top: 30px;
    border-top: 1px solid rgb(204, 204, 205);

    .menu_bottom {
      width: 100%;
      display: flex;
      flex-direction: column;
      gap: 5px;

      .item {
        height: 40px;
        width: 100%;
        transition: 0.2s ease;

        &:hover {
          background-color: rgb(240, 240, 240);
        }
      }

      .selected {
        border-left: 4px solid rgb(215, 6, 23);

        a {
          color: rgb(215, 6, 23);
          font-weight: 500;
        }
      }
    }

    .theme {
      width: 100%;
      height: 40px;
      padding: 20px 30px 0 25px;
      display: flex;
      align-items: center;
      justify-content: space-between;

      p {
        font-weight: 400;
        font-size: 1em;
        color: rgb(66, 66, 66);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      #toggle_theme {
        width: 200px;
        height: 40px;
        position: relative;
        display: block;
        width: 50px;
        height: 25px;
        border-radius: 25px;
        background: #222;
        transition: 0.5s;
        box-shadow: inset 0 8px 60px rgba(0, 0, 0, 0.1),
          inset 0 8px 8px rgba(0, 0, 0, 0.1),
          inset 0 -4px 4px rgba(0, 0, 0, 0.1);

        .indicator {
          position: absolute;
          top: 0;
          left: 0;
          width: 25px;
          height: 25px;
          border-radius: 50%;
          background: linear-gradient(to bottom, #444, #222);
          cursor: pointer;
          transform: scale(0.9);
          box-shadow: inset 0 8px 40px rgba(0, 0, 0, 0.5),
            inset 0 4px 4px rgba(255, 255, 255, 0.2),
            inset 0 -4px 4px rgba(255, 255, 255, 0.2);
          transition: 0.5s;
        }

        &.active {
          background: #ffffff;
          box-shadow: inset 0 8px 60px rgba(0, 0, 0, 0.1),
            inset 0 8px 8px rgba(0, 0, 0, 0.1),
            inset 0 -4px 4px rgba(0, 0, 0, 0.05);

          .indicator {
            left: 25px;
            background: linear-gradient(to bottom, #eaeaea, #f9f9f9);
            box-shadow: inset 0 8px 40px rgba(0, 0, 0, 0.1),
              inset 0 4px 4px rgba(255, 255, 255, 1),
              inset 0 -4px 4px rgba(255, 255, 255, 1);
          }
        }
      }
    }

    .log_out {
      width: auto;
      height: 60px;
      margin: 30px 10px 10px 10px;
      padding: 10px;
      display: flex;
      align-items: center;
      justify-content: space-around;
      background-color: rgba(180, 180, 180, 0.392);
      border-radius: 10px;

      img {
        height: 45px;
        border-radius: 5px;
      }

      a {
        width: 30px;

        span {
          padding: 0;
        }
      }
    }
  }
}

.collapse {
  width: 70px;
  overflow: visible;

  a {
    position: relative;

    .icon {
      width: 100%;
      padding: 0;
    }

    span {
      &:nth-child(2) {
        display: none;
      }
    }
  }

  .title {
    .menuToggle {
      width: 40px;
      height: 40px;

      &::before {
        width: 40px;
        transform: translateY(-12px);
      }

      &::after {
        width: 40px;
        transform: translateY(12px);
        box-shadow: 0 -12px 0 #333;
      }
    }

    div {
      display: none;
    }
  }

  .menu_container {
    .menu {
      .hover {
        a {
          span {
            &:nth-child(2) {
              padding: 5px 15px 5px 15px;
              display: block;
              position: absolute;
              left: 120%;
              text-align: left;
              background-color: white;
              color: #727272;
              border-radius: 10px;

              &::before {
                content: "";
                width: 10px;
                height: 10px;
                background-color: white;
                position: absolute;
                top: 50%;
                left: -5px;
                transform: translateY(-50%) rotate(45deg);
                border-radius: 3px;
              }
            }
          }
        }
      }
    }
  }

  .bottom {
    .menu_bottom {
      .hover {
        a {
          span {
            &:nth-child(2) {
              padding: 5px 15px 5px 15px;
              display: block;
              position: absolute;
              left: 120%;
              text-align: left;
              background-color: white;
              color: #727272;
              border-radius: 10px;

              &::before {
                content: "";
                width: 10px;
                height: 10px;
                background-color: white;
                position: absolute;
                top: 50%;
                left: -5px;
                transform: translateY(-50%) rotate(45deg);
                border-radius: 3px;
              }
            }
          }
        }
      }
    }

    .theme {
      padding: 20px 0 0 0;
      justify-content: center;

      p {
        display: none;
      }
    }

    .log_out {
      margin: 30px 10px 10px 10px;
      padding: 0;
      justify-content: center;

      img {
        display: none;
      }

      a {
        width: 30px;
        font-size: 3em;
        color: rgb(88, 88, 88);

        span {
          padding: 0;
        }
      }

      .name {
        display: none;
      }
    }
  }

  & .menuToggle::before {
    transform: translateY(-8px);
  }

  & .menuToggle::after {
    transform: translateY(8px);
    box-shadow: 0 -8px 0 #333;
  }
}

/* @media (width <= 768px) {
  .sidebar {
    width: 70px;

    a {
      .icon {
        width: 100%;
        padding: 0;
      }

      span {
        &:nth-child(2) {
          display: none;
        }
      }
    }

    .title {
      .menuToggle {
        width: 40px;
        height: 40px;

        &::before {
          width: 40px;
          transform: translateY(-12px);
        }

        &::after {
          width: 40px;
          transform: translateY(12px);
          box-shadow: 0 -12px 0 #333;
        }
      }

      div {
        display: none;
      }
    }

    .bottom {
      .theme {
        padding: 20px 0 0 0;
        justify-content: center;

        p {
          display: none;
        }
      }

      .log_out {
        margin: 30px 10px 10px 10px;
        padding: 0;
        justify-content: center;

        img {
          display: none;
        }

        a {
          width: 30px;
          font-size: 3em;
          color: rgb(88, 88, 88);

          span {
            padding: 0;
          }
        }

        .name {
          display: none;
        }
      }
    }
  }
} */
