﻿@datepicker-color-grey: #EEEEEE;
@background-color-grey: #f3f3f3;
@border-thickness: 1px;

fb-form-datepicker {
    /* Override plugin */
    datepicker-inner {
        .text-info {
            color: inherit;
            font-weight: 700;
        }

        .well {
            border: none;
            margin: 0;
            background-color: @fb-color-white;
        }

        .well-sm {
            padding: 0;
        }

        button {
            &.btn {
                border: none;

                &:focus, &:focus:active {
                    outline: none;
                }
            }
        }

        thead {
            tr {
                &:first-child {
                    background-color: @background-color-grey;
                    border-bottom: solid @border-thickness @fb-color-grey-medium-dark;
                }

                &:nth-child(2) {
                    color: @fb-color-grey-medium;

                    th {
                        border-bottom: solid @border-thickness @fb-color-grey;
                        border-right: solid @border-thickness @fb-color-grey;
                        padding: 5px 10px;
                    }
                }
            }

            .btn-default {
                background-color: @background-color-grey;
                text-transform: capitalize;

                &:hover {
                    background-color: @background-color-grey;
                }

                &.disabled {
                    color: inherit;
                    background-color: inherit;
                }
            }

            th {
                &:nth-child(2) {
                    .btn {
                        margin-left: 2px;
                    }
                }
                .btn {
                    background-color: inherit !important;
                }
            }

            .glyphicon {
                font-size: 9px;
                color: @fb-color-grey-dark;
            }
        }
    }

    .datepicker__body-wrapper {
        font-family: "Open Sans", sans-serif;
        font-size: 13px;
        font-weight: normal;
    }

    .datepicker__body {
        &.btn-sm {
            padding: 0;
        }

        table {
            td {
                border-bottom: solid @border-thickness @fb-color-grey;
                border-right: solid @border-thickness @fb-color-grey;

                &:first-child {
                    color: @fb-color-grey-medium;
                }
            }
        }

        display: block;
        text-transform: capitalize;
    }

    .datepicker__dropdown-wrapper {
        position: absolute;
        margin-top: 10px; // TOP
        z-index: 10;
        background-color: @fb-color-white;
        border: solid @fb-color-grey 1px;
        border-radius: 2px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);

        &::before {
            content: '';
            display: inline-block;
            border-left: 7px solid transparent;
            border-right: 7px solid transparent;
            border-bottom-color: rgba(0, 0, 0, 0.2);
            position: absolute;
        }

        &::after {
            content: '';
            display: inline-block;
            border-left: 6px solid transparent;
            border-right: 6px solid transparent;
            position: absolute;
        }

        &.top {
            top: -285px;

            &::before {
                top: 262px;
                border-top: 7px solid #ccc;
                border-bottom: 0;
            }

            &::after {
                top: 262px;
                border-top: 6px solid #FFF;
                border-bottom: 0;
            }
        }

        &.bottom {
            top: 25px;

            &::before {
                top: -7px;
                border-top: 0;
                border-bottom: 7px solid #ccc;
            }

            &::after {
                top: -6px;
                border-top: 0;
                border-bottom: 6px solid @background-color-grey;
            }
        }

        &:extend(.datepicker-orient-left all);
    }

    .datepicker__today-button {
        &:extend(.btn all, .btn-sm all, .btn-block all);
        border-radius: 0;
        background-color: @fb-color-white;

        &:hover {
            background-color: @fb-color-grey-light;
        }
    }

    td {
        button {
            &.btn {
                border: none;
                border-radius: 0;
                padding: 5px 8px;
            }
        }
    }

    *:focus {
        outline: none;
    }
}
