// Name:            Progress
// Description:     Defines styles for progress bars
//
// Component:       `wk-progress`
//
// Sub-objects:     `wk-progress-bar`
//
// Modifiers:       `wk-progress-mini`
//                  `wk-progress-small`
//                  `wk-progress-success`
//                  `wk-progress-warning`
//                  `wk-progress-danger`
//                  `wk-progress-striped`
//
// Markup:
//
// <!-- wk-progress -->
// <div class="wk-progress">
//     <div class="wk-progress-bar" style="width: 40%;"></div>
// </div>
//
// ========================================================================


// Variables
// ========================================================================

@progress-height:                               20px;
@progress-mini-height:                          6px;
@progress-small-height:                         12px;

@progress-margin-vertical:                      15px;
@progress-background:                           #eee;

@progress-bar-background:                       #00a8e6;
@progress-bar-font-size:                        12px;
@progress-bar-color:                            #fff;

@progress-bar-success-background:               #8cc14c;
@progress-bar-warning-background:               #faa732;
@progress-bar-danger-background:                #da314b;


/* ========================================================================
   Component: Progress
 ========================================================================== */

/*
 * 1. Clearing
 * 2. Vertical alignment if text is used
 */

.wk-progress {
    box-sizing: border-box;
    height: @progress-height;
    margin-bottom: @progress-margin-vertical;
    background: @progress-background;
    /* 1 */
    overflow: hidden;
    /* 2 */
    line-height: @progress-height;
    .hook-progress;
}

/*
 * Add margin if adjacent element
 */

* + .wk-progress { margin-top: @progress-margin-vertical; }


/* Sub-object: `wk-progress-bar`
 ========================================================================== */

/*
 * 1. Transition
 * 2. Needed for text
 */

.wk-progress-bar {
    width: 0;
    height: 100%;
    background: @progress-bar-background;
    float: left;
    /* 1 */
    -webkit-transition: width 0.6s ease;
    transition: width 0.6s ease;
    /* 2 */
    font-size: @progress-bar-font-size;
    color: @progress-bar-color;
    text-align: center;
    .hook-progress-bar;
}


/* Size modifiers
 ========================================================================== */

/* Mini */
.wk-progress-mini {
    height: @progress-mini-height;
    .hook-progress-mini;
}


/* Small */
.wk-progress-small {
    height: @progress-small-height;
    .hook-progress-small;
}


/* Color modifiers
 ========================================================================== */

.wk-progress-success .wk-progress-bar {
    background-color: @progress-bar-success-background;
    .hook-progress-bar-success;
}

.wk-progress-warning .wk-progress-bar {
    background-color: @progress-bar-warning-background;
    .hook-progress-bar-warning;
}

.wk-progress-danger .wk-progress-bar {
    background-color: @progress-bar-danger-background;
    .hook-progress-bar-danger;
}


/* Modifier: `wk-progress-striped`
 ========================================================================== */

.wk-progress-striped .wk-progress-bar {
    background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
    background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
    background-size: 30px 30px;
}

/*
 * Animation
 */

.wk-progress-striped.wk-active .wk-progress-bar {
    -webkit-animation: wk-progress-bar-stripes 2s linear infinite;
    animation: wk-progress-bar-stripes 2s linear infinite;
}

@-webkit-keyframes wk-progress-bar-stripes {
    0% { background-position: 0 0;}
    100% { background-position: 30px 0; }
}

@keyframes wk-progress-bar-stripes {
    0% { background-position: 0 0;}
    100% { background-position: 30px 0; }
}


// Hooks
// ========================================================================

.hook-progress-misc;

.hook-progress() {}
.hook-progress-bar() {}
.hook-progress-mini() {}
.hook-progress-small() {}
.hook-progress-bar-success() {}
.hook-progress-bar-warning() {}
.hook-progress-bar-danger() {}
.hook-progress-misc() {}