
:root {
    /* TODO keep defaults for validity but embed dynamically via JS */
    --movement-transition: 0.15s;
    --zoom-transition: 0.20s;
}


/* general */

html,
html > body {
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
}

#panes {
    display: flex;
    /* flex-direction: row; */
    /* gap: 6px; */
    /* align-items: stretch; */
    /* display: grid; */
    column-gap: 4px;
    row-gap: 4px;
    padding: 4px;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

@media screen and (orientation:landscape) {
    #panes {
        /* grid-template-columns: 1fr 1fr; */
        flex-direction: row;
    }
}

@media screen and (orientation:portrait) {
    #panes {
        /* grid-template-rows: 1fr 1fr; */
        flex-direction: column;
    }
}

#pane-world,
#pane-components {
    flex: 0 0 50%;
}

.pane-description {
    background-color: #ffffff;
    padding: 1em;
}

#pane-world {
    position: relative;
    overflow: hidden;
    image-rendering: pixelated;
    outline: 2px solid #888888;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 256px 128px;
    /* "Space loading..." indicator. */
    background-image: url("data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAyNTYgMTI4IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjx0ZXh0IHg9IjEyOC4xMDQxOSIgeT0iMTA4LjQ1NzAyIiBmaWxsPSIjZmZmZmZmIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNnB4IiB0ZXh0LWFsaWduPSJjZW50ZXIiIHRleHQtYW5jaG9yPSJtaWRkbGUiPjx0c3BhbiB4PSIxMjguMTA0MTkiIHk9IjEwOC40NTcwMiIgZmlsbD0iI2ZmZmZmZiIgZm9udC1mYW1pbHk9InNhbnMiPkxvYWRpbmcgc3BhY2UuLi48L3RzcGFuPjwvdGV4dD48cGF0aCBkPSJtMTI4IDE2YTMyIDMyIDAgMCAwLTMyIDMyIDMyIDMyIDAgMCAwIDMyIDMyIDMyIDMyIDAgMCAwIDMyLTMyaC04YTI0IDI0IDAgMCAxLTI0IDI0IDI0IDI0IDAgMCAxLTI0LTI0IDI0IDI0IDAgMCAxIDI0LTI0eiIgZmlsbD0iI2ZmZmZmZiI+PGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiBkdXI9IjVzIiBmcm9tPSIwIDEyOCA0OCIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIHRvPSIzNjAgMTI4IDQ4IiB0eXBlPSJyb3RhdGUiLz48L3BhdGg+PC9zdmc+IA==");
}

#pane-world:not(:focus) {
    outline: none;
    filter: grayscale(75%);
}

.map-background,
.map-foreground {
    background-position: 0 0;
    background-repeat: no-repeat;
}

#pane-world .map-container,
#pane-world .map-container > * {
    position: absolute;
    /* height: 100%; */
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
}

.map-avatars .avatar,
.map-gadgets .gadget {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* .map-avatars, */
.map-avatars .avatar,
.map-gadgets .gadget {
    transition:
        left var(--movement-transition) ease-in-out,
        top var(--movement-transition) ease-in-out;
}

.map-avatars .avatar .avatar-name {
    top: -2em;
    position: relative;
    color: #ffffff;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.75);
    padding: 0.3em 0.5em;
    border-radius: 0.5em;
    font-size: 0.75em;
    z-index: 100;
    white-space: nowrap;
}

.map-container {
    /*
     * Guess what! The 'zoom' property is officiallnot not animatable. Chrome
     * will mess up if animating 'zoom' is attempted. But Firefox messes up,
     * if it doesn't attempt it. Good job, guys. Anyway, using 'transform:
     * scale()' would work, but that will introduce anchoring problems and we
     * won't get into that now.
     */
    transition:
        left var(--movement-transition) ease-in-out,
        top var(--movement-transition) ease-in-out;
    -moz-transition:
        left var(--movement-transition) ease-in-out,
        top var(--movement-transition) ease-in-out,
        zoom var(--zoom-transition) ease-out;
}

/* .map-background, .map-foreground { */
/*     transition: background-position 0.2s; */
/* } */

.avatar-self {
    z-index: 10;
}

#pane-world .map-controls {
    position: absolute;
    width: 120px;
    height: 120px;
    right: 10px;
    bottom: 10px;
    display: none;
}

#pane-world:focus .map-controls {
    display: block;
}

.map-controls > * {
    position: absolute;
    width: 36px;
    height: 36px;
    background-color: #cccccc;
    border-radius: 20px;
    border: 2px solid #444444;
    line-height: 36px;
    font-size: 24px;
    color: #444444;
    vertical-align: middle;
    font-family: sans-serif;
    cursor: pointer;
    user-select: none;
    opacity: 0.5;
    text-align: center;
}

.map-controls .map-control-left {
    left: 0px;
    top: 40px;
}

.map-controls .map-control-right {
    left: 80px;
    top: 40px;
}

.map-controls .map-control-up {
    left: 40px;
    top: 0px;
}

.map-controls .map-control-down {
    left: 40px;
    top: 80px;
}


#pane-components {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
}

.tab {
    padding: 0.5em 1em 0.25em;
    color: #555555;
    background-color: #aaaaaa;
    /* border: 0 solid #444444; */
    border-width: 1px 1px 1px 0;
    margin: 0 0.2em;
    border-radius: 0.5em 0.5em 0 0;
    cursor: pointer;
    order: 100;
}

.tab.tab-active {
    color: #000000;
    background-color: #ffffff;
    cursor: auto;
}

.tab-spacer {
    flex-grow: 1;
    order: 200;
}

.tab-right {
    order: 300;
}

.tab-contents {
    background-color: #ffffff;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tab-content {
    display: none;
    flex-grow: 1;
    overflow-y: auto;
    /* delay display of loading info */
    transition: background-size 0s step-end 1.5s;
    background-size: 0 0;
}

.tab-content.tab-active {
    display: block;
}

.tab-highlight {
    background-color: #ffff7f;
}

.text-read-only {
    padding: 1.5em 2.5em;
}



h1, h2, h3, h4, h5, h6 {
    font-family: sans;
}

h2 {
    border-top: 1px dashed gray;
    padding-top: 1em;
    margin-top: 1em;
}

iframe {
    border-width: 0;
    display: block;
}


.notification {
    margin: 0.5em 0;
    padding: 0.5em 1em;
    padding-left: 4em;
    color: #444444;
    border: 1px solid #888888;
    background-color: #eeeeee;
    /* TODO nice svg things */
    /* background-image: ...; */
}

.notification-info {
    /* default to above */
}

.notification-error {
    color: #662222;
    border: 1px solid #aa6666;
    background-color: #ffdddd;
    /* TODO nice svg things */
    /* background-image: ...; */    
}

.notification-warning {
    color: #666622;
    border: 1px solid #aaaa66;
    background-color: #ffffdd;
    /* TODO nice svg things */
    /* background-image: ...; */    
}

.loading-gadget {
    background-repeat: no-repeat;
    background-position: center;
    background-size: 256px 128px;
    background-image: url("loading-gadget.svg");
}



/* JSON Editor styling */

.je-ready {
    font-family: sans;
}

.je-ready [data-schemapath="root"] > .je-header {
    font-size: 2em;
    font-weight: bold;
    margin-block: 0.67em;
}

.je-ready .je-header {
    /* font-size: 1.25em; */
    /* font-weight: bold; */
    /* padding: 1.5em 0; */
  display: block;
  font-size: 1.5em;
  font-weight: bold;
  margin-block: 0.83em;
}

.je-ready .je-indented-panel {
    border-left: none;
    padding-left: 0;
    margin-left: 0;
}

.je-ready .form-control {
    display: inline-block;
}

.je-ready .form-control > label {
    display: inline-block;
    /* TODO add proper value */
    min-width: 10em;
}

.je-ready .form-control > p {
    font-size: 0.8em;
    color: #444;
}

.je-ready .row {
    /* margin-bottom: 1.5em; */
}

/* TODO proper access to that button */
.je-ready + div button {
    padding: 0.5em 1.0em;
    margin: 1em;
    font-size: 1.125em;
}

.je-ready .je-object__controls {
    margin: 0;
}

.je-ready .row .je-object__container {
  border-top: 1px dashed gray;
  margin-top: 2.0em;
  padding-top: 1.0em;
}

.je-ready > .je-object__container {
  border-bottom: 1px dashed gray;
  margin-bottom: 1.5em;
  padding-bottom: 1.5em;
}
