@import url('https://fonts.googleapis.com/css?family=Maven+Pro:400,700,900');

html, body, body.fancybox-active {
    height: 100%;
}

.container {
    transition: width 1s;
    padding-bottom: 15px;
}

.container-results {
    width: 100%;
    height: 100%;
    padding-left: 15px;
    padding-right: 35px;
}


/** Header **/

.header {
    position: relative;
    height: 80px;
    padding: 20px 0;
}

h1, h2 {
    font-family: 'Maven Pro', sans-serif;
    font-weight: normal;
}

h1 {
    margin: 0;
}

h1 span {
    font-weight: bold;
}

.header .progress {
    position: absolute;
    left: 10em;
    right: 0;
    top: 50%;
    margin-top: -8px;
    transition: right 0.25s;
}

.header .btn-reset {
    position: absolute;
    right: 0;
    top: 50%;
    margin-top: -20px;
    z-index: 100;
}

.header button {
    opacity: 0.0;
    transition: opacity 1s, right 0.4s;
}

.container-results .header button {
    opacity: 1.0;
}

.container-results .header .progress {
    right: 10em;
}

.sidebar-open .header .progress {
    right: 360px;
}

.sidebar-open .header button {
    right: -25px;
}


/** General **/

.vcenter {
    display: inline-block;
    float: none;
    vertical-align: middle;
}

.progress {
    position: relative;
}

.progress-title {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 3;
    font-size: 12px;
    line-height: 20px;
    color: #fff;
    text-shadow: 0px 0px 6px rgba(0, 0, 0, 0.7);
    text-align: center;
}

.drop-area .vcenter {
    margin: 0.2em 0.5em;
}

.drop-area {
    cursor: pointer;
}

.drop-area.dragging {
    background-image: linear-gradient(to bottom, #e8e8e8, #d9edf7);
}

.thumb-list {
    padding-top: 7px;
    padding-bottom: 7px;
}

.thumb-list .thumb {
    margin-top: 7px;
    margin-bottom: 7px;
}

.example-images img {
    cursor: pointer;
}

.list-group-item > .btn-delete {
    position: absolute;
    top: 50%;
    right: 10px;
    margin-top: -15px;
}

.list-group-item > label > input[type="checkbox"] + span {
    padding-left: 0.5em;
    padding-right: 0.3em;
}

#btn-refine {
    position: fixed;
    right: 6em;
    bottom: 3em;
    z-index: 100;
    box-shadow: 0 0 5px 3px white; /* alternative: 2px 2px 3px rgba(0,0,0,0.4) */
    transition: right 0.4s;
}

.sidebar-open #btn-refine {
    right: 122px;
}

.dummy {
    display: none;
}

.fancybox-lock .fancybox-overlay {
    overflow: auto;
}


/** Result list **/

#results-screen {
    height: calc(100% - 80px);
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 4px;
    transition: margin 0.4s;
}

.sidebar-open #results-screen {
    margin-right: 360px;
}

.img-grid {
    position: relative;
    width: 100%;
}

.img-grid > .img-container {
    position: absolute;
    z-index: 0;
}

.img-grid.transitions > .img-container {
    transition: top 1.8s, left 1.8s;
}

.img-grid.transitions > .img-container > img {
    transition: width 1.8s, height 1.8s;
}

.img-grid.transitions-fast > .img-container, .img-grid.transitions-fast > .img-container > img {
    transition-duration: 0.4s;
}

.img-grid > .img-container .btn {
    position: absolute;
    z-index: 3;
    padding: 0;
    
    color: #E8E8E8;
    font-size: 1.2em;
    text-shadow: 0 0 1px black;
    
    opacity: 0.0;
    transition: opacity 2s, color 0.3s;
}

.img-grid > .img-container .btn:hover {
    color: #FFFFFF;
}

.img-grid > .img-container:hover .btn {
    opacity: 1.0;
    transition: opacity 0.3s, color 0.5s;
}

.img-grid > .img-container .btn-show { top: 6px; right: 12px; }
.img-grid > .img-container .btn-relevant { bottom: 6px; left: 12px; }
.img-grid > .img-container .btn-irrelevant, .img-grid > .img-container .btn-remove { bottom: 6px; right: 12px; }
.img-grid > .img-container .btn-annotate { bottom: 6px; left: 50%; width: 2em; margin-left: -1em; text-align: center; }

#sidebar .img-grid > .img-container .btn { font-size: 0.8em; }
#sidebar .img-grid > .img-container .btn-show { top: 2px; right: 4px; }
#sidebar .img-grid > .img-container .btn-relevant { bottom: 2px; left: 4px; }
#sidebar .img-grid > .img-container .btn-irrelevant, #sidebar .img-grid > .img-container .btn-remove { bottom: 2px; right: 4px; }
#sidebar .img-grid > .img-container .btn-annotate { bottom: 2px; }


.img-grid img.relevant ~ .btn-relevant, .img-grid img.relevant ~ .btn-relevant:hover,
.img-grid img.relevant.annotated ~ .btn-annotate, .img-grid img.relevant.annotated ~ .btn-annotate:hover,
#query-images img.annotated ~ .btn-annotate, #query-images img.annotated ~ .btn-annotate:hover {
    color: #66D000;
    opacity: 1.0;
}

.img-grid img.irrelevant ~ .btn-irrelevant, .img-grid img.irrelevant ~ .btn-irrelevant:hover,
.img-grid img.irrelevant.annotated ~ .btn-annotate, .img-grid img.irrelevant.annotated ~ .btn-annotate:hover {
    color: #FF6010;
    opacity: 1.0;
}


.img-grid .show-more {
    background-color: #DADADA;
    color: #FFFFFF;
    font-size: 28px;
    font-family: 'Maven Pro', sans-serif;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    width: 250px;
    height: 200px;
    position: relative;
}

.img-grid .show-more .caption {
    display: block;
    position: absolute;
    width: 140px;
    top: 50%;
    left: 50%;
    margin-top: -63px;
    margin-left: -70px;
}

.img-grid .show-more .spinner {
    display: none;
    position: absolute;
    text-indent: -9999em;
    width: 11em;
    height: 11em;
    left: 50%;
    top: 50%;
    margin: -5.5em 0 0 -5.5em;
    font-size: 10px;
    border-radius: 50%;
    background: #FFFFFF;
    background: -moz-linear-gradient(left, #FFFFFF 10%, rgba(255, 255, 255, 0) 42%);
    background: -webkit-linear-gradient(left, #FFFFFF 10%, rgba(255, 255, 255, 0) 42%);
    background: -o-linear-gradient(left, #FFFFFF 10%, rgba(255, 255, 255, 0) 42%);
    background: -ms-linear-gradient(left, #FFFFFF 10%, rgba(255, 255, 255, 0) 42%);
    background: linear-gradient(to right, #FFFFFF 10%, rgba(255, 255, 255, 0) 42%);
    -webkit-animation: spinner-anim 1.4s infinite linear;
    animation: spinner-anim 1.4s infinite linear;
    -webkit-transform: translateZ(0);
    -ms-transform: translateZ(0);
    transform: translateZ(0);
}

.img-grid .show-more .spinner:before {
    width: 50%;
    height: 50%;
    background: #FFFFFF;
    border-radius: 100% 0 0 0;
    position: absolute;
    top: 0;
    left: 0;
    content: '';
}

.img-grid .show-more .spinner:after {
    background: #DADADA;
    width: 75%;
    height: 75%;
    border-radius: 50%;
    content: '';
    margin: auto;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

.img-grid .show-more.loading .caption {
    display: none;
}

.img-grid .show-more.loading .spinner {
    display: block;
}

@-webkit-keyframes spinner-anim {
  0% {
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}
@keyframes spinner-anim {
  0% {
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}


/** Sidebar **/

#sidebar {
    position: fixed;
    top: 10px;
    bottom: 10px;
    right: -360px;
    width: 380px;
    padding-left: 20px;
    z-index: 50;
    transition: right 0.4s;
    
    background: white;
    border: 1px solid #ddd;
    border-right: 0 none;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

#sidebar > .inner {
    padding: 10px;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar-open #sidebar {
    right: 0;
}

#sidebar, #sidebar-toggle {
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
}

#sidebar-toggle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 20px;
    
    background-color: #f5f5f5;
    background-image: linear-gradient(to left, #f5f5f5, #e8e8e8);
    border-right: 1px solid #ddd;
    color: #888;
    cursor: pointer;
}

#sidebar-toggle span {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    margin-top: -10px;
    text-align: center;
    transition: transform 0.4s;
}

.sidebar-open #sidebar-toggle span {
    transform: rotate(180deg);
}

#sidebar > .inner > h2:first-child {
    margin-top: 0;
}

#sidebar .drop-area {
    margin: 10px 0 0 0;
}


/** Annotation Dialog **/

#annotation-img-container, #annotation-form {
    position: relative;
    display: inline-block;
    padding: 0 15px;
    vertical-align: top;
}

#lbl-isRelevant.active, #lbl-isIrrelevant.active {
    color: #fff;
    text-shadow: 0 -1px 0 rgba(0,0,0,.2);
}

#lbl-isRelevant.active {
    background-color: #419641;
    border-color: #3e8f3e;
}

#lbl-isIrrelevant.active {
    background-color: #c12e2a;
    border-color: #b92c28;
}

#dlg-annotation .nav-tabs {
    margin-bottom: 10px;
}

.area-group-item label span {
    font-style: italic;
}

#annotation-areas .list-group-item.indented label {
    padding-left: 45px;
}

#annotation-areas .list-group-item.indented input[type="checkbox"] {
    display: none;
}

#annotation-attributes .form-group {
    /* Reduce gutter between form columns */
    margin-left: -2px;
    margin-right: -2px;
}

#annotation-attributes .form-group > [class*="col-"] {
    /* Reduce gutter between form columns */
    padding-left: 2px;
    padding-right: 2px;
}

#annotation-attributes .input-group.btn-group .input-group-btn .btn {
    border-right: 0 none;
}

#annotation-attributes .input-group.btn-group .input-group-btn .glyphicon {
    margin-right: 0.4em;
}

#annotation-attributes .input-group.btn-group input[type="text"].form-control:not(:last-child) {
    /* Even if the text input is not the last child, add rounded corners because the following siblings will be hidden. */
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

#annotation-attributes .btn-group label.btn {
    width: 50%;
}

#annotation-attributes .btn-group label.btn.active {
    color: white;
    background-color: rgb(38, 90, 136);
    border-color: rgb(36, 85, 128);
    text-shadow: rgba(0, 0, 0, 0.2) 0px -1px 0px;
}


#dlg-annotation:not(.annotate-relevance) #annotation-relevance {
    display: none;
}

#dlg-annotation:not(.annotate-areas) #tab-link-annotate-areas {
    display: none;
}

#dlg-annotation:not(.annotate-attributes) #tab-link-annotate-attributes {
    display: none;
}


@media (max-width: 991px) {

    /* Show form below image on smaller screens instead of side-by-side */

    #annotation-img-container, #annotation-form {
        display: block;
        width: auto !important;
    }
    
    #annotation-img-container {
        margin-bottom: 20px;
    }

}


.annotated-area {
    position: absolute;
    z-index: 5;
    border: 3px solid;
    color: red;
}

.annotated-area::before, .annotated-area::after {
    display: block;
    content: "";
    position: absolute;
    border: 1px solid white;
    z-index: 4;
}

.annotated-area.selected::before, .annotated-area.selected::after {
    border-width: 2px;
}

.annotated-area::before { top: 0; left: 0; right: 0; bottom: 0; }
.annotated-area::after { top: -4px; left: -4px; right: -4px; bottom: -4px; }

/* Base annotation colors */
.annotation-group0 { color: rgb(255, 0, 0); }
.annotation-group1 { color: rgb(0, 0, 255); }
.annotation-group2 { color: rgb(0, 200, 0); }
.annotation-group3 { color: rgb(160, 0, 255); }
.annotation-group4 { color: rgb(255, 150, 0); }
/* Mixed annotation colors */
.annotation-group5 { color: rgb(128, 0, 128); }
.annotation-group6 { color: rgb(128, 100, 0); }
.annotation-group7 { color: rgb(208, 0, 128); }
.annotation-group8 { color: rgb(255, 75, 0); }
.annotation-group9 { color: rgb(0, 100, 128); }
.annotation-group10 { color: rgb(80, 0, 255); }
.annotation-group11 { color: rgb(128, 75, 128); }
.annotation-group12 { color: rgb(80, 100, 128); }
.annotation-group13 { color: rgb(128, 175, 0); }
.annotation-group14 { color: rgb(208, 75, 128); }


/** Heatmap Overlay **/

.fancybox-button.active {
    color: #66D000;
}

.fancybox-heatmap {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    z-index: 1;

    background: transparent;
    border: 0;
    max-height: none;
    max-width: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;

    opacity: 0.6;
    transition: opacity 0.5s;
}

.fancybox-heatmap:hover {
    opacity: 0.3;
}