// Name:            Datepicker
// Description:     Defines styles for a datepicker
//
// Component:       `wk-datepicker`
//
// Modifiers:       `wk-datepicker-nav`
//                  `wk-datepicker-previous`
//                  `wk-datepicker-next`
//                  `wk-datepicker-heading`
//                  `wk-datepicker-table`
//                  `wk-datepicker-table-muted`
//
// ========================================================================


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

@datepicker-z-index:                            1050;
@datepicker-animation:                          wk-fade;

@datepicker-nav-height:                         20px;
@datepicker-nav-margin-bottom:                  15px;
@datepicker-nav-color:                          #444;
@datepicker-nav-hover-color:                    #444;
@datepicker-previous-icon:                      "\f053";
@datepicker-next-icon:                          "\f054";

@datepicker-table-width:                        26px;
@datepicker-table-height:                       24px;
@datepicker-table-color:                        #444;

@datepicker-table-hover-background:             #ddd;
@datepicker-table-hover-color:                  #444;
@datepicker-table-onclick-background:           #ccc;
@datepicker-table-onclick-color:                #444;

@datepicker-table-active-background:            #00a8e6;
@datepicker-table-active-color:                 #fff;

@datepicker-table-muted-color:                  #999;


/* ========================================================================
   Component: Datepicker
 ========================================================================== */

/*
 * 1. Highest z-index
 * 2. Reset dropdown width
 * 3. Set animation
 * 4. Needed for scale animation
 */

.wk-datepicker {
    /* 1 */
    z-index: @datepicker-z-index;
    /* 2 */
    width: auto;
    /* 3 */
    -webkit-animation: @datepicker-animation 0.2s ease-in-out;
    animation: @datepicker-animation 0.2s ease-in-out;
    /* 4 */
    -webkit-transform-origin: 0 0;
    transform-origin: 0 0;
}


/* Sub-object: `wk-datepicker-nav`
========================================================================== */

.wk-datepicker-nav {
    margin-bottom: @datepicker-nav-margin-bottom;
    text-align: center;
    line-height: @datepicker-nav-height;
    .hook-datepicker-nav;
}

/*
 * Micro clearfix
 */

.wk-datepicker-nav:before,
.wk-datepicker-nav:after {
    content: "";
    display: table;
}

.wk-datepicker-nav:after { clear: both; }

/*
 * Previous and next navigation
 */

.wk-datepicker-nav a {
    color: @datepicker-nav-color;
    text-decoration: none;
    .hook-datepicker-nav-item;
}

.wk-datepicker-nav a:hover { color: @datepicker-nav-hover-color; }

.wk-datepicker-previous { float: left; }
.wk-datepicker-next { float: right; }

.wk-datepicker-previous:after,
.wk-datepicker-next:after {
    width: @datepicker-nav-height;
    font-family: FontAwesome;
}

.wk-datepicker-previous:after { content: @datepicker-previous-icon; }
.wk-datepicker-next:after { content: @datepicker-next-icon; }


/* Sub-object: `wk-datepicker-heading`
========================================================================== */

.wk-datepicker-heading {}


/* Sub-object: `wk-datepicker-table`
========================================================================== */

/* Block element behavior */
.wk-datepicker-table { width: 100%; }

.wk-datepicker-table th,
.wk-datepicker-table td { padding: 2px; }

.wk-datepicker-table th { font-size: 12px; }

/*
 * Item
 */

.wk-datepicker-table a {
    display: block;
    width: @datepicker-table-width;
    line-height: @datepicker-table-height;
    text-align: center;
    color: @datepicker-table-color;
    text-decoration: none;
    .hook-datepicker-table-item;
}

/*
 * Sub-object: `wk-datepicker-table-muted`
 */

a.wk-datepicker-table-muted { color: @datepicker-table-muted-color; }

/*
 * Hover
 * 1. Apply hover style also to focus state
 * 2. Remove default focus style
 */

.wk-datepicker-table a:hover,
.wk-datepicker-table a:focus { // 1
    background-color: @datepicker-table-hover-background;
    color: @datepicker-table-hover-color;
    /* 2 */
    outline: none;
    .hook-datepicker-table-item-hover;
}

/* OnClick */
.wk-datepicker-table a:active {
    background-color: @datepicker-table-onclick-background;
    color: @datepicker-table-onclick-color;
    .hook-datepicker-table-item-onclick;
}

/*
 * Active
 */

.wk-datepicker-table a.wk-active {
    background: @datepicker-table-active-background;
    color: @datepicker-table-active-color;
    .hook-datepicker-table-item-active;
}


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

.hook-datepicker-misc;

.hook-datepicker-nav() {}
.hook-datepicker-nav-item() {}
.hook-datepicker-table-item() {}
.hook-datepicker-table-item-hover() {}
.hook-datepicker-table-item-onclick() {}
.hook-datepicker-table-item-active() {}
.hook-datepicker-misc() {}