/*
Copyright (c) 2016 Andre Santos

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}


.invisible {
    opacity: 0;
    cursor: pointer !important;
}

.hidden,
.show-inline-sm,
.show-inline-md,
.show-inline-lg {
    display: none;
}

.hide-block-sm,
.hide-block-md,
.hide-block-lg {
    display: block;
}


@media (min-width: 35.5em) {
    .show-inline-sm {
        display: inline;
    }

    .hide-block-sm {
        display: none;
    }
}

@media (min-width: 48em) {
    .show-inline-md {
        display: inline;
    }

    .hide-block-md {
        display: none;
    }
}

@media (min-width: 64em) {
    .show-inline-lg {
        display: inline;
    }

    .hide-block-lg {
        display: none;
    }
}

.no-overflow {
    overflow: hidden;
}


.clickable {
    cursor: pointer;
}


.anchor {
    position: relative;
}


.no-padding {
    padding: 0;
}

.padding {
    padding: 0.5em;
}

.padding-v {
    padding-top: 0.5em;
    padding-bottom: 0.5em;
}

.padding-v-lg {
    padding: 0.75em 0;
}

.padding-top-sm {
    padding-top: 0.25em;
}

.padding-top {
    padding-top: 0.5em;
}

.padding-top-lg {
    padding-top: 0.75em;
}

.padding-bottom-sm {
    padding-bottom: 0.25em;
}

.padding-bottom {
    padding-bottom: 0.5em;
}

.padding-bottom-lg {
    padding-bottom: 0.75em;
}

.padding-h {
    padding: 0 0.5em;
}


.margin-top {
    margin-top: 0.5em;
}

.no-margin-top {
    margin-top: 0;
}

.margin-bottom {
    margin-bottom: 0.5em;
}

.margin-left {
    margin-left: 0.5em;
}

.margin-left-sm {
    margin-left: 0.25em;
}

.margin-right {
    margin-right: 0.5em;
}

.margin-right-sm {
    margin-right: 0.25em;
}

.margin-h {
    margin-left: 0.5em;
    margin-right: 0.5em;
}

.border-top {
    border-top: 1px solid;
}

.border-top-lg {
    border-top: 2px solid;
}

.border-bottom {
    border-bottom: 1px solid;
}

.border-bottom-lg {
    border-bottom: 2px solid;
}


.pull-left {
    float: left;
}

.pull-right {
    float: right;
}


.inline {
    display: inline-block;
}

.flexbox {
    display: flex;
    flex-direction: row;
}

.flex-fixed-size {
    flex: 0 0 auto;
}

.flex-grow {
    flex: 1 0 auto;
}

.flexible {
    flex: 1 1 auto;
}


#app {
    position: relative;
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-top: 4em;
}

#app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3.25em;
    padding: 0 0.5em;
    z-index: 1100;
}

#app-header > .title {
    margin: 0;
}

#app-header > .navigation-menu {
    position: absolute;
    bottom: 0.25em;
    right: 0;
    padding: 0.5em;
}

#app-header > .navigation-menu > a {
    font-size: 1.25em;
    text-decoration: none;
    color: inherit;
}

#app-header > .navigation-menu > a:hover {
    color: #f3af34;
}

#app-header > .navigation-menu > a.selected {
    color: steelblue;
}

@media (min-width: 22.5em) {
    #app-header > .navigation-menu > a {
        margin-left: 0.25em;
    }
}

@media (min-width: 30em) {
    #app-header > .navigation-menu > a {
        margin-left: 1em;
    }
}

@media (min-width: 80em) {
    #app-header > .navigation-menu {
        right: 10%;
    }
}


#preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding-top: 4em;
    background-color: whitesmoke;
    z-index: 1000;
}



#dashboard-project-select {
    outline: none;
    border: none;
    box-shadow: none;
    font-weight: bold;
    color: steelblue;
}

#dashboard .panel {
    position: relative;
    border-radius: 4px;
    border-width: 2px;
    border-style: solid;
    padding: 0.5em 1em;
    margin: 1em 0.5em;
    min-height: 2em;
}

#dashboard .panel .badge-empty,
#ros-board .panel .badge-empty {
    float: right;
}


#dashboard .panel.double-size {
    height: 23.25em;
}


@media (min-width: 48em) {
    #dashboard .panel.double-size {
        height: 24.75em;
    }
}


#dashboard-panel-progress .chart .line {
    fill: none;
    stroke: steelblue;
    stroke-width: 2px;
}

#dashboard-metric-select {
    font-weight: bold;
}

/*#dashboard-panel-progress .chart {
    display: inline-block;
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    vertical-align: top;
    overflow: hidden;
}

#dashboard-panel-progress .chart .responsive-svg {
    display: inline-block;
    position: absolute;
    top: 10px;
    left: 0;
}*/





#package-board {
    display: flex;
    width: 100%;
}


#pkg-filter-modal input,
#issue-filter-modal input {
    width: 14em;
    padding: .5em;
    display: block;
    border: 1px solid #ccc;
    box-shadow: inset 0 1px 3px #ddd;
    border-radius: 4px;
    vertical-align: middle;
}

#pkg-filter-toggle,
#issue-filter-toggle {
    cursor: pointer;
    color: grey;
}


#package-graph,
#config-graph {
    position: relative;
    flex: 1;
    height: 15em;
    border: 1px solid lightgrey;
}

#package-graph > .action-bar,
#config-graph > .action-bar {
    position: absolute;
    top: auto;
    bottom: 1em;
    right: 1em;
    left: auto;
    font-size: 1.25em;
}

#package-graph > #pkg-graph-action-bar,
#config-graph > #config-graph-action-bar {
    left: 1em;
    right: auto;
}

#package-graph > #pkg-node-action-bar,
#config-graph > #config-node-action-bar {
    left: auto;
    right: 1em;
}

#package-graph > .issue-scale {
    position: absolute;
    top: auto;
    bottom: 0.25em;
    left: 1.25em;
    right: 1.25em;
    display: flex;
    border: 1px solid grey;
    border-radius: 4px;
    overflow: hidden;
}

#package-graph > .issue-scale > div {
    flex: 1 1 auto;
    height: 0.5em;
    border-right: 1px solid grey;
    text-align: center;
}

#package-graph > .issue-scale > div:last-child {
    border-right: none;
}

@media (min-width: 40em) {
    #package-graph > #pkg-graph-action-bar,
    #config-graph > #config-graph-action-bar {
        top: 1em;
        bottom: auto;
        left: auto;
        right: 1em;
    }

    #package-graph > #pkg-node-action-bar,
    #config-graph > #config-node-action-bar {
        top: 3em;
        bottom: auto;
    }
}

@media (min-width: 48em) {
    #package-graph > .issue-scale > div {
        height: auto;
    }
}


svg {
    width: 100%;
    height: 100%;
}

#package-graph .node circle,
#config-graph .node circle {
    stroke-width: 2px;
    stroke: #8A6D3B;
}

#config-graph .graph .node.ros-node {
	fill: white;
}

#config-graph .graph .node.ros-topic {
	fill: lightgreen;
}

#config-graph .graph .node.ros-service {
	fill: lightblue;
}

#config-graph .graph .node.ros-param {
	fill: plum;
}

#config-graph .graph .node.candidate {
	fill: orange !important;
}

#config-graph .graph .node.query-object {
    animation: pulse 2s infinite alternate;
    -webkit-animation: pulse 2s infinite alternate;
}

@keyframes pulse {
    to { fill: crimson; }
}

#package-graph .node.focus {
	stroke-width: 4px;
}

#package-graph .conditional,
#config-graph .conditional {
	stroke-dasharray: 5;
}

#package-graph .graph.hovering .node.selected circle,
#config-graph .graph.hovering .node.selected circle {
	stroke: #007AFF;
}

#package-graph .graph.hovering .node.selected circle {
	stroke-width: 4px;
}

#package-graph .graph .node.focus circle {
	stroke-width: 4px;
}

#package-graph .edge,
#config-graph .edge {
	fill: none;
	stroke-width: 2px;
	stroke: #D19D00;
	stroke-linejoin: round;
}

#config-graph .graph .edge.query-object {
    animation: pulseStroke 2s infinite alternate;
    -webkit-animation: pulseStroke 2s infinite alternate;
}

@keyframes pulseStroke {
    to { stroke-width: 4px; stroke: crimson; }
}


#package-graph .graph.hovering .edge.selected,
#config-graph .graph.hovering .edge.selected {
	stroke: #007AFF;
}

#package-graph .graph.hovering .edge.selected {
	stroke-width: 4px;
}

#package-graph .graph.hovering .node,
#config-graph .graph.hovering .node {
	opacity: 0.2;
}

#package-graph .graph.hovering .edge,
#config-graph .graph.hovering .edge {
	opacity: 0;
}

#package-graph .graph.hovering .node.selected,
#config-graph .graph.hovering .node.selected,
#package-graph .graph.hovering .edge.selected,
#config-graph .graph.hovering .edge.selected {
	opacity: 1;
}

#package-graph .graph.hovering .node.highlight circle,
#config-graph .graph.hovering .node.highlight circle {
	stroke: #3C763D;
}

#package-graph .graph.hovering .node.highlight circle {
	stroke-width: 4px;
}

#package-graph .graph.hovering .node.highlight,
#config-graph .graph.hovering .node.highlight {
    opacity: 1;
}

#package-graph .graph.hovering .edge.highlight,
#config-graph .graph.hovering .edge.highlight {
	stroke: #3C763D;
    opacity: 1;
}

#package-graph .graph.hovering .edge.highlight {
	stroke-width: 4px;
}

#package-graph .graph .node.dragging circle,
#config-graph .graph .node.dragging circle {
	stroke: #007AFF !important;
}


#package-graph .graph .node text {
	font-size: 2em;
    cursor: default;
}

#config-graph .graph .node text {
    fill: black;
	font-size: 0.75em;
    cursor: default;
}

#config-graph .graph.hide-text .node text {
    display: none;
}

#config-graph .graph .node.selected text,
#config-graph .graph .node.hovering text {
	display: inline !important;
}

#package-graph .graph.zoomed-out .node text,
#config-graph .graph.zoomed-out .node text {
	opacity: 0;
}



#issue-board {
    padding: 0 1em;
    min-height: 300px;
    /*TODO fix this some other way; filter view needs height*/
}

#issue-board > .header-menu,
#ros-board > .header-menu {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}

#issue-board > .header-menu > .menu-item,
#ros-board > .header-menu > .menu-item {
    flex: 1 1 auto;
    display: flex;
    overflow: hidden;
}

@media (min-width: 48em) {
    #issue-board > .header-menu,
    #ros-board > .header-menu {
        max-width: 48em;
    }
}

#issue-explorer > .issue {
    border-bottom: 1px solid lightgrey;
    margin-bottom: 0.5em;
}

#issue-explorer > .issue:last-child {
    border-bottom: none;
}

#issue-explorer > .issue > h4 {
    margin: 0;
}

#issue-explorer > .issue small {
    color: grey;
    font-weight: normal;
}

#issue-board button,
#ros-board .menu-item button {
    background: none;
    border: 1px solid grey;
    font-size: 1em;
    padding: 0.25em;
}

#issue-btn-top {
    color: steelblue;
}

#issue-filter-modal {
    padding: 5em 1em 1em 1em;
}



#ros-board {
    padding: 0 1em;
}

#ros-board .panel {
    position: relative;
    border-radius: 4px;
    border-width: 2px;
    border-style: solid;
    padding: 0.5em 1em;
    margin: 1em 0;
    min-height: 2em;
}

#ros-board .panel > .node > p.topic {
    margin-left: 0.5em;
}

#ros-query-select {
    max-width: 100%;
}



hr {
    border: 0;
    height: 1px;
    background-color: lightgrey;
    clear: both;
}


.taglist {
    padding: 0;
    margin: 0.5em 0;
}

.taglist > .tag {
    display: inline-block;
    padding: 0 0.5em;
    margin-bottom: 0.5em;
    border-radius: 4px;
    color: whitesmoke;
    background-color: #333;
    cursor: pointer;
}


.info-tag {
    display: inline-block;
    padding: 0 0.5em;
    margin-bottom: 0.5em;
    border-radius: 4px;
    border-width: 1px;
    border-style: solid;
}


.action-bar > button {
    background-color: whitesmoke;
    border-top: 1px solid grey;
    border-bottom: 1px solid grey;
    border-left: 1px solid grey;
    border-right: none;
}

.action-bar > button:hover {
    background-color: ivory;
}

.action-bar > button:first-child {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.action-bar > button:last-child {
    border-right: 1px solid grey;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.action-bar > button > i {
    min-width: 1em;
}



.modal {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(245,245,245,0.75);
    display: flex;
    flex-direction: column;
    padding: 1em;
    overflow: hidden;
}

.modal .button-close {
    float: right;
    cursor: pointer;
    font-weight: bold;
}

.modal > .modal-content {
    position: relative;
    margin: 0 auto 0 auto;
    background-color: whitesmoke;
    border: 1px solid grey;
    border-radius: 4px;
/*    flex: 1 1 auto;*/
    padding: 0 1em;
    overflow-x: hidden;
    overflow-y: auto;
    max-width: 90%;
}

.modal-content .title > small {
    color: steelblue;
}

.modal-content a {
    color: steelblue;
    text-decoration: none;
    display: inline-block;
}


.info {
    font-size: 0.75em;
    font-weight: bold;
    color: grey;
}

.bullet-icon {
    width: 1.25em;
}



.text-button {
    cursor: pointer;
    font-weight: bold;
}


.code {
    display: inline-block;
    padding: 0 0.5em;
    border-radius: 4px;
    border-width: 1px;
    border-style: solid;
    color: #333;
    background-color: whitesmoke;
    font-family: monospace;
    white-space: pre;
    unicode-bidi: embed;
}




.progress-bar {
    position: relative;
    min-height: 0.75em;
    top: 0.25em;
    border: 1px solid;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar > .progress {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 90%;
    /*border-radius: 8px;*/
    z-index: 100;
}

.progress-bar > .progress-label {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    text-align: center;
    font-weight: bold;
    z-index: 1000;
}


select {
    background: transparent;
    padding: 0.25em;
    border: 1px solid grey;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
