$background: #333;
$hoverBackground: #222;
$activeBackground: $hoverBackground;
$foreground: white;
$lightgrey: #eee;
$titleFontSize: $font-size-h1 - 10px;
$titleMarginBottom: 20px;
$mainPadding: 20px;
$condensedNavPadding: 5px;

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: block;
    padding: $mainPadding;
    overflow-x: hidden;
    overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */
    background-color: $background;
    color: white;
}

.collapse {
    display: block;
}

/* Sidebar elements */
.link {
    color: $foreground;
    text-decoration: none;
}

.link:hover {
    color: $foreground;
    background-color: $hoverBackground !important;
    text-decoration: none;
}

.link:focus {
    color: $foreground;
    background-color: transparent !important;
    text-decoration: none;
}

.active {
    composes: link;
    background-color: $activeBackground !important;
}

.active:focus {
    background-color: $activeBackground !important;
}

.title {
    margin: 0;
    margin-bottom: $titleMarginBottom;
    font-size: $titleFontSize;
}

.imgTitle {
    height: $font-size-h1;
}

/* Sidebar navigation */
button.toggle {
    background-color: $foreground;
}

.icon-bar {
    background-color: $background;
}

.icon-navbar {
    background-color: #555;
    font-size: 1.2em;
    border: none;

    .container-fluid {
        padding-left: 0;
        padding-right: 0;
    }

    .nav {
        display: inline-block;
        float: none;
        vertical-align: top;
        text-align: center;

        li {
            float: left;
        }
    }
}

/*
 * Main content
 */
.main-panel {
    padding: $mainPadding;
    z-index: -10;  /** TODO: z-index issue */
}

/*
 * Media queries
 */
@media (min-width: 992px) and (max-width: 1199px) {
    .icon-navbar {
        .nav {
            li {
                float: none;
            }
        }
    }

    .nav-list {
        text-align: right;
    }

    .nav {
        li {
            a {
                padding-left: $condensedNavPadding;
                padding-right: $condensedNavPadding;
            }
        }
    }
}

@media (max-width: 991px) {
    .sidebar {
        position: static;
    }

    .title {
        float: left;
        margin-bottom: 0;
    }

    button.toggle {
        display: block;
        margin-top: 0;
        margin-bottom: 0;
    }

    .collapse {
        clear: both;
    }
}

:global {
    @media (max-width: 991px) {
        .collapse {
            display: none;
            padding-top: $titleMarginBottom;
        }

        .collapsing {
            padding-top: $titleMarginBottom;
        }
    }
}
