//
// Topbar
// --------------------------------------------------
.topbar {
    position: fixed;
    display: block;
    height: 50px;
    width: 100%;
    padding-left: 15px;
    padding-right: 15px;

    ul.nav {
        float: left;
    }

    ul.nav > li {
        float: left;
    }

    ul.nav > li > a {
        padding-top: 15px;
        padding-bottom: 15px;
        line-height: 20px;
    }

    .dropdown-footer {
        margin: 10px;
    }

    .dropdown-header {
        font-size: 16px;
        padding: 3px 10px;
        margin-bottom: 10px;
        font-weight: 300;
        color: @text-color-soft;

        .dropdown-header-link {
            position: absolute;
            top: 2px;
            right: 10px;

            a {
                color: @link !important;
                font-size: 12px;
                font-weight: normal;
            }
        }
    }

    .dropdown-header:hover {
        color: @text-color-soft;
    }
}

#topbar-first {
    background-color: @primary;
    top: 0;
    z-index: 1030;
    color: white;


    a.navbar-brand {
        height: 50px;
        padding: 5px;

        img#img-logo {
            max-height: 40px;
        }

    }

    a.navbar-brand-text {
        padding-top: 15px;
    }

    .nav > li > a:hover,
    .nav > .open > a {
        background-color: @primary-lighten-10;
    }

    .nav > .account {
        height: 50px;
        margin-left: 20px;

        img {
            margin-left: 10px;
        }

        .dropdown-toggle {
            padding: 10px 5px 8px;
            line-height: 1.1em;
            text-align: left;

            span {
                font-size: 12px;
            }

            #user-account-image {
                margin-bottom: 0;
            }
        }
    }

    .topbar-brand {
        position: relative;
        z-index: 2;
    }

    .topbar-actions {
        position: relative;
        z-index: 3;
    }

    .notifications {
        position: absolute;
        left: 0;
        right: 0;
        text-align: center;
        z-index: 1;

        .btn-group {
            position: relative;
            text-align: left;
        }

        .btn-group > a {
            padding: 5px 10px;
            margin: 10px 2px;
            display: inline-block;
            border-radius: 2px;
            text-decoration: none;
            text-align: left;
        }

        .btn-group > .label {
            position: absolute;
            top: 4px;
            right: -2px;
        }

        .arrow:after {
            position: absolute;
            display: block;
            width: 0;
            height: 0;
            border-color: transparent;
            border-style: solid;
            border-width: 10px;
            content: " ";
            top: 1px;
            margin-left: -10px;
            border-top-width: 0;
            border-bottom-color: #fff;
            z-index: 1035;
        }

        .arrow {
            position: absolute;
            display: block;
            width: 0;
            height: 0;
            border-color: transparent;
            border-style: solid;
            z-index: 1001;
            border-width: 11px;
            left: 50%;
            margin-left: -18px;
            border-top-width: 0;
            border-bottom-color: rgba(0, 0, 0, 0.15);
            top: -19px;
            z-index: 1035;
        }

        .dropdown-menu {
            width: 350px;
            margin-left: -148px;

            ul.media-list {
                max-height: 400px;
                overflow: auto;
            }

            li {
                position: relative;

                i.approval {
                    position: absolute;
                    left: 2px;
                    top: 36px;
                    font-size: 14px;
                }

                i.accepted {
                    color: #5cb85c;
                }

                i.declined {
                    color: #d9534f;
                }
            }

            li .media {
                position: relative;
            }

            li .media .img-space {
                position: absolute;
                top: 14px;
                left: 14px;
            }
        }
    }

    .dropdown-footer {
        margin: 10px 10px 5px;

        .btn.btn-default {
            border: 1px solid @default;
            box-shadow: none;

            &:hover {
                border-color: @background3;
                background: @background3;
            }

            &:active {
                border-color: @text-color-secondary;
                background: white;
            }
        }
    }

    a {
        color: white;
    }

    .caret {
        border-top-color: @text-color-contrast;
    }

    .btn-group > a {
        background-color: @primary-lighten-5;
    }

    .btn-enter {
        background-color: @primary-lighten-5;
        margin: 6px 0;
    }

    .btn-enter:hover {
        background-color: @primary-lighten-8;
    }

    .media-list {
        a {
            color: @text-color-highlight;
            padding: 0;
        }

        li {
            color: @text-color-highlight;

            i.accepted {
                color: @link !important;
            }

            i.declined {
                color: @danger !important;
            }
        }

        li.placeholder {
            border-bottom: none;
        }

        .media .media-body {
            .label {
                padding: 0.1em 0.5em;
            }
        }
    }

    .account .user-title {
        text-align: right;

        span {
            color: @background3;
        }
    }

    .dropdown.account > a,
    .dropdown.account.open > a,
    .dropdown.account > a:hover,
    .dropdown.account.open > a:hover {
        background-color: @primary;
    }
}

#topbar-second {
    top: 50px;
    background-color: #fff;
    z-index: 1029;
    background-image: none;
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid #d4d4d4;

    .dropdown-menu {
        padding-top: 0;
        padding-bottom: 0;

        .divider {
            margin: 0;
        }
    }

    // Space dropdown menu
    #space-menu-dropdown,
    #search-menu-dropdown {
        width: 400px;

        .media-list {
            max-height: 400px;
            overflow: auto;
        }

        @media screen and (max-width: 768px) {
            .media-list {
                max-height: 200px;
            }
        }

        form {
            margin: 10px;
        }

        .search-reset {
            position: absolute;
            color: #BFBFBF;
            margin: 7px;
            top: 0px;
            right: 40px;
            z-index: 10;
            display: none;
            cursor: pointer;
        }
    }

    .nav > li > a {
        padding: 7px 13px 0;
        text-decoration: none;
        text-shadow: none;
        font-weight: 600;
        font-size: 10px;
        min-height: 50px;
        text-transform: uppercase;
        text-align: center;

        &:hover,
        &:active,
        &:focus {
            border-bottom: 3px solid @info;
            background-color: @background-color-secondary;
            color: @text-color-highlight;
            text-decoration: none;
        }

        i {
            font-size: 14px;
        }

        .caret {
            border-top-color: @text-color-secondary;
        }
    }

    .nav > li.active > a {
        min-height: 47px;
    }

    .nav > li > ul > li > a {
        border-left: 3px solid #fff;
        background-color: #fff;
        color: @text-color-highlight;
    }

    .nav > li > ul > li > a:hover, .nav > li > ul > li > a.active {
        border-left: 3px solid @info;
        background-color: @background-color-secondary;
        color: @text-color-highlight;
    }

    .nav > li > a#space-menu {
        padding-right: 13px;
        border-right: 1px solid #ededed;
    }

    .nav > li > a#search-menu {
        padding-top: 15px;
    }

    .nav > li > a:hover,
    .nav > li.active {
        border-bottom: 3px solid @info;
        background-color: @background-color-secondary;
        color: @text-color-highlight;
    }

    .nav > li.active > a:hover, .nav > li.active > a:focus {
        border-bottom: none;
    }

    #space-menu-dropdown li > ul > li > a > .media .media-body p {
        color: @text-color-soft;
        font-size: 11px;
        margin: 0;
        font-weight: 400;
    }
}

@media (max-width: 767px) {
    .topbar {
        padding-left: 0;
        padding-right: 0;
    }
}