@import 'core/css/variables';

/* layout */


html {
    // make footer sticky
    position: relative;
    min-height: 100%;
}
body {
    // make footer sticky
    @media (min-width: $screen-sm-max) {
        margin: 0 0 ($footer-content-height + $footer-bottom-height);
    }
}

main {
    padding-top: 70px;
    padding-bottom: 20px;

    @media (min-width: $screen-xs-max) {
        padding-top: 100px;
        padding-bottom: 100px;
    }
}

/* typography */

html, body {
    color: $text-color;
    background-color: $background-color;

    font-family: DroidSans, sans;
}

h1, h2, h3, h4 {
    color: $headline-color;
    background-color: $headline-background-color;
}
h1:first-child,
h2:first-child,
h3:first-child {
    margin-top: 0;
}

h1 {
    font-size: 32px;
    line-height: 40px;
}
h2 {
    font-size: 28px;
    line-height: 40px;
}
h3 {
    font-size: 24px;
    line-height: 30px;
}
h4 {
    font-size: 20px;
    line-height: 30px;
}
h5, h6 {
    font-size: normal;
    line-height: 20px;
}

form {
    margin-top: 20px;
    margin-bottom: 20px;
}

a,
.pagination > li > a {
    color: $link-color;

    &:visited {
        color: $link-color-visited;
    }
    &:hover {
        color: $link-color-hover;
    }
    &:focus {
        color: $link-color-focus;
    }
    &.btn-primary,
    &.btn-success,
    &.btn-info,
    &.btn-warning,
    &.btn-danger {
        color: white;
    }
    &.fa {
        text-decoration: none;
    }
}

blockquote {
    margin-bottom: 10px;
    padding: 5px 8px;
    font-size: inherit;
}

/* navbar */

.navbar-default {
    background-color: $navigation-background-color;
    border-bottom: none;

    .navbar-brand {
        color: $navigation-color;
        background-color: transparent;

        &:hover {
            color: $navigation-hover-color;
            background-color: $navigation-hover-background-color;
        }
    }

    .navbar-nav {
        li {
            a,
            a:focus,
            a:visited {
                color: $navigation-color;
                background-color: transparent;
            }
            a:hover {
                color: $navigation-hover-color;
                background-color: $navigation-hover-background-color;
            }
        }

        > .open {
            > a,
            > a:focus,
            > a:hover,
            > a:visited,
            button.btn-link {
                color: $navigation-hover-color;
                background-color: $navigation-hover-background-color;
            }

            .dropdown-menu {
                @media (min-width: $screen-xs-max) {
                    max-height: 600px;
                    overflow-y: auto;
                }

                > li {
                    > a,
                    > a:focus,
                    > a:visited,
                    button.btn-link {
                        color: $navigation-dropdown-color;
                        background-color: transparent;
                    }
                    > a:hover,
                    button.btn-link:hover {
                        color: $navigation-dropdown-hover-color;
                        background-color: $navigation-dropdown-hover-background-color;
                    }

                    @media (max-width: $screen-xs-max) {
                        // same as .navbar-nav li a
                        > a,
                        > a:focus,
                        > a:visited,
                        button.btn-link {
                            color: $navigation-color;
                            background-color: transparent;
                        }
                        > a:hover,
                        button.btn-link:hover {
                            color: $navigation-hover-color;
                            background-color: $navigation-hover-background-color;
                        }
                        button.btn-link {
                            padding: 5px 20px;
                        }
                    }
                }

                .sub-menu {
                    padding: 0;

                    > li {
                        list-style-type: none;

                        > a {
                            display: block;
                            padding: 3px 20px 3px 30px;
                        }

                        > a,
                        > a:focus,
                        > a:visited {
                            text-decoration: none;
                            color: $navigation-dropdown-color;
                            background-color: transparent;
                        }
                        > a:hover {
                            text-decoration: none;
                            color: $navigation-dropdown-hover-color;
                            background-color: $navigation-dropdown-hover-background-color;
                        }

                        @media (max-width: $screen-xs-max) {
                        // same as .navbar-nav li a
                            > a,
                            > a:focus,
                            > a:visited,
                            button.btn-link {
                                color: $navigation-color;
                                background-color: transparent;
                            }
                            > a:hover,
                            button.btn-link:hover {
                                color: $navigation-hover-color;
                                background-color: $navigation-hover-background-color;
                            }
                            button.btn-link {
                                padding: 5px 20px;
                            }
                        }
                    }
                }
            }
        }
    }
}

/* footer */

footer {

    // give the footer a fixed height and make it sticky
    @media (min-width: $screen-sm-max) {
        // make footer sticky
        position: absolute;
        left: 0;
        bottom: 0;
        width: 100%;
        overflow: hidden;

        .content {
            height: $footer-content-height;
        }
    }

    .content {
        padding-top: 40px;
        padding-bottom: 40px;

        color: $footer-content-color;
        background-color: $footer-content-background-color;

        a {
            color: $footer-content-link-color;

            &:visited {
                color: $footer-content-link-color-visited;
            }
            &:hover {
                color: $footer-content-link-color-hover;
            }
            &:focus {
                color: $footer-content-link-color-focus;
            }

            &.fa {
                text-decoration: none;
            }
        }
    }

    .bottom {
        min-height: $footer-bottom-height;

        p {
            margin: 0;

            @media (min-width: $screen-xs-max) {
                display: inline-block;
                margin-right: 20px;
            }
        }

        padding-top: 15px;
        padding-bottom: 15px;

        color: $footer-bottom-color;
        background-color: $footer-bottom-background-color;

        a {
            color: $footer-bottom-link-color;

            &:visited {
                color: $footer-bottom-link-color-visited;
            }
            &:hover {
                color: $footer-bottom-link-color-hover;
            }
            &:focus {
                color: $footer-bottom-link-color-focus;
            }

            &.fa {
                text-decoration: none;
            }
        }
    }

    .text-right {
        @media (max-width: $screen-sm-max) {
            text-align: left;
        }
    }
}

/* modals */

.modal-body {
    max-height: calc(100vh - 225px);
    overflow-y: auto;

    img {
        max-width: 100%;
    }
    dl {
        margin-top: 5px;
        margin-bottom: 0;
    }
    dl:first-child {
        margin-top: 0;
    }
}

.modal-seperator {
    margin-left: -15px;
    margin-right: -15px;
    margin-top: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid #e5e5e5;
}

/* daiquiri-widget */

.daiquiri-widget {
    border: 1px solid $border-color;
    padding: 10px 15px;

    margin-bottom: 20px;

    &:last-child {
        margin-bottom: 0;
    }

    .caption {
        margin-top: 5px;
        margin-bottom: 0;
    }
}

/* panel */

.panel {
    .panel-body p:last-child,
    .panel-body dl:last-child {
        margin-bottom: 0;
    }

    .panel-footer {
        ul, p {
            margin: 0;
        }
    }

    li {
        &.list-group-link {
            padding: 0;
        }
        &.list-group-link:last-child > a {
            border-bottom-right-radius: 4px;
            border-bottom-left-radius: 4px;
        }
        &.list-group-link > a {
            text-decoration: none;
            display: block;
            padding: 10px 15px;
        }
        &.list-group-link > a:hover {
            color: $panel-hover-color;
            background-color: $panel-hover-background-color;
        }
        &.list-group-link > a.active {
            text-decoration: none;
            color: $panel-active-color;
            background-color: $panel-active-background-color;
        }
    }
}

/* forms */

fieldset {
    margin-top: 10px;
    margin-bottom: 10px;
}

div.control-label {
    margin-bottom: 5px;
    font-weight: bold;
}

.daiquiri-multi-checkbox >:first-child {
    margin-top: 0;
}
.daiquiri-multi-checkbox > :last-child {
    margin-bottom: 0;
}

div.fieldset {
    margin-bottom: 20px;
}

.form-group {
    .radio {
        margin-top: 0px;
        margin-bottom: 5px;
    }

    .file {
        input {
            padding-bottom: 100px;
        }
    }
}

.form-inline-button {
    margin-top: 25px;
}

/* misc */

.expand {
    display: block;
    width: 100%;
}

.break {
    word-wrap: break-word;
}

.hide-overflow {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-form,
.connections-form {
    label {
        display: block;
        margin: 0;
        line-height: 40px;
        border-bottom: 1px solid $modal-border-color;

        &:first-child {
            border-top: 1px solid $modal-border-color;
        }

        input {
            margin-left: 5px;
            margin-right: 5px;
        }
    }
}
.email-form .email-form-buttons,
.connections-form .connections-form-buttons {
    margin-top: 10px;
}

.socialaccount_providers {
    margin: 0;
    padding: 0;
    height: 42px;

    li {
        float: left;
        margin-right: 10px;
        list-style: none;
    }
}
.socialaccount_provider_name {
    line-height: 29px;
    font-weight: bold;
}

.logout-form {
    margin: 0;

    .btn-link {
        padding: 3px 20px;
        display: block;
        width: 100%;
        text-align: left;
        border: none;
        clear: both;
        font-weight: 400;
        line-height: 1.42857143;
        white-space: nowrap;
    }
    .btn-link:hover {
        color: $navigation-dropdown-hover-color;
        background-color: $navigation-dropdown-hover-background-color;
        text-decoration: none;
    }
    .btn-link:focus {
        color: $navigation-dropdown-hover-color;
        background-color: $navigation-dropdown-hover-background-color;
        text-decoration: none;
        outline: none;
    }
}

.pager-vertical {
    a {
        margin-bottom: 10px;

        display: block;
        width: 100%;
    }
}

.table-fixed {
    table-layout: fixed;
}

.w-50 {
    width: 50%;
}
.w-75 {
    width: 75%;
}
.w-100 {
    width: 100%;
}
