/*!
 * Styling for Pikaday
 * Copyright © 2014 David Bushell | BSD & MIT license | http://dbushell.com/
 */

// Variables
// Declare any of these variables before importing this SCSS file to easily override defaults
// Variables are namespaced with the pd (pikaday) prefix

// Colours
$pd-text-color: $color-gray-001 !default;
$pd-title-color: $color-gray-001 !default;
$pd-title-bg: $color-gray-006 !default;
$pd-picker-bg: #fff !default;
$pd-picker-border: $outer-border !default;
$pd-picker-border-inner: $inner-border !default;
$pd-picker-border-bottom: $outer-border !default;
$pd-picker-shadow: rgba(0,0,0,.5) !default;
$pd-body-bg: $color-gray-006 !default;
$pd-th-color: $color-gray-001 !default;
$pd-day-color: $color-gray-001!default;
$pd-day-bg: #fff !default;
$pd-day-hover-color: #fff !default;
$pd-day-hover-bg: $color-black !default;
$pd-day-today-color: $color-black!default;
$pd-day-selected-color: #fff !default;
$pd-day-selected-bg: $color-black !default;
$pd-day-disabled-color: #aeb0b5 !default;
$pd-week-color: #999 !default;
$pd-next-icon: $icons-folder-path + "/arrow-left.svg" !default;
$pd-previous-icon: $icons-folder-path + "/arrow-right.svg" !default;

// Font
$pd-font-family: $font-family !default;
$pd-font-size: $body-text;

.js-calendar-datepicker{
    cursor: pointer;
}

.pika-single {
    z-index: 9999;
    display: block;
    position: relative;
    color: $pd-text-color;
    background: $pd-picker-bg;
    border: $pd-picker-border;
    border-bottom: $pd-picker-border-bottom;
    font-family: $pd-font-family;

    &.is-hidden {
        display: none;
    }

    &.is-bound {
        position: absolute;
        box-shadow: 0 5px 15px -5px $pd-picker-shadow;
    }
}

// clear child float (pika-lendar), using the famous micro clearfix hack
// http://nicolasgallagher.com/micro-clearfix-hack/
.pika-single {
    *zoom: 1;

    &:before,
    &:after {
        content: " ";
        display: table;
    }

    &:after { clear: both }

    *:focus{
        outline: none;
    }
}

.pika-lendar {
    float: left;
    //width: 240px;
    //margin: 8px;
}

.pika-title {
    position: relative;
    text-align: center;
    max-height: 38px;
    border-bottom: $inner-border;
    background-color: $pd-title-bg;

    select {
        cursor: pointer;
        position: absolute;
        z-index: 9998;
        margin: 0;
        left: 0;
        top: 5px;
        filter: alpha(opacity=0);
        opacity: 0;
    }
}

.pika-label {
    display: inline-block;
    position: relative;
    z-index: 9999;
    overflow: hidden;
    margin: 0;
    padding: 7px 3px;
    color: $pd-title-color;
    //@include form-label-text();
    font-size: $form-label;
    line-height: $form-label-line-height;
    font-weight: $font-weight-semibold;
    color: $color-black;
    text-transform: none;
}

.pika-prev,
.pika-next {
    display: block;
    cursor: pointer;
    position: relative;
    outline: none;
    border: 0;
    padding: 0;
    width: 37px;
    height: 37px;
    text-indent: 37px; // hide text using text-indent trick, using width value (it's enough)
    white-space: nowrap;
    overflow: hidden;
    background-color: transparent;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: 20px;
    *position: absolute;
    *top: 0;

    &:hover {
        opacity: 1;
    }

    &.is-disabled {
        cursor: default;
        opacity: .2;
    }
}

.pika-prev,
.is-rtl .pika-next {
    float: left;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z'%3E%3C/path%3E%3C/svg%3E");
    *left: 0;
}

.pika-next,
.is-rtl .pika-prev {
    float: right;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z'%3E%3C/path%3E%3C/svg%3E");
    *right: 0;
}

.pika-select {
    display: inline-block;
    *display: inline;
}

.pika-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    border: 0;
    
    tbody{
        background-color: $pd-body-bg;
    }
    th,
    td {
        @include media-breakpoint-up(md) {
            min-width: 52px;
        }
        //padding: 8px;
    }

    th {
        color: $pd-th-color;
        font-size: $pd-font-size;
        font-weight: 400;
        text-align: center;
        padding: 8px 4px;
        border-bottom: $pd-picker-border-inner;
        @include media-breakpoint-up(md) {
            padding: 8px;
        }
    }
    td:not(.is-disabled):not(.is-empty){
        border: $pd-picker-border-inner;
        background-color: #fff;
        
        &:first-child{
            border-left: none;
        }
    }
    tr:last-child{
        td:not(.is-disabled):not(.is-empty){
            border-bottom: none;
        }
    }

    abbr {
        border-bottom: none;
        text-decoration: none;
    }
}

.pika-button {
    cursor: pointer;
    display: block;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    outline: none;
    border: 0;
    margin: 0;
    width: 100%;
    padding: 8px;
    color: $pd-day-color;
    font-size: $pd-font-size;
    //line-height: 15px;
    text-align: right;
    background: $pd-day-bg;
    font-weight: $font-weight-medium;

    .is-today & {
        color: $pd-day-today-color;
    }

    .is-selected & {
        color: $pd-day-selected-color;
        background: $pd-day-selected-bg;
    }

    .is-disabled &,
    .is-outside-current-month & {
        color: $pd-day-disabled-color;
        font-weight: $font-weight-normal;
        background-color: transparent;
    }

    .is-disabled & {
        pointer-events: none;
        cursor: default;
    }

    &:hover {
        color: $pd-day-hover-color;
        background: $pd-day-hover-bg;
        box-shadow: none;
    }

    .is-selection-disabled {
        pointer-events: none;
        cursor: default;
    }
}

.pika-week {
    font-size: 11px;
    color: $pd-week-color;
}

.is-inrange .pika-button {
    background: #D5E9F7;
}

.is-startrange .pika-button {
    color: #fff;
    background: #6CB31D;
    box-shadow: none;
}

.is-endrange .pika-button {
    color: #fff;
    background: #33aaff;
    box-shadow: none;
}
