/** Mobile & Desktop Common Styles */

.calentim-container,
.calentim-container-mobile {
    font-size: 15px;
    float: left;
    font-family: $calentim-font-family;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    z-index: 999999;
    -webkit-font-smoothing: antialiased;
    font-kerning: normal;
    -webkit-font-kerning: normal;
    -webkit-text-size-adjust: 100%;

    &:focus {
        box-shadow: none;
        outline: none;
    }

    .calentim-input {
        margin: 5px;
        border: $calentim-container-border;
        border-radius: 6px;
        overflow: hidden;
        top: inherit;
        background: $calentim-container-background;
        display: flex;
        flex-direction: column;
        &.calentim-input-vertical-range {
            flex-direction: row;

            .calentim-left {
                border-right: $calentim-container-border;
            }

            .calentim-right {
                position: relative;
                display: flex;
                flex-direction: column;
                background: $calentim-vertical-ranges-background;
                flex: 1;

                .calentim-ranges {
                    border-top: none;
                    display: flex;
                    flex-direction: column;
                    padding: 0;
                    padding-bottom: 24px;
                    overflow-y: auto;
                    overflow-x: hidden;
                    background: $calentim-vertical-ranges-background;
                    flex: 1;

                    .calentim-range-header-container {
                        padding: 8px 12px;
                    }

                    .calentim-range {
                        flex: 0;
                        padding: 8px 12px;
                        margin: 3px 6px;
                        background: $calentim-vertical-ranges-button-background;
                        border: $calentim-vertical-ranges-button-border;
                        color: $calentim-vertical-ranges-button-text;
                        border-radius: 3px;

                        &.calentim-range-selected,
                        &.calentim-range-selected:hover {
                            background: $calentim-vertical-ranges-selected-button-background;
                            border: $calentim-vertical-ranges-selected-button-border;
                            color: $calentim-vertical-ranges-selected-button-text;
                        }

                        &:hover {
                            background: $calentim-vertical-ranges-button-hover-background;
                            border: $calentim-vertical-ranges-button-hover-border;
                            color: $calentim-vertical-ranges-button-hover-text;
                        }
                    }
                }

                .calentim-footer {
                    border-top: $calentim-container-border;
                    flex: 0 1 auto;
                }
            }
        }

        .calentim-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            padding: 20px 20px 10px 20px;
            border-bottom: $calentim-header-bottom-border;
            background: $calentim-header-background;

            .calentim-header-separator {
                flex: 0;
                display: block;
                margin: 0;
                margin-top: -2px;
                padding: 0 16px;
                color: $calentim-header-separator-color;
                font-size: 32px;
            }

            .calentim-header-start,
            .calentim-header-end {
                flex: 1;
                white-space: nowrap;
                display: block;
                margin-right: 10px;
                text-align: left;

                .calentim-header-start-day,
                .calentim-header-end-day {
                    float: left;
                    font-size: 2.5em;
                    color: $calentim-header-big-day-number-text;
                    margin-top: -8px;
                    margin-right: 8px;
                    font-weight: 100;
                    text-align: left;
                }

                .calentim-header-start-date,
                .calentim-header-end-date {
                    font-size: 0.9em;
                    color: $calentim-header-month-year-text;
                    display: inline-block;
                }

                .calentim-header-start-weekday,
                .calentim-header-end-weekday {
                    font-size: 0.7em;
                    color: $calentim-header-dayname-text;
                }
            }
        }

        .calentim-calendars {
            position: relative;
            display: flex;
            box-sizing: border-box;

            .calentim-month-selector,
            .calentim-year-selector {
                position: absolute;
                display: none;
                border: 0px solid transparent;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                z-index: 100;

                .calentim-ms-month,
                .calentim-ms-month-disabled {
                    background: $calentim-year-month-selector-buttons-background;
                    height: 33.33%;
                    width: 25%;
                    font-weight: bold;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    box-sizing: border-box;
                    float: left;
                    outline: $calentim-year-month-selector-buttons-border;
                    word-break: break-word;
                    word-wrap: break-word;
                    text-transform: capitalize;
                    cursor: pointer;
                    color: $calentim-year-month-selector-buttons-text;

                    &.current {
                        background: $calentim-year-month-selector-buttons-active-background;
                        outline: $calentim-year-month-selector-buttons-active-border;
                        color: $calentim-year-month-selector-buttons-active-text;
                    }
                }
                .calentim-ms-month-disabled,
                .calentim-ms-month-disabled:hover {
                    background: $calentim-year-month-selector-buttons-disabled-background;
                    border: $calentim-year-month-selector-buttons-disabled-border;
                    color: $calentim-year-month-selector-buttons-disabled-text;
                    cursor: default;
                }
                .calentim-ys-year,
                .calentim-ys-year-disabled,
                .calentim-ys-year-next,
                .calentim-ys-year-prev {
                    margin: 0px;
                    background: $calentim-year-month-selector-buttons-background;
                    height: 33.33%;
                    width: 20%;
                    align-items: center;
                    justify-content: center;
                    font-weight: bold;
                    display: flex;
                    float: left;
                    box-sizing: border-box;
                    outline: $calentim-year-month-selector-buttons-border;
                    text-transform: uppercase;
                    word-wrap: break-word;
                    word-break: break-all;
                    cursor: pointer;
                    color: $calentim-year-month-selector-buttons-text;

                    &.current {
                        background: $calentim-year-month-selector-buttons-active-background;
                        outline: $calentim-year-month-selector-buttons-active-border;
                        color: $calentim-year-month-selector-buttons-active-text;
                    }
                }
                .calentim-ys-year-disabled,
                .calentim-ys-year-next,
                .calentim-ys-year-prev {
                    font-size: 2.65em;
                    background: $calentim-year-month-selector-arrows-background;
                    color: $calentim-year-month-selector-arrows-text;
                }
                .calentim-ys-year-disabled,
                .calentim-ys-year-disabled:hover {
                    background: $calentim-year-month-selector-buttons-disabled-background;
                    border: $calentim-year-month-selector-buttons-disabled-border;
                    color: $calentim-year-month-selector-buttons-disabled-text;
                    cursor: default;
                }
            }

            .calentim-calendar {
                flex: 1;
                float: left;
                padding-bottom: 8px;
                border-right: $calentim-container-border;
                box-sizing: border-box;
                z-index: 99;

                &.no-border-right {
                    border-right: none;
                }

                &.calentim-calendar-weeknumbers {
                    .calentim-days-container {

                        .calentim-dayofweek,
                        .calentim-day,
                        .calentim-disabled,
                        .calentim-weeknumber {
                            width: calc(100% / 8);

                            @media all and (-ms-high-contrast: none) {
                                width: calc((100% / 8) - 1px);
                            }
                        }
                    }
                }

                .calentim-title {
                    text-align: center;
                    font-weight: 300;
                    flex: 0;
                    color: $calentim-calendar-header-text;
                    text-transform: capitalize;
                    border-bottom: $calentim-calendar-header-bottom-border;
                    background: $calentim-calendar-header-background;
                    padding: 6px 12px;
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    font-size: 1.2em;

                    .calentim-prev,
                    .calentim-next {
                        font-size: 1em;
                        cursor: hand;
                        cursor: pointer;
                        i {
                            color: $calentim-calendar-header-arrow-color;
                            cursor: pointer;
                        }
                    }

                    .calentim-prev {
                        float: left;
                    }

                    span {
                        flex: 1;
                    }

                    .calentim-next {
                        float: right;
                    }
                }

                .calentim-days-container {
                    padding: 10px;
                    display: flex;
                    flex-wrap: wrap;
                    flex-direction: row;

                    .calentim-dayofweek,
                    .calentim-day,
                    .calentim-disabled,
                    .calentim-weeknumber {
                        width: calc(100% / 7);

                        @media all and (-ms-high-contrast: none) {
                            width: calc((100% / 7) - 1px);
                        }

                        text-align: center;
                        padding: 3px;
                        font-size: .76em;
                        font-weight: 400;
                        -webkit-box-sizing: border-box;
                        -moz-box-sizing: border-box;
                        box-sizing: border-box;
                        margin: 0;
                        margin-bottom: 1px;

                        span {
                            pointer-events: none;
                            display: block;
                            padding: 3px 3px 3px 4px;
                            border-radius: 4px;
                        }
                    }

                    .calentim-dayofweek {
                        text-transform: uppercase;
                        font-size: 0.6em;
                        font-weight: 600;
                        color: $calentim-calendar-weekdays-text;
                        background: $calentim-calendar-weekdays-background;
                    }

                    .calentim-weeknumber {
                        background-color: $calentim-calendar-weeks-background;
                        color: $calentim-calendar-weeks-text;
                        border: $calentim-calendar-weeks-border;
                        border-width: $calentim-calendar-weeks-border-width;
                    }

                    .calentim-day {
                        cursor: pointer;
                        overflow: hidden;
                        color: $calentim-calendar-days-text;
                        background: $calentim-calendar-days-background;
                        outline: $calentim-calendar-days-border;
                        position: relative;
                        display: flex;
                        flex-direction: column;
                        justify-content: center;
                        align-items: stretch;
                        box-sizing: border-box;
                        transition: background-color .1s ease-out;

                        &.calentim-selected,
                        &.calentim-start,
                        &.calentim-end {
                            background: $calentim-calendar-days-selected-background;
                            color: $calentim-calendar-days-selected-text;

                            &.calentim-disabled {
                                background: $calentim-calendar-days-selected-disabled-background;
                                color: $calentim-calendar-days-selected-disabled-text;
                                opacity: $calentim-calendar-days-selected-disabled-transparency;

                                span {
                                    background: transparent !important;
                                }
                            }
                        }

                        &.calentim-selected.calentim-start {
                            border-radius: 6px 0 0 6px;
                            color: $calentim-calendar-days-selected-first-last-text;
                            span {
                                background: $calentim-calendar-days-selected-first-last-background;
                                border-radius: 4px;
                            }
                        }

                        &.calentim-selected.calentim-end {
                            border-radius: 0 6px 6px 0;
                            color: $calentim-calendar-days-selected-first-last-text;
                            span {
                                background: $calentim-calendar-days-selected-first-last-background;
                                border-radius: 4px;
                            }
                        }

                        &.calentim-selected.calentim-start.calentim-end {
                            border-radius: 6px !important;
                        }

                        &.calentim-hovered {
                            &:not(.calentim-selected) {
                                background-color: $calentim-calendar-days-hover-background;
                                color: $calentim-calendar-days-hover-text;

                                span {
                                    background-color: $calentim-calendar-days-hover-background;
                                }

                                &.calentim-disabled {
                                    opacity: .66;
                                }

                                &.calentim-hovered-first {
                                    border-top-left-radius: 6px;
                                    border-bottom-left-radius: 6px;
                                }

                                &.calentim-hovered-last {
                                    border-top-right-radius: 6px;
                                    border-bottom-right-radius: 6px;
                                }
                            }
                        }

                        &.calentim-today {
                            color: $calentim-calendar-days-today-text;
                            font-weight: bold;

                            &.calentim-hovered {
                                color: $calentim-calendar-days-hover-text;
                            }

                            &.calentim-selected {
                                color: $calentim-calendar-days-selected-text;
                                &.calentim-start, &.calentim-end {
                                    color: $calentim-calendar-days-selected-first-last-text !important;
                                }
                            }
                        }
                    }

                    .calentim-disabled.calentim-disabled-range {
                        color: $calentim-calendar-days-disabled-text;
                        &.calentim-selected,
                        &.calentim-start,
                        &.calentim-end {
                            background: $calentim-calendar-days-selected-disabled-background;
                            border-radius: 0;
                            &.calentim-today {
                                color: $calentim-calendar-days-selected-text !important;
                            }
                        }
                        &.calentim-start {
                            border-top-left-radius: 6px;
                            border-bottom-left-radius: 6px;
                            span {
                                background: $calentim-calendar-days-selected-first-last-text;
                            }
                        }
                        &.calentim-end {
                            border-top-right-radius: 6px;
                            border-bottom-right-radius: 6px;
                            span {
                                background: $calentim-calendar-days-selected-first-last-background;
                            }
                        }
                    }

                    .calentim-disabled {
                        background: $calentim-calendar-days-disabled-background;
                        color: $calentim-calendar-days-disabled-text;
                        &.calentim-selected,
                        &.calentim-start,
                        &.calentim-end {
                            background: $calentim-calendar-days-selected-disabled-background;
                            color: $calentim-calendar-days-selected-disabled-text;
                            border-radius: 0;
                            &.calentim-today {
                                color: $calentim-calendar-days-selected-disabled-text !important;
                            }
                        }
                        &.calentim-start {
                            border-top-left-radius: 6px;
                            border-bottom-left-radius: 6px;
                            span {
                                background: $calentim-calendar-days-selected-first-last-background
                            }
                        }
                        &.calentim-end {
                            border-top-right-radius: 6px;
                            border-bottom-right-radius: 6px;
                            span {
                                background: $calentim-calendar-days-selected-first-last-background;
                            }
                        }
                        &.calentim-weekend {
                            background: $calentim-calendar-days-disabled-background;
                            color: $calentim-calendar-days-disabled-text;
                        }
                    }

                    .calentim-weekend {
                        background: $calentim-calendar-days-weekend-background;
                        color: $calentim-calendar-days-weekend-text;
                        &.calentim-selected {
                            background: $calentim-calendar-days-selected-background;
                            color: $calentim-calendar-days-selected-text;
                        }
                    }
                    .calentim-not-in-month {
                        background: $calentim-calendar-days-not-in-month-background;
                        color: $calentim-calendar-days-not-in-month-text;
                        opacity: .65;
                        &.calentim-disabled {
                            background: $calentim-calendar-days-disabled-background;
                            color: $calentim-calendar-days-disabled-text;
                        }
                    }
                }

                .calentim-next,
                .calentim-prev {
                    cursor: pointer;
                    font-size: 1.25em;
                }

                .calentim-next {
                    float: right;
                }

                .calentim-prev {
                    float: left;
                }

                &:last-child {
                    border-right: none;
                }
            }
        }

        .calentim-timepickers {
            border-top: $calentim-container-border;
            text-align: left;
            display: flex;
            flex-direction: row;
            background: $calentim-timepickers-background;

            .calentim-timepicker {
                box-sizing: border-box;
                padding: 6px 5px;
                flex: 1 0 auto;
                display: flex;
                flex-direction: row;
                border-right: $calentim-container-border;

                &:last-child {
                    border-right: none;
                }

                .calentim-hour-minute-seperator {
                    display: flex;
                    color: $calentim-timepickers-separator-color;
                    font-size: 1.8em;
                    font-weight: bold;
                    align-items: center;
                    justify-content: center;
                    margin: 0 .1em;
                    margin-top: -2px;
                }

                .calentim-timepicker-ampm {
                    display: flex;
                    flex-direction: column;
                    margin-left: 5px;
                    font-size: 0.7em;
                    font-weight: bold;
                    color: $calentim-timepickers-ampm-button-text;

                    .calentim-timepicker-ampm-am {
                        flex: 1;
                        border: $calentim-timepickers-ampm-button-border;
                        border-radius: 4px 4px 0 0;
                        background: $calentim-timepickers-ampm-button-background;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        padding: 0 5px;
                        cursor: pointer;
                    }

                    .calentim-timepicker-ampm-pm {
                        flex: 1;
                        border: $calentim-timepickers-ampm-button-border;
                        border-radius: 0 0 4px 4px;
                        background: $calentim-timepickers-ampm-button-background;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        padding: 0 5px;
                        cursor: pointer;
                        margin-top: -1px;
                    }

                    .calentim-ampm-selected {
                        background: $calentim-timepickers-ampm-button-active-background;
                        border: $calentim-timepickers-ampm-button-active-border;
                        color: $calentim-timepickers-ampm-button-active-text;
                    }
                }

                .calentim-timepicker-hours-wrapper {
                    flex: 1;
                    display: flex;
                    flex-direction: column;

                    .calentim-timepicker-hours {
                        flex-wrap: nowrap;
                        display: flex;
                        flex-direction: column;
                        position: relative;
                        padding: 0;
                        margin: 0;
                        line-height: 1.4em;
                        height: 4.2em;
                        box-sizing: border-box;
                        color: $calentim-timepickers-picker-text;
                        border-radius: 6px 0 0 6px;
                        border: $calentim-timepickers-picker-border;
                        border-right: none;
                        text-align: center;
                        background: $calentim-timepickers-picker-background;

                        .calentim-hour-selected-prev {
                            transform: perspective(4em) rotateX(30deg);
                            color: $calentim-timepickers-picker-secondary-text;
                            opacity: .5;
                            transform-origin: bottom;
                        }

                        .calentim-hour-selected {
                            color: $calentim-timepickers-picker-text;
                            min-width: 64px;
                            font-size: 1.5em;
                            font-weight: bold;
                        }

                        .calentim-hour-selected-next {
                            transform: perspective(4em) rotateX(-30deg);
                            color: $calentim-timepickers-picker-secondary-text;
                            opacity: .5;
                            transform-origin: top;
                        }
                    }
                }

                .calentim-timepicker-minutes-wrapper {
                    flex: 1;
                    display: flex;
                    flex-direction: column;

                    .calentim-timepicker-minutes {
                        flex-wrap: nowrap;
                        display: flex;
                        flex-direction: column;
                        position: relative;
                        line-height: 1.4em;
                        height: 4.2em;
                        padding: 0;
                        margin: 0;
                        box-sizing: border-box;
                        color: $calentim-timepickers-picker-text;
                        background: $calentim-timepickers-picker-background;
                        border-radius: 6px 0 0 6px;
                        border: $calentim-timepickers-picker-border;
                        border-right: none;
                        text-align: center;

                        .calentim-minute-selected-prev {
                            transform: perspective(4em) rotateX(30deg);
                            color: $calentim-timepickers-picker-secondary-text;
                            opacity: .5;
                            transform-origin: bottom;
                        }

                        .calentim-minute-selected {
                            color: $calentim-timepickers-picker-text;
                            font-size: 1.5em;
                            min-width: 64px;
                            font-weight: bold;
                        }

                        .calentim-minute-selected-next {
                            transform: perspective(4em) rotateX(-30deg);
                            color: $calentim-timepickers-picker-secondary-text;
                            opacity: .5;
                            transform-origin: top;
                        }
                    }
                }

                .calentim-timepicker-hour-arrows,
                .calentim-timepicker-minute-arrows {
                    display: flex;
                    flex-direction: column;
                    align-items: center;
                    color: $calentim-timepickers-buttons-text;
                    justify-content: center;

                    .calentim-timepicker-hours-up,
                    .calentim-timepicker-minutes-up {
                        flex: 1;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        padding: 4px;
                        background: $calentim-timepickers-buttons-background;
                        border: $calentim-timepickers-buttons-border;
                        cursor: pointer;
                        border-top-right-radius: 6px;
                    }

                    .calentim-timepicker-hours-down,
                    .calentim-timepicker-minutes-down {
                        flex: 1;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        padding: 4px;
                        background: $calentim-timepickers-buttons-background;
                        border: $calentim-timepickers-buttons-border;
                        border-top: none;
                        cursor: pointer;
                        border-bottom-right-radius: 6px;
                    }
                }
            }
        }

        .calentim-ranges {
            border-top: $calentim-container-border;
            clear: both;
            padding: 10px;
            text-align: left;
            background: $calentim-horizontal-ranges-background;

            i {
                float: left;
                color: $calentim-ranges-title-icon-color;
                font-size: 14px;
                margin-right: 5px;
                margin-top: 1px;
            }

            .calentim-range-header {
                font-size: 0.8em;
                color: $calentim-ranges-title-icon-text;
                display: inline-block;
                margin-right: 5px;
                font-weight: bold;
            }

            .calentim-range {
                display: inline-block;
                color: $calentim-horizontal-ranges-range-text;
                margin: 3px;
                font-size: 0.7em;
                cursor: pointer;
                font-weight: bold;

                &.calentim-range-selected {
                    color: $calentim-horizontal-ranges-range-active-text;
                }
            }
        }
    }

    &.calentim-hotel-style {
        .calentim-calendar {
            .calentim-disabled-range-end {
                background-image: linear-gradient(45deg, $calentim-calendar-days-disabled-background 49%, transparent 50%) !important;
                &.calentim-selected {
                    background-image: none !important;
                }
            }
            .calentim-disabled-range-start {
                background-image: linear-gradient(225deg, $calentim-calendar-days-disabled-background 49%, transparent 50%) !important;
                &.calentim-selected {
                    background-image: none !important;
                }
            }
            .calentim-disabled-range-start.calentim-disabled-range-end {
                background-image: linear-gradient(45deg, $calentim-calendar-days-disabled-background 49%, transparent 50%) !important;
                &.calentim-selected {
                    background-image: none !important;
                }
            }
            .calentim-disabled-range-start.calentim-disabled-range-end.calentim-selected {
                background-image: none !important;
            }

            .calentim-disabled.calentim-disabled-range {
                color: $calentim-calendar-days-disabled-text;
                background: $calentim-calendar-days-disabled-background;
                &.calentim-selected,
                &.calentim-start,
                &.calentim-end {
                    background: $calentim-calendar-days-selected-background !important;
                    color: $calentim-calendar-days-selected-text !important;
                    border-radius: 0;
                    &.calentim-today {
                        color: $calentim-calendar-days-selected-text !important;
                    }
                }
                &.calentim-start {
                    border-top-left-radius: 6px;
                    border-bottom-left-radius: 6px;
                    span {
                        background: $calentim-calendar-days-selected-first-last-background;
                    }
                }
                &.calentim-end {
                    border-top-right-radius: 6px;
                    border-bottom-right-radius: 6px;
                    span {
                        background: $calentim-calendar-days-selected-first-last-background;
                    }
                }
            }

            .calentim-disabled-range-start.calentim-hovered {
                background: linear-gradient(45deg, $calentim-calendar-days-hover-background 49%, $calentim-calendar-days-disabled-background 50%) !important;
                border-radius: 0 !important;
            }

            .calentim-disabled-range-end.calentim-hovered {
                background: linear-gradient(225deg, $calentim-calendar-days-hover-background 49%, $calentim-calendar-days-disabled-background 50%) !important;
                border-radius: 0 !important;
            }

        }
    }
}

.calentim-container {
    &.calentim-hidden-calendar {
        .calentim-input {
            .calentim-timepickers {
                border-top: none;
            }
        }

        .calentim-box-arrow-top:after {
            border-bottom: $calentim-container-border;
        }
    }

    .calentim-input {
        .calentim-footer {
            text-align: right;
            background: $calentim-footer-background;

            .calentim-apply {
                background: $calentim-apply-button-background;
                border: $calentim-apply-button-border;
                padding: 6px 18px;
                color: $calentim-apply-button-text;
                font-family: $calentim-font-family;
                font-size: 12px;
                margin: 6px;
                border-radius: 3px;
                cursor: pointer;
                cursor: hand;

                &:disabled {
                    background: $calentim-apply-button-disabled-background;
                    color: $calentim-apply-button-disabled-text;
                }
            }

            .calentim-cancel {
                background: $calentim-cancel-button-background;
                border: $calentim-cancel-button-border;
                color: $calentim-cancel-button-text;
                padding: 6px 18px;
                margin: 6px;
                font-family: $calentim-font-family;
                font-size: 12px;
                margin-right: 0px;
                border-radius: 3px;
                cursor: pointer;
                cursor: hand;
            }
        }
    }
}