/* calendar.less */

// Calendar colour variables defined.
@calendarEventCategoryColor: #d8bfd8; // Pale purple.
@calendarEventCourseColor: #ffd3bd; // Pale red.
@calendarEventGlobalColor: #d6f8cd; // Pale green.
@calendarEventGroupColor:  #fee7ae; // Pale yellow.
@calendarEventUserColor:   #dce7ec; // Pale blue.

// Calendar event background colours defined.
.calendar_event_category {
    background-color: @calendarEventCategoryColor;
}
.calendar_event_course {
    background-color: @calendarEventCourseColor;
}
.calendar_event_site {
    background-color: @calendarEventGlobalColor;
}
.calendar_event_group {
    background-color: @calendarEventGroupColor;
}
.calendar_event_user {
    background-color: @calendarEventUserColor;
}

// Calendar restyling.
.path-calendar {
    .calendartable {
        width: 100%;
        table-layout: fixed;
        th,
        td {
            width: 14%;
            vertical-align: top;
            text-align: center;
            border: 0;
        }
    }
    .calendar-controls {
        .previous,
        .next,
        .current {
            display: block;
            float: left;
            width: 12%;
        }
        .previous {
            text-align: left;
            border: 1px solid transparent;
            box-sizing: border-box;
        }
        .current {
            text-align: center;
            width: 76%;
        }
        .next {
            text-align: right;
            border: 1px solid transparent;
            box-sizing: border-box;
        }
        .drop-target {
            box-sizing: border-box;
            border: 1px dashed @blue;
        }
    }
    .filters {
        table {
            border-collapse: separate;
            border-spacing: 2px;
            width: 100%;
        }
    }
    .maincalendar {
        vertical-align: top;
        padding: 0;
        .bottom {
            text-align: center;
            padding: 5px 0 0 0;
        }
        .heightcontainer {
            height: 100%;
            position: relative;
        }
        .calendarmonth {
            width: 98%;
            margin: 10px auto;

            ul {
                margin: 0;
                padding: 0;
                li {
                    list-style-type: none;

                    > a {
                        .text-truncate;
                        max-width: 100%;
                        display: inline-block;

                        &:hover {
                            text-decoration: none;

                            .eventname {
                                text-decoration: underline;
                            }
                        }
                    }

                    .icon {
                        margin-left: 0.25em;
                        margin-right: 0.25em;
                        padding: 0;
                        vertical-align: initial;
                    }

                    .badge {
                        &.badge-circle {
                            width: 12px;
                            height: 12px;
                            padding: 0;
                            border-radius: 6px;
                            vertical-align: middle;

                            &.calendar_event_category {
                                background-color: @calendarEventCategoryColor;
                            }

                            &.calendar_event_course {
                                background-color: @calendarEventCourseColor;
                            }

                            &.calendar_event_site {
                                background-color: @calendarEventGlobalColor;
                            }

                            &.calendar_event_group {
                                background-color: @calendarEventGroupColor;
                            }

                            &.calendar_event_user {
                                background-color: @calendarEventUserColor;
                            }
                        }
                    }
                }
            }
            td {
                height: 5em;
            }

            .clickable:hover {
                box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12);
            }
        }
        .calendar-controls {
            .previous,
            .next {
                width: 30%;
            }
            .current {
                width: 39.95%;
            }
        }
        .controls {
            width: 98%;
            margin: 10px auto;
        }
        .calendar_event_category,
        .calendar_event_course,
        .calendar_event_site,
        .calendar_event_group,
        .calendar_event_user {
            &:hover {
                a {
                    color: @linkColorHover;
                    text-decoration: underline;
                }
            }
        }
        .calendar_event_category {
            border-color: @calendarEventCategoryColor;
        }
        .calendar_event_course {
            border-color: @calendarEventCourseColor;
        }
        .calendar_event_site {
            border-color: @calendarEventGlobalColor;
        }
        .calendar_event_group {
            border-color: @calendarEventGroupColor;
        }
        .calendar_event_user {
            border-color: @calendarEventUserColor;
        }
        .calendar-controls {
            .current {
                font-family: @headingsFontFamily;
                font-weight: @headingsFontWeight;
                color: @headingsColor;
                font-size: 25px;
                line-height: 1.2;
            }
        }
        .calendartable {
            td,
            li {
                padding: 0 4px 4px 4px;
            }
            li {
                text-align: left;
            }
        }
        .header {
            overflow: hidden;
            .buttons {
                float: right;
            }
        }
        .eventlist {
            margin: 0;

            .event {
                border-spacing: 0;
                border-collapse: separate;
                position: relative;
                margin-bottom: 20px;
                list-style-type: none;

                > img {
                    padding-top: 3px;
                    float: left;
                }
                .name {
                    font-size: @fontSizeLarge;
                    font-weight: 200;
                    line-height: 24px;
                    float: left;
                    margin: 0;
                    margin-right: 0.5rem;
                }
                .name,
                .action {
                    margin-bottom: 5px;
                }
                .date {
                    float: right;
                }
                .subscription,
                .action {
                    float: left;
                    clear: left;
                }
                .side {
                    width: 22px;
                }
                .description {
                    background-color: @white;
                    clear: both;
                }
                .commands {
                    a {
                        margin: 0 3px;
                    }
                }
            }
        }
    }
}

// Calendar export.
#page-calendar-export {
    .indent {
        padding-left: 20px;
    }
}

// Block minicalendar.
.block {
    .minicalendar {
        max-width: 280px;
        margin: 0 auto;
        width: 100%;
        th,
        td {
            padding: 2px;
            font-size: 0.8em;
            text-align: center;
        }
        td {
            &.weekend {
                .muted;
            }
            a {
                width: 100%;
                height: 100%;
                display: block;
            }
            &.duration_global {
                border-top: 1px solid @calendarEventGlobalColor;
                border-bottom: 1px solid @calendarEventGlobalColor;
                &.duration_finish {
                    background-color: @calendarEventGlobalColor;
                }
            }
            &.duration_category {
                border-top: 1px solid @calendarEventCategoryColor;
                border-bottom: 1px solid @calendarEventCategoryColor;
                &.duration_finish {
                    background-color: @calendarEventCategoryColor;
                }
            }
            &.duration_course {
                border-top: 1px solid @calendarEventCourseColor;
                border-bottom: 1px solid @calendarEventCourseColor;
                &.duration_finish {
                    background-color: @calendarEventCourseColor;
                }
            }
            &.duration_group {
                border-top: 1px solid @calendarEventGroupColor;
                border-bottom: 1px solid @calendarEventGroupColor;
                &.duration_finish {
                    background-color: @calendarEventGroupColor;
                }
            }
            &.duration_user {
                border-top: 1px solid @calendarEventUserColor;
                border-bottom: 1px solid @calendarEventUserColor;
                &.duration_finish {
                    background-color: @calendarEventUserColor;
                }
            }
        }
        caption {
            font-size: inherit;
            font-weight: inherit;
            line-height: inherit;
            text-align: center;
        }
    }
    .calendar-controls {
        .previous,
        .current,
        .next {
            display: block;
            float: left;
        }
        .previous {
            text-align: left;
            width: 12%;
        }
        .current {
            text-align: center;
            width: 76%;
        }
        .next {
            text-align: right;
            width: 12%;
        }
    }
    .calendar_filters {
        ul {
            list-style: none;
            margin: 0;
        }
        li {
            margin-bottom: 0.2em;
            span {
                img {
                    margin: 0 0.25em;
                }
                .icon {
                    padding: 0 0.2em;
                }
            }
            .icon {
                padding: 0;
                margin-left: 0.25em;
            }

            > a {
                &:hover {
                    text-decoration: none;

                    .eventname {
                        text-decoration: underline;
                    }
                }
            }
        }
    }
    .content {
        h3 {
            &.eventskey {
                margin-top: 0.5em;
            }
        }
    }
}

@media (min-width: 768px) {
    #page-calender-view {
        .container-fluid {
            min-width: 1024px;
        }
    }
}

.calendarwrapper {
    position: relative;
}

.summary-modal-container {
    .description-content {
        > p {
            margin: 0;
        }
    }
}
