@use 'backend' as *;

/* CATEGORY */
#{c(sidebar server category wrapperCommon)} {
  #{c(sidebar server category mainContent)} {
    #{c(sidebar server category name)} {
      flex: 1;
    }
  }
}
#{c(sidebar server category name)} {
  display: flex;
  align-items: center;
  justify-content: center;
  color: cv('color.main');
  font-weight: 700;
  &::before {
    content: '';
    height: 2px;
    flex-grow: 1;
    transition: all 0.3s ease-in-out;
    background: linear-gradient(to left, cv('color.main') 50%, transparent);
    margin-right: 5px;
  }
  &::after {
    content: '';
    height: 2px;
    flex-grow: 1;
    transition: all 0.3s ease-in-out;
    background: linear-gradient(to right, cv('color.main') 50%, transparent);
    margin-left: 5px;
  }
}
#{c(sidebar server category children)} {
  margin-left: 6px;
}
#{c(sidebar server category addButtonIcon)} {
  color: cv('color.main');
}

// COLLAPSED
#{c(sidebar server category collapsed)} {
  #{c(sidebar server category name)} {
    &::before,
    &::after {
      flex-grow: 0;
    }
  }
}

#{c(sidebar server category wrapper)} {
  // MUTED
  &#{c(sidebar server category muted)} {
    :is(#{c(sidebar server category name)}, #{c(sidebar server category addButtonIcon)}) {
      color: cv('color.main');
      opacity: 0.5;
    }
  }

  // HOVER
  &:is(&, #{c(sidebar server category muted)}) {
    &:hover {
      #{c(sidebar server category name)} {
        color: cv('color.hover');
        &::before {
          background: linear-gradient(to left, cv('color.hover') 50%, transparent);
        }
        &::after {
          background: linear-gradient(to right, cv('color.hover') 50%, transparent);
        }
      }
      #{c(sidebar server category addButtonIcon)} {
        color: cv('color.hover');
      }
    }
  }
}

// ICONS
#{c(sidebar server category collapseIcon)} {
  display: none;
}
