/* The following code is mostly based on https://bootsnipp.com/snippets/emo6K */
/*Now the CSS Created by R.S*/

.tasktree {
	overflow-x: scroll;
	flex-wrap: nowrap;
}
.tasktree, .tasktree ul, .tasktree li {
	margin: 0;
	padding: 0;
}

.tasktree ul {
	padding-top: 20px;
	position: relative;
	display: flex;

	transition: all 0.5s;
	-webkit-transition: all 0.5s;
	-moz-transition: all 0.5s;
}

.tasktree li {
	width: 100%;
	list-style-type: none;
	position: relative;
	padding: 20px 5px 0 5px;
	display: inline-table;

	transition: all 0.5s;
	-webkit-transition: all 0.5s;
	-moz-transition: all 0.5s;
}

.tasktree li:first-child {
	padding-left: 0;
}

.tasktree li:last-child {
	padding-right: 0;
}

/*We will use ::before and ::after to draw the connectors*/

.tasktree li::before, .tasktree li::after{
	content: '';
	position: absolute;
	top: 0;
	right: 50%;
	border-top: 5px solid #ccc;
	width: 50%;
	height: 20px;
}
.tasktree li::after{
	right: auto;
	left: 50%;
	border-left: 5px solid #ccc;
}

/*We need to remove left-right connectors from elements without
any siblings*/
.tasktree li:only-child::after, .tasktree li:only-child::before {
	display: none;
}

/*Remove space from the top of single children*/
.tasktree li:only-child{
	padding-top: 0;
}

/*Remove left connector from first child and
right connector from last child*/
.tasktree li:first-child::before, .tasktree li:last-child::after{
	border: 0 none;
}
/*Adding back the vertical connector to the last nodes*/
.tasktree li:last-child::before{
	border-right: 5px solid #ccc;
	border-radius: 0 5px 0 0;
	-webkit-border-radius: 0 5px 0 0;
	-moz-border-radius: 0 5px 0 0;
}
.tasktree li:first-child::after{
	border-radius: 5px 0 0 0;
	-webkit-border-radius: 5px 0 0 0;
	-moz-border-radius: 5px 0 0 0;
}

/*Time to add downward connectors from parents*/
.tasktree ul ul::before{
	content: '';
	position: absolute;
	top: 0;
	left: 50%;
	border-left: 5px solid #ccc;
	width: 0;
	height: 20px;
}

.tasktree li .card{
	width: 100%;
	min-width: 250px;
	padding: 5px 10px;
	display: inline-block;

	transition: all 0.5s;
	-webkit-transition: all 0.5s;
	-moz-transition: all 0.5s;
}

.tasktree-separator{
	border-width: 3px;
	margin-top: 20px;
	margin-bottom: 5px;
}

/*Time for some hover effects*/
/*We will apply the hover effect the the lineage of the element also*/
.tasktree-hover li .card:hover, .tasktree-hover li .card:hover+ul li .card {
	background: #c8e4f8;
	color: #000;
	border: 1px solid #94a0b4;
}
/*Connector styles on hover*/
.tasktree-hover li .card:hover+ul li::after,
.tasktree-hover li .card:hover+ul li::before,
.tasktree-hover li .card:hover+ul::before,
.tasktree-hover li .card:hover+ul ul::before{
	border-color:  #94a0b4;
}
