html,
body,
#main-grid {
    margin: 0;
    padding: 0;
    height: 100%;
    color: white;
    line-height: 1em;
    overflow: hidden;
}

body {
    font-size: 16px;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

noscript h1 {
    padding-top: 0.5em;
    padding-left: 10px;
    color: black;
    font-family: monospace;
    font-size: 22px;
}

noscript span {
    color: black;
    padding: 10px;
    font-family: monospace;
    font-size: 12px;
}

/* INPUTS ------------------------------------------------------------------ */
button {
    background: transparent;
    border: 1px solid grey;
    color: white;
    outline: none;
    cursor: pointer;
}

button:active {
    background-color: grey;
    outline: none;
}

button:disabled {
    cursor: not-allowed;
    color: grey;
}

.disabled {
    pointer-events: none;
    cursor: not-allowed;
    opacity: 0.65;
    filter: alpha(opacity=65);
}

/* ANIMATIONS -------------------------------------------------------------- */
@keyframes pulse {
    0% {
        opacity: 0.25;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.25;
    }

}

.pulsing {
    animation-name: pulse;
    animation-duration: 0.75s;
    animation-iteration-count: infinite;
}

/* MAIN GRID --------------------------------------------------------------- */
#main-grid {
    display: grid;
    grid-template-columns: auto;
    grid-template-rows: 1.5em 80% auto;
}

#main-grid #top {
    grid-column-start: 1;
    grid-column-end: 1;
    grid-row-start: 1;
    grid-row-end: 1;

    background: rgba(5, 5, 5, 0.75);
    padding: 0.25em 0.2em;
}

#main-grid iframe {
    grid-column-start: 1;
    grid-column-end: 1;
    grid-row-start: 2;
    grid-row-end: 4;

    border: 0;
    height: 100%;
    width: 100%;
    background: url('/_flamingo/static/loading.svg');
    background-repeat: no-repeat;
    background-position: center;
}

/* TOP BAR ----------------------------------------------------------------- */
#main-grid #top span {
    margin-right: 0.5em;
    cursor: pointer;
    user-select: none;
}

#main-grid #top span#logo {
    font-weight: bold;
}

#main-grid #top span#critical-errors {
    background-color: red;
    color: white;
    font-weight: bold;
}

#main-grid #top span#errors {
    color: red;
}

#main-grid #top span#warnings {
    color: yellow;
}

/* OVERLAY ----------------------------------------------------------------- */
#overlay {
    grid-column-start: 1;
    grid-column-end: 2;
    grid-row-start: 2;
    grid-row-end: 3;
    display: grid;

    grid-template-columns: auto;
    grid-template-rows: 2em 2.5em auto;

    padding: 0em 1em;
    background: rgba(5, 5, 5, 0.75);
    font-weight: bold;
    z-index: 2000;
}

#overlay #status {
    grid-column-start: 1;
    grid-column-end: 2;
    grid-row-start: 1;
    grid-row-end: 2;

    padding-top: 0.5em;
    font-size: 1.5em;
    text-align: left;
    user-select: none;
}

#overlay #controls {
    grid-column-start: 1;
    grid-column-end: 2;
    grid-row-start: 1;
    grid-row-end: 2;

    text-align: right;
    user-select: none;
}

/* CONTROLS ---------------------------------------------------------------- */
#overlay #controls button {
    margin-left: 0.25em;
}

/* TABS -------------------------------------------------------------------- */
.tabs {
    grid-column-start: 1;
    grid-column-end: 2;
    grid-row-start: 2;
    grid-row-end: 3;

    display: grid;
    grid: auto-flow dense / max-content auto max-content;
    grid-template-rows: auto;

    padding-top: 0.5em;
    user-select: none;
}

.tabs .tab {
    padding: 0.2em 0.75em 0.2em 0.5em;
    float: left;
    cursor: pointer;
    border: 1px solid grey;
    color: grey;
}

.tabs .tab.active {
    color: white;
    border-bottom: transparent;
}

.tabs .left {
    grid-column-start: 1;
    grid-column-end: 2;
}

.tabs .middle {
    grid-column-start: 2;
    grid-column-end: 3;
}

.tabs .right {
    grid-column-start: 3;
    grid-column-end: 4;
}

.tabs .spacer {
    content: " ";
    height: calc(1.4em + 1px);
    border-bottom: 1px solid grey;
}

.tabs .left .spacer {
    float: left;
    width: 0.5em;
}

.tabs .middle .spacer {
    width: 100%;
}

.tabs .right .spacer {
    float: left;
    width: 0.5em;
}

#tab-content {
    grid-column-start: 1;
    grid-column-end: 2;
    grid-row-start: 3;
    grid-row-end: 4;

    padding-bottom: 1em;
    overflow: auto;
}

/* ATTRIBUTE TABLE --------------------------------------------------------- */
table.attributes {
    border: 1px solid grey;
    font-family: Courier;
    width: 100%;
    font-size: 75%;
}

table.attributes tr:nth-child(even) {
    background-color: rgba(128, 128, 128, 0.75);
}

table.attributes td,
table.attributes th {
    padding-right: 0.5em;
    vertical-align: top;
}

table.attributes .key {
    text-align: right;
    font-weight: bold;
}

table.attributes .value {
    width: 100%;
}

table.attributes .value pre {
    margin: 0;
    padding: 0;
}

table.attributes .type {
    text-align: right;
}

table.attributes.editable td,
table.attributes.editable th {
    vertical-align: baseline;
}

table.attributes th.label {
    text-align: left;
    font-size: 130%;
    padding: 0.2em;
}

/* plugin options ---------------------------------------------------------- */
.plugin-options-help {
    font-weight: normal;
    margin-bottom: 1em;
    font-size: 90%;
}

.plugin-options-help span.show,
.plugin-options-help span.hide {
    cursor: pointer;
    user-select: none;
}

.plugin-options-help.hide span.hide {
    display: none;
}

.plugin-options-help.show span.show {
    display: none;
}

.plugin-options-help .help-text {
    padding-left: 2em;
}

.plugin-options-help.hide .help-text {
    display: none;
}

/* log --------------------------------------------------------------------- */
.log {
    display: grid;
    grid-template-rows: 1.5em auto;

    height: 100%;
}

.log .level {
    grid-column-start: 1;
    grid-column-end: 1;
    grid-row-start: 1;
    grid-row-end: 1;
}

.log .level #log-controls {
    float: right;
}

.log .sub-grid {
    display: grid;
    grid-column-start: 1;
    grid-column-end: 1;
    grid-row-start: 2;
    grid-row-end: 3;

    grid: auto-flow dense / max-content auto max-content;
    grid-template-rows: auto;

    height: 100%;
    overflow: hidden;
    border-top: 1px solid grey;
}

.log .logger {
    grid-column-start: 1;
    grid-column-end: 2;
    grid-row-start: 1;
    grid-row-end: 2;

    height: 100%;
    overflow: auto;
    padding-top: 0.25em;
    padding-right: 0.5em;
}

.log .records {
    grid-column-start: 2;
    grid-column-end: 3;
    grid-row-start: 1;
    grid-row-end: 2;

    height: calc(100% - 5px);
    overflow: auto;
    border-left: 1px solid grey;
    padding: 0.25em 0 0.5em 0.25em;
    font-weight: normal;

    color: limegreen;
}

.log .records * {
    overflow-anchor: none;
}

.scroll-anchor {
    overflow-anchor: auto !important;
    height: 1px;
}

.log pre {
    margin: 0;
    font-weight: normal;
    font-size: 14px;
    line-heigth: 1ex;
}

.log .records span.INFO {
    color: white;
}

.log .records span.WARNING {
    color: yellow;
}

.log .records span.ERROR {
    color: red;
}

.log .records span.CRITICAL {
    background-color: red;
    color: white;
    font-weight: bold;
}

/* MESSAGES ---------------------------------------------------------------- */
#messages {
    grid-column-start: 1;
    grid-column-end: 1;
    grid-row-start: 2;
    grid-row-end: 4;

    padding-top: 0.5em;
    pointer-events:none;
    user-select: none;

    z-index: 1000;
}

#messages .message {
    background: rgba(5, 5, 5, 0.75);
    padding: 0 0.2em;
    line-height: normal;
    cursor: pointer;
    pointer-events: auto;
}

#messages .important {
    color: #E96D79;
}
