
:root {
    --primary-color: #3841E6;
    --text: #EDF0F7;
    --sidebar-gray: #111926;
    --sidebar-gray-light: #F8F7FD;
    --sidebar-gray-background: #6067EB;
    --success: #00C896;
    --white: #fff;
}

html {
  font-family: Poppins, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

nav {
    position: sticky;
    top: 0;
    left: 0;
    height: 100vh;
    background-color: var(--primary-color);
    width: 18rem;
    padding: 0.25rem 0.75rem;
    display: flex;
    color: var(--white);
    flex-direction: column;
    transition: width 0.5s linear;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

body.collapsed nav {
  width: 5rem;
}

body.collapsed .hide {
  position: absolute;
  display: none;
  pointer-events: none;
}

/*? sidebar top */
.sidebar-top {
  position: relative;
  display: flex;
  align-items: start;
  justify-content: center;
  flex-direction: column;
  min-height: 2.5rem;
  padding: 1rem 0;
}

body.collapsed .sidebar-top {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.logo__wrapper {
  display: flex;
  justify-content: start;
  align-items: center;
  gap: 1.25rem;
  color: var(--white);
  text-decoration: none;
}

.logo {
  width: 3.5rem;
  height: 3.5rem;
  background: var(--sidebar-gray-background);
  border-radius: 0.75rem;
}

.expand-btn {
  top: 1rem;
  right: -4.75rem;
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  background: var(--white);
  cursor: pointer;
  box-shadow: #6067EB50 0px 2px 8px 0px;
}

.expand-btn img {
  transform: rotate(180deg);
  stroke: var(--primary-color);
  width: 2.375rem;
  height: 2.375rem;
}


body.collapsed .expand-btn img {
  transform: rotate(360deg);
}

.sidebar-links {
  padding: 0.5rem 0;
  border-top: 1px solid var(--sidebar-gray-background);
}

/*? menu links */
.sidebar-links ul {
  list-style-type: none;
  position: relative;
}

.sidebar-links li {
  position: relative;
}

.sidebar-links li a {
  padding: 0.875rem 0.675rem;
  margin: 0.5rem 0;
  color: var(--sidebar-gray-light);
  font-size: 1.25rem;
  display: flex;
  justify-content: start;
  align-items: center;
  border-radius: 0.675rem;
  height: 3.5rem;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
}

.sidebar-links li a img {
  height: 2.125rem;
  width: 2.125rem;
}


.sidebar-links .link {
  margin-left: 1.875rem;
}

.sidebar-links li a:hover, 
.sidebar-links li a:focus, 
.sidebar-links .active {
  width: 100%;
  text-decoration: none;
  background-color: var(--sidebar-gray-background);
  border-radius: 0.675rem;
  outline: none;
  color: var(--sidebar-gray-light);
}

.sidebar-links .active {
  color: var(--white);
}

/*? bottom sidebar */

.sidebar-bottom {
  padding: 0.5rem 0;
  display: flex;
  justify-content: center;
  flex-direction: column;
  margin-top: auto;
}

/*? account part */
.sidebar__profile {
  display: flex;
  align-items: center;
  gap: 1.125rem;
  flex-direction: row;
  padding: 1.5rem 0.125rem;
  border-top: 1px solid var(--sidebar-gray-background);
}

.avatar__wrapper {
  position: relative;
  display: flex;
}

.avatar {
  display: block;
  width: 3.125rem;
  height: 3.125rem;
  cursor: pointer;
  border-radius: 50%;
  object-fit: cover;
  filter: drop-shadow(
    -20px 0 10px rgba(0, 0, 0, 0.1)
  );
}

.avatar:hover {
  transform: scale(1.05);
  transition: all 0.2s ease-in-out;
}

.avatar__name {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.user-name {
  font-size: 0.95rem;
  font-weight: 800;
  text-align: left;
}

.email {
  font-size: 0.9rem;
}

.online__status {
  position: absolute;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background-color: var(--success);
  bottom: 0.1875rem;
  right: 0.1875rem;
}

/* * Tooltip */
.tooltip {
  position: relative;
}

.tooltip .tooltip__content {
  visibility: hidden;
  background-color: var(--sidebar-gray-background);
  color: var(--white);
  text-align: center;
  border-radius: 0.375rem;
  padding: 0.375rem 0.75rem;
  position: absolute;
  z-index: 1;
  left: 4.6875rem;
}

body.collapsed .tooltip:hover .tooltip__content,
body.collapsed .tooltip:focus .tooltip__content {
  visibility: visible;
}
