/**
* Bookings 
*
* @TODO: Move to /forms and /lists 
*
*/

@use "../../../global/sass/partials/variables";

#ui-datepicker-div {
    display: none;
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;

    .ui-datepicker-calendar {
        margin-top: 1rem;
        margin-bottom: 1rem;
        min-width: 10rem;
        text-align: center;

        td a {
            color: var(--commonsbooking-color-accept);
        }
    }

    .ui-datepicker-next,
    .ui-datepicker-prev {
        cursor: pointer;
    }

    .ui-datepicker-next {
        right: 1.5rem;
        position: absolute;
    }

    .ui-datepicker-title {
        margin-top: 1rem;
        color: black;
        clear: both;
    }

    .ui-corner-all {
        color: var(--commonsbooking-color-accept);
    }
}

.booking-list {
    &--filters {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;

        @media (max-width: 400px) {
            width: 100%;
        }

        .filter-wrapper {
            @include variables.font-default;
            margin-top: 10px;
            flex-basis: 220px;

            .filter-label {
                margin-bottom: 0.3rem;
                margin-left: 0;
                font-size: 1rem;
            }
        }

        .select2 {
            width: 100%;
            padding: 0.25rem 0.5rem;
            border: none;
        }

        #endDate-datepicker,
        #startDate-datepicker {
            width: 100%;
            padding: 0.25rem 0.5rem;
            border: none;
        }

        .reset-filters {
            justify-content: flex-end;
            display: flex;
            flex-basis: 100%;

            #reset-filters {
                font-size: 0.95rem;
                padding-top: 5px;
                cursor: pointer;
            }

            & > .cb-button {
                margin-left: 1rem;
                cursor: pointer;
            }
        }

    }

    &--filters.hide {
        display: none;
    }

    #booking-list--results {
        @include variables.font-default;
        width: 100%;

        @media (min-width: 400px) {
        }

        .js-item {
            width: 100%;
            background-color: white;

            .content-wrapper {
                margin-bottom: 5px;
                font-size: 0.9em;

                display: flex;
                @media only screen and (max-width: 600px) {
                    display: block;
                }

                & > p,
                & > div {
                    display: flex;
                    margin: 0;
                    border-right: 1px dashed #ccc;
                    margin-right: 8px;
                    padding: 0 8px;

                    @media only screen and (max-width: 600px) {
                        border: none;
                        margin-bottom: 0;
                        padding: 4px 0;
                    }


                    &:last-child {
                        border: none;
                        align-items: center;
                    }
                }

                p {
                    span {
                        display: flex;

                        &.cb-date {
                            font-size: 0.8em;
                        }
                    }

                }

                h4 {
                    font-weight: bold;
                    font-size: 1.4rem;
                    padding: 0;
                }
            }

            &--headline {
                width: 40%;
                flex-direction: column;
            }

            &--infos {
                width: 40%;
                flex-direction: column;
            }

            &--action {
                width: 20%;

                height: 40px;
                padding: 0;

                display: flex;
                flex-direction: row-reverse;

                //a {
                //    font-size: 0.825em;
                //    padding: 4px 20px;
                //    margin: 0 8px;
                //    height: 30px;
                //    span {
                //        vertical-align: middle;
                //    }
                //}
            }


            @media only screen and (max-width: 600px) {
                &--headline,
                &--infos,
                &--action {
                    width: 100%;
                }
            }
        }

        .my-sizer-element {
            clear: both;
        }
    }

    .cb-dropdown {

        position: relative;
        display: inline-block;

        .cb-dropbtn::after {
            content: '\2807';
            font-size: 25px;
            color: var(--commonsbooking-color-buttons);
            border: none;
            cursor: pointer;
        }
    
        .cb-dropdown-content {
            display:none;
            position:absolute;
            right: 0;
            background-color: var(--commonsbooking-color-bg);
            filter: brightness(95%);
            box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
            overflow: auto;
            min-width: 160px;
            z-index: 1;

            border-radius: 5%;
            border-style: solid;
            border-color: var(--commonsbooking-color-bg);
            border-width: 10px;

            &:hover{
                filter:brightness(90%);
            }
        }

        #icallink_text::after {
            content: '?';
            display: inline-block;
            font-family: sans-serif;
            font-weight: bold;
            text-align: center;
            width: 2.5ex;
            height: 2.5ex;
            font-size: 1.6ex;
            line-height: 2ex;
            border-radius: 1.4ex;
            margin-left: 0.4ex;
            padding: 1px;
            color: black;
            border: 1px solid black;
            text-decoration: none;
            vertical-align: top;
            cursor: pointer;
        }

        #icallink_text:hover:after {
            color:white;
            background: var(--commonsbooking-color-primary);
            border-color: white;
        }

    }

    #booking-list--pagination {
        @include variables.font-default;

        ul {
            display: flex;
            justify-content: center;
            padding: 0;

            li {
                list-style-type: none;
                position: relative;
                padding: 0 5px 0 5px;

                &.active {
                    font-weight: bold;
                }

                &:hover {
                    color: #84AE53;
                }

            }

            li[data-page] {
                cursor: pointer;
            }

        }
    }
}
