@import './globals.scss';

// Default direction left
.Timeline
{
    .timline-wrapper{
        display: inline-block;
        position: relative;
        z-index: 2;
    }

    .timline-wrapper:before{
        content: "";
        position: absolute;
        left: 23px; // paddingLeft/2 + singleEntryWidth/2 - (iconWidth/2 + wrapper:beforeWith/2)
        top: 10px;
        border-radius: .25rem;
        background-color: #dee2e6;
        bottom: 0;
        margin: 0;
        width: 4px;
        z-index: 1;
    }

    .timline-wrapper.timline-wrapper-has-start{
        padding-top: 40px;
    }

    .timline-wrapper.timline-wrapper-has-start:before{
        top: 0px;
    }

    // start of timeline
    .timeline-start{
        position: absolute;
        left: 8.5px; // TimelineEndWidth/2 + borderWidth/2
        top: 0;
        width: 30px;
        height: 30px;
        text-align: center;
        line-height: 30px;
        border-radius: 50%;
        box-shadow: 0px 0px 6px $border-color;
        background-color: $white;
        z-index: 2;
    }

    // Root - time
    .timeline-time{
        position: relative;
        z-index: 2;
        display: inline-block;
        margin: 10px 0;
        clear: both;
    }

    .time{
        box-sizing: border-box;
        padding: 5px 10px;
        border-radius: $border-radius;
        background-color: $white;
        border:1px solid $border-color;
    }

    // Area
    .timeline-area{
        position: relative;
        box-sizing: border-box;
        z-index: 2;
    }

    // Line
    .timeline-entry{
        position: relative;
        display: flex;
        clear:both;
        margin: 10px 0;
    }

    // Icon
    .entry-icon{
        position: relative;
        z-index: 2;
        box-sizing: border-box;
        padding: 5px 10px;
    }

    .icon{
        border-radius: $border-radius;
        background-color: $white;
        display: inline-block;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        overflow: hidden;
        text-align: center;
        line-height: 30px;
        box-shadow: 0px 0px 6px $border-color;
    }

    .timeline-callback:hover{
        cursor: pointer;
    }

    // Data
    .entry-data{
        position: relative;
        z-index: 2;
        box-sizing: border-box;
        padding: 5px 10px;
    }

    .data{
        box-sizing: border-box;
        padding: 5px 10px;
        border-radius: $border-radius;
        box-shadow: 0px 0px 6px $border-color;
        background-color: $white;
        min-height: 30px;
        line-height: 20px;
    }

    // end of timeline
    .timline-wrapper-has-end{
        margin-bottom: 40px;
    }

    .timeline-end{
        position: absolute;
        left: 8.5px; // TimelineEndWidth/2 + borderWidth/2
        bottom: -30px;
        width: 30px;
        height: 30px;
        text-align: center;
        line-height: 30px;
        border-radius: 50%;
        box-shadow: 0px 0px 6px $border-color;
        background-color: $white;
        z-index: 2;
    }

    // Align items to the right
    .timline-wrapper.right{
        float: right;

        .timeline-time,
        .timeline-entry{
            float: right;
        }
        
        .timeline-start,
        .timeline-end{
            left: auto;
            right: 8.5px; // TimelineEndWidth/2 + borderWidth/2
        }
    }

    .timline-wrapper.right:before{
        left: auto;
        right: 23px; // paddingLeft/2 + singleEntryWidth/2 - (iconWidth/2 + wrapper:beforeWith/2)
    }
}
