// For the datepicker and the calendar inside it

.wcv-datepicker-wrapper {
    position: relative;
}

.wcv-datepicker-wrapper input { 
    width: 100%; 
}

.wcv-datepicker-calendar {
    margin-top: 0;  // because of the * + * rule
    position: absolute;

    &.right {
        left: 100%;
        top: 0;
    }

    &.left {
        right: 100%;
        top: 0;
    }

    &.bottom {
        top: 100%;
        left: 0;
    }

    &.top {
        bottom: 100%;
        left: 0;
    }
}

.wcv-datepicker-wrapper, .wcv-datepicker-calendar {
    display: inline;
    display: inline-block;
}

.wcv-calendar {
    @include border-radius($border-radius);
    text-align: center;
    padding: $calendar-padding;
    min-width: $calendar-total-width;

    font-size: $datepicker-fontSize;
    @include box-shadow(rgba(0,0,0,0.4) 0 1px 2px 0);
    background: $datepicker-bgColor;
    z-index:$layer-10;

    a {
        text-decoration: none;
    }
    
    li {
        list-style: none inside;
    }
}

// When a modal is open...
html.wcv-modal-is-open .wcv-calendar {
    z-index: $layer-100 + 1;  // 1 plus the z-index of a modal
}

.wcv-calendar-top-options {
    padding: 5px; 
    font-size: .813em;
    cursor: pointer;
    
    .clean { float: left; }
    .close { float: right; }
}
    
.wcv-calendar-top {
    line-height: 2em;
    background: $datepicker-header-bg;
    @include border-radius($border-radius);

    div { float:left; }

    .wcv-calendar-prev,
    .wcv-calendar-next {
        width: 10%;

        a {
           display: block;
        }
    }

    .wcv-calendar-month_desc {
        width: 80%
    }
}   

.wcv-calendar-month,
.wcv-calendar-year-selector,
.wcv-calendar-month-selector {
    margin-top: .5em;
    padding-left: 0;

    li {
        a {
            margin: 0px;
            line-height: 2em;
            vertical-align: middle;
            display: block;
            @include border-radius($border-radius);
            color: $datepicker-cell-color;

            &:hover { background: $datepicker-cellHover; }

            &.wcv-calendar-on, 
            &.wcv-calendar-on:hover {
                background: $datepicker-active-bg;
                color: $datepicker-active-color;
            }

            &.wcv-calendar-off,
            &.wcv-calendar-off:hover {
                background: $datepicker-bgColor;
                color: $datepicker-inactive-color;
                cursor: default;
            }
        } 
    }

    ul {
        clear: both; 
        padding-left:0;

        li {
            width: $calendar-cell-width; 
            float: left; 
            text-align: center;
            padding: 0;
            margin: 0;
        }
    }
}

.wcv-calendar-year-selector ul li { width: 25%; }
.wcv-calendar-month-selector ul li { width: 25%; }

.wcv-calendar-year-selector,
.wcv-calendar-month-selector { 
    display: none; 
}

.wcv-calendar-off, .action_inactive {
    color: #ddd !important;
}

.wcv-calendar-month .wcv-calendar-header {
    border-bottom: 1px solid rgba(0,0,0,.1); 
    padding-bottom: .5em;
    margin-bottom: .5em;
    color: #aaa;
}

.wcv-calendar-top,
.wcv-calendar-middle,
.wcv-calendar-top-options,
.wcv-calendar-month .wcv-calendar-header,
.wcv-calendar-month .wcv-calendar-middle ul {
    @include pie-clearfix;
}
