@mixin grid-item($viewport-min-width, $viewport-max-width, $item-width) {
    @if $viewport-max-width=="nomax" {
        @media (min-width: #{$viewport-min-width}px) {
            .grid-item {
                width: unquote($item-width + '%');
            }
        }
    }
    @else {
        @media (min-width: #{$viewport-min-width}px) and (max-width: #{$viewport-max-width}px) {
            .grid-item {
                width: unquote($item-width + '%');
            }
        }
    }
}

@-webkit-keyframes loader {
    0%,
    80%,
    100% {
        box-shadow: 0 2.5em 0 -1.3em;
    }
    40% {
        box-shadow: 0 2.5em 0 0;
    }
}

@keyframes loader {
    0%,
    80%,
    100% {
        box-shadow: 0 2.5em 0 -1.3em;
    }
    40% {
        box-shadow: 0 2.5em 0 0;
    }
}

@media (max-width: 767px) {
    body.loaded {
        padding-top: 95px;
    }
}

#main-div {
    margin-top: 30px;
}

#discovery-app {
    visibility: hidden;
}

.navbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

.navbar-right {
    margin-right: 15px;
}

#discoveryLoader {
    position: absolute;
    left: 50%;
    top: 200px;
    margin-left: -52px;
}

#progress {
    height: 100%;
    position: absolute;
    text-align: center;
    background: white;
    z-index: 1000;
    top: 0;
    width: 100%;
    opacity: 0.9;

    > div {
        top: 50%;
        position: absolute;
        margin-top: -90px;
        margin-left: -229px;
        left: 50%;
        //opacity: 1;
    }
}

body {
    &.loaded {
        overflow: auto;
        background: #c7d6e2;
        padding-top: 40px;

        .navbar {
            display: block;
        }

        #discovery-app {
            visibility: visible;
        }

        #progress {
            display: none;
        }

        &.loading {
            overflow: hidden;

            #progress {
                display: block;
                //opacity: 0.7;
            }
        }
    }
}

.loader:before,
.loader:after,
.loader {
    border-radius: 50%;
    width: 2.5em;
    height: 2.5em;
    -webkit-animation-fill-mode: both;
    animation-fill-mode: both;
    -webkit-animation: loader 1.8s infinite ease-in-out;
    animation: loader 1.8s infinite ease-in-out;
}

.loader {
    color: #A75E0F;
    font-size: 10px;
    margin: 20px auto 30px auto;
    position: relative;
    text-indent: -9999em;
    -webkit-transform: translateZ(0);
    -ms-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-animation-delay: -0.08s;
    animation-delay: -0.08s;
    padding-bottom: 10px;

    &:before {
        left: -3.5em;
        -webkit-animation-delay: -0.16s;
        animation-delay: -0.16s;
    }

    &:after {
        left: 3.5em;
    }

    &:before,
    &:after {
        content: '';
        position: absolute;
        top: 0;
    }
}

.grid-item {
    background-color: #e5eff2;
    color: black;
    margin-top: 0;
    width: 100%;
    margin: 1%;
    &:hover {
        border-color: #777;
    }
    a {
        text-decoration: none;
        color: black;
        display: block;
    }
    h1 {
        font-size: 17px;
        margin: 0;
        white-space: pre-wrap;
        word-break: break-all;
        font-weight: bold;
        padding-right: 70px;
    }
    h2 {
        font-size: 13px;
        margin: 0;
        padding-top: 4px;
    }
    h3 {
        font-size: 11px;
        margin: 2px 0;
        color: #666;
    }
    .header {
        padding: 10px 10px 10px 10px;
        position: relative;
        background-color: #fff;
        .star,
        .fork {
            color: black;
            font-size: 15px;
            text-decoration: none;
            background: transparent;
            border: none;
            padding: 2px 4px;
        }
        .buttons {
            top: 6px;
            position: absolute;
            right: 4px;
        }
    }
    img {
        max-width: 100%;
    }
}

@include grid-item(540, 799, 48);
@include grid-item(800, 1099, 30);
@include grid-item(1100, 1649, 23);
@include grid-item(1650, 2049, 18);
@include grid-item(2050, "nomax", 14.6);
