/* Additional resources */
@font-face {
    font-family: 'kingthings_calligraphica_2Rg';
    src: url('Kingthings_Calligraphica_2-webfont.eot');
    src: url('Kingthings_Calligraphica_2-webfont.eot?#iefix') format('embedded-opentype'),
        url('Kingthings_Calligraphica_2-webfont.woff') format('woff'),
        url('Kingthings_Calligraphica_2-webfont.ttf') format('truetype'),
        url('Kingthings_Calligraphica_2-webfont.svg#kingthings_calligraphica_2Rg') format('svg');
    font-weight: normal;
    font-style: normal;
}


/*
 * Declare all colors
 */
:root {
    --title-color: #00e6b0;
    --text-color: #a0d5dd;
    --dark1-color: #052525;
    --dark2-color: #053035;
    --light1-color: #203535;
    --light2-color: #305050;
    --vlight1-color: #709090;
    --vlight2-color: #506469;
    --th-color: #053035;
    --tr-color: #305050;
    --selected-color: #00e6b0;
    --border-color: #82aaaf;
    --ok-color: #33ff33;
    --stable-color: dodgerblue;
    --error-color: #ff3333;
    --blink-color: orangered;
}


/*
 * General Layout
 */
html, body, #body_block {
    height: 100%;
    min-height: 700px;
}

body {
    margin: auto;
}

/* fake a background transparency because smoke image is too dark */
body::after {
    content: "";
    background-image: linear-gradient(180deg, var(--light2-color), var(--light1-color));
    top: 0; left: 0; bottom: 0; right: 0;
    position: absolute;
    z-index: -1;
}

#body_block {
    min-width: 1000px;
    display: flex;
}


/*
 * Left Side Layout
*/
#left_side {
    min-width: 230px;
    max-width: 230px;
    flex: 1;
    display: flex;
    flex-direction: column;
    background-image: linear-gradient(180deg, var(--dark2-color), var(--dark1-color));
}
#left_side header, #left_side header a {
   text-align: center;
   color: var(--title-color);
}

nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: auto;
    color: var(--text-color);
}

#left_side footer {
    font-style: italic;
    color: var(--text-color);
}

#left_side footer a {
   color: var(--title-color);
}

#copyright {
    font-size: .6em;
}


/*
 * Right Side Layout
*/
#right_side {
    flex: 1;
    display: flex;
    flex-direction: column;
    color: var(--text-color);
}

#right_side header {
    min-height: 90px;
    max-height: 90px;
    padding: 0 10px;
    background-image: linear-gradient(180deg, var(--light2-color), var(--light1-color));
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#contents {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Supvisors page: address boxes */
#index_contents {
    display: flex;
    flex: 1;
    overflow: auto;
    margin-top: 10px;
}

#box_part {
    display: flex;
    flex: 1;
    justify-content: space-around;
    flex-wrap: wrap;
    margin: 5px;
}

#conflict_part {
    flex: 1;
}

/* Address page: Process section */
#process_contents {
    display: flex;
    flex: 1;
    flex-direction: row;
    overflow: auto;
    margin: 5px;
}

#process_left_side {
    display: flex;
    flex: 1;
    font-family: Verdana, Arial, sans-serif;
    text-align: justify;
    margin-right: 5px;
}

#process_right_side {
    max-width: 500px;
    align-items: center;
    margin-right: 10px;
}


/* Address page: Host section */
#address_contents {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: space-around;
}

.horizontal_contents {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
}

.vertical_contents {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}


/* Common part: Message box */
#messageBox {
    min-height: 25px;
    max-height: 25px;
    width: 98%;
    font-size: 0.9em;
}


/*
 * Resource design
*/
header, nav, footer {
    padding: 5px;
}

h1, h2, h3, h4 {
    font-family: 'kingthings_calligraphica_2Rg', Verdana, sans-serif;
}

h1 {
    font-size: 1.6em;
}

h2, h3 {
    font-size: 1.2em;
    margin: 0 0 8px 0;
}

h4 {
    font-weight: bold;
    text-align: center;
    font-size: .8em;
    padding: 5px;
    border: 3px ridge var(--border-color);
    background-image: linear-gradient(180deg, var(--light2-color), var(--light1-color));
}

h3 code {
    display: inline-block;
    padding: 5px 10px;
    font-size: 16px;
    text-shadow: 3px 3px 6px black;
    background: var(--vlight1-color);
}

nav ul, p {
    font-size: .8em;
}

a {
    text-decoration: none;
    color: var(--text-color);
}

/*
 * Blink Style
 *
 */
#left_side header a.blink {
    color: var(--blink-color);
    animation: blinker 1.2s linear infinite;
}

@keyframes blinker {
    50% { opacity: 0.0; }
}


/*
 * Figure style
 */
figure {
    margin: 2;
}

figure img {
    border: 1px solid black outset;
    border-radius: 6px;
    box-shadow: 4px 4px 6px black;
}

figcaption {
    margin-top: 6px;
    font-weight: bold;
    font-style: italic;
    text-align: center;
    font-size: .8em;
}

/*
 * Style for inline actions
 */
ul.linear, ul.vertical {
    margin: 0;
    padding: 0;
    list-style: none;
}

ul.linear li {
    display: inline;
}

ul.vertical li {
    margin: 2px 0;
}


/*
 * Style for operational status
 */
.status_empty, .status_green, .status_yellow, .status_red {
    padding: 10px 100px 10px 2px;
}

.status_empty {
    background: url(../img/leds_empty_30.png) no-repeat right;
}

.status_green {
    background: url(../img/leds_green_30.png) no-repeat right;
}

.status_yellow{
    background: url(../img/leds_yellow_30.png) no-repeat right;
}

.status_red {
    background: url(../img/leds_red_30.png) no-repeat right;
}


/*
 * Style for status message
 */
.empty, .info, .warn, .erro {
    padding: 5px;
    margin: 5px auto;
    border-radius: 10px;
}

.empty {
    background-image: linear-gradient(165deg, silver, #1a1a1a);
    border: 1px grey inset;
}

.info {
    background-image: linear-gradient(165deg, dodgerblue, #1a1a1a);
    border: 1px blue inset;
}

.info::before {
    content: url(../img/info_20.png) '\00a0';
    float: left;
}

.warn {
    background-image: linear-gradient(165deg, #f90, #1a1a1a);
    border: 1px orange inset;
}

.warn::before {
    content: url(../img/warn_20.png) '\00a0';
    float: left;
}

.erro {
    background-image: linear-gradient(165deg, orangered, #1a1a1a);
    border: 1px red inset;
}

.erro::before {
    content: url(../img/erro_20.png) '\00a0';
    float: left;
}


/*
 * Master address style
 */
.master::after {
    content: " \272A";
}


/*
 * Common Table style
 */
table {
    border-collapse: collapse;
    caption-side: top;
    background-color: var(--tr-color);
    margin: 0 auto;
}

caption {
    padding-right: 4px;
    font-size: .8em;
    font-style: italic;
}

/* add border for all cells */
th, td {
    border: 1px solid var(--border-color);
    padding: 3px 5px;
    font-size: .7em;
}

th {
    background-color: var(--th-color);
}

.brightened {
    background-image: linear-gradient(180deg, var(--vlight2-color), var(--light2-color), var(--vlight2-color));
}

.shaded {
    background-image: linear-gradient(180deg, var(--light1-color), var(--light2-color), var(--light1-color));
}

/* fix first columns sizes (button actions have a fixed contents) */
table .name {
  width: 180px;
}

table .state {
    width: 50px;
}

table .desc, table.addr {
  width: 250px;
}


/* style for a table of processes */
#processes th {
    text-align: left;
}

#processes td:nth-child(2), #processes th:nth-child(2),
#processes td:nth-child(n+4), #processes th:nth-child(n+4) {
    text-align: center;
}

#processes td:nth-child(4) {
    font-style: italic;
}

#address_part th, #address_part td,
#process_right_side th, #process_right_side td {
    text-align: center;
    vertical-align:middle;
}

#application td:nth-child(2), #application td:nth-child(n+4) {
    text-align: center;
}


/*
 * Style for optionBox
 */
.optionBox {
    border: 3px ridge var(--border-color);
    background-image: linear-gradient(180deg, var(--light2-color), var(--light1-color));
}

.optionBox th {
    background-image: linear-gradient(180deg, var(--dark2-color), var(--dark1-color));
    text-align: center;
}

.optionBox ul {
    text-align: center;
}


/*
 * Style for addressBox (main page)
 */
.addressBox {
    display: flex;
    min-width: 200px;
    max-width: 30%;
    min-height: 150px;
    height: 150px;
}

.addressBox table {
    height: 100%;
    border: 3px ridge var(--border-color);
}

.addressBox th {
    height: 18px;
    background-image: linear-gradient(180deg, var(--dark2-color), var(--dark1-color));
}

.addressBox td:nth-child(1) {
    vertical-align: top;
}

.addressBox tr {
    background-image: linear-gradient(180deg, var(--light2-color), var(--light1-color));
}

.addressBox .button {
    display: inline-block;
    padding: 2px 4px;
    margin-bottom: 4px;
    background-color: #007600;
    border-radius: 6px;
    cursor: default;
}

.addressBox td:nth-child(2) {
    text-align: center;
}


/*
 * State gradients
 */
table .UNKNOWN {
    background-image: linear-gradient(165deg, grey, white);
    color: black;
}

table .STOPPED, table .EXITED, table .SILENT {
    background-image: linear-gradient(165deg, white, #cc0, #cc0, white);
    color: black;
}

table .STARTING, table .BACKOFF {
    background-image: linear-gradient(165deg, #cc0, green, white);
    color: black;
}

table .STOPPING {
    background-image: linear-gradient(165deg, green, #cc0, white);
    color: black;
}

table .RUNNING {
    background-image: linear-gradient(165deg, white, green, green, white);
    color: black;
}

table .FATAL, table .ISOLATED {
    background-image: linear-gradient(165deg, white, red, red, white);
    color: black;
}

nav .UNKNOWN {
    background-image: linear-gradient(165deg, #1a1a1a, #1a1a1a 60%, grey);
}

nav .UNKNOWN.active {
    background-image: linear-gradient(165deg, grey, #1a1a1a 40%, #1a1a1a);
}

nav .CHECKING {
    background-image: linear-gradient(165deg, #1a1a1a, #1a1a1a 60%, grey 80%, green);
}

nav .CHECKING.active {
    background-image: linear-gradient(165deg, green, grey 20%, #1a1a1a 40%, #1a1a1a);
}

nav .STOPPED, nav .SILENT {
    background-image: linear-gradient(165deg, #1a1a1a, #1a1a1a 60%, #cc0);
}

nav .STOPPED.active {
    background-image: linear-gradient(165deg, #cc0, #1a1a1a 40%, #1a1a1a);
}

nav .RUNNING {
    background-image: linear-gradient(165deg, #1a1a1a, #1a1a1a 60%, green);
}

nav .RUNNING.active {
    background-image: linear-gradient(165deg, green, #1a1a1a 40%, #1a1a1a);
}

nav .ISOLATED {
    background-image: linear-gradient(165deg, #1a1a1a, #1a1a1a 60%, red);
}

nav .STARTING {
    background-image: linear-gradient(165deg, #1a1a1a, #1a1a1a 60%, #cc0 80%, green);
}

nav .STARTING.active {
    background-image: linear-gradient(165deg, green, #cc0 20%, #1a1a1a 40%, #1a1a1a);
}

nav .STOPPING {
    background-image: linear-gradient(165deg, #1a1a1a, #1a1a1a 60%, green 80%, #cc0);
}

nav li.STOPPING.active {
    background-image: linear-gradient(165deg, #cc0, green 20%, #1a1a1a 40%, #1a1a1a);
}


/*
 * Increase / Stable / Decrease styles
 */
.increase {
    color: var(--error-color);
}

.increase::after {
    content: "\2197";
}

.stable {
    color: var(--stable-color);
}

.stable::after {
    content: "\219d";
}

.decrease {
    color: var(--ok-color);
}

.decrease::after {
    content: "\2198";
}
