/**
 * Input/Output area styles
 *
 * @author n1474335 [n1474335@gmail.com]
 * @copyright Crown Copyright 2017
 * @license Apache-2.0
 */

#input-text,
#output-text {
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0;
    background-color: transparent;
    overflow: hidden;
    user-select: auto;
}

#output-text.html-output .cm-content,
#output-text.html-output .cm-line,
#output-html {
    display: block;
    height: 100%;
    user-select: auto;
}
#output-text.html-output .cm-line .cm-widgetBuffer,
#output-text.html-output .cm-line>br {
    display: none;
}

.cm-editor {
    height: 100%;
}

.cm-editor .cm-content {
    font-family: var(--fixed-width-font-family);
    font-size: var(--fixed-width-font-size);
    color: var(--fixed-width-font-colour);
}

#input-tabs-wrapper #input-tabs,
#output-tabs-wrapper #output-tabs {
    list-style: none;
    background-color: var(--title-background-colour);
    padding: 0;
    margin: 0;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    flex-direction: row;
    border-bottom: 1px solid var(--primary-border-colour);
    border-left: 1px solid var(--primary-border-colour);
    height: var(--tab-height);
    clear: none;
}

#input-tabs li,
#output-tabs li {
    display: flex;
    flex-direction: row;
    width: 100%;
    min-width: 120px;
    float: left;
    padding: 0px;
    text-align: center;
    border-right: 1px solid var(--primary-border-colour);
    height: var(--tab-height);
    vertical-align: middle;
}

#input-tabs li:hover,
#output-tabs li:hover {
    cursor: pointer;
    background-color: var(--primary-background-colour);
}

.active-input-tab,
.active-output-tab {
    font-weight: bold;
    background-color: var(--primary-background-colour);
}

.input-tab-content+.btn-close-tab {
    display: block;
    margin-top: auto;
    margin-bottom: auto;
    margin-right: 2px;
}

.input-tab-content+.btn-close-tab i {
    font-size: 0.8em;
}

.input-tab-buttons,
.output-tab-buttons {
    width: 25px;
    text-align: center;
    margin: 0;
    height: var(--tab-height);
    line-height: var(--tab-height);
    font-weight: bold;
    background-color: var(--title-background-colour);
    border-bottom: 1px solid var(--primary-border-colour);
}

.input-tab-buttons:hover,
.output-tab-buttons:hover {
    cursor: pointer;
    background-color: var(--primary-background-colour);
}


#btn-next-input-tab,
#btn-input-tab-dropdown,
#btn-next-output-tab,
#btn-output-tab-dropdown {
    float: right;
}

#btn-previous-input-tab,
#btn-previous-output-tab {
    float: left;
}

#btn-close-all-tabs {
    color: var(--breakpoint-font-colour) !important;
}

.input-tab-content,
.output-tab-content {
    width: 100%;
    max-width: 100%;
    padding-left: 5px;
    padding-right: 5px;
    padding-top: 10px;
    padding-bottom: 10px;
    height: var(--tab-height);
    vertical-align: middle;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.btn-close-tab {
    height: var(--tab-height);
    vertical-align: middle;
    width: fit-content;
}

.tabs-left > li:first-child {
    box-shadow: 15px 0px 15px -15px var(--primary-border-colour) inset;
}

.tabs-right > li:last-child {
    box-shadow: -15px 0px 15px -15px var(--primary-border-colour) inset;
}

#input-wrapper,
#output-wrapper {
    height: calc(100% - var(--title-height));
}

#input-wrapper.show-tabs,
#output-wrapper.show-tabs {
    height: calc(100% - var(--tab-height) - var(--title-height));
}

#output-loader {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    background-color: var(--secondary-background-colour);
    opacity: 0;
    visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;

    transition: all 0.5s ease;
}

#output-loader-animation {
    display: block;
    position: absolute;
    width: 60%;
    height: 60%;
    top: 10%;
    transition: all 0.5s ease;
}

#output-loader .loading-msg {
    opacity: 1;
    font-family: var(--primary-font-family);
    line-height: var(--primary-line-height);
    color: var(--primary-font-colour);
    left: unset;
    top: 30%;
    position: relative;

    transition: all 0.5s ease;
}

.io-info {
    margin-right: 18px;
    margin-top: 1px;
    height: 30px;
    text-align: right;
    line-height: 12px;
    font-family: var(--fixed-width-font-family);
    font-weight: normal;
    font-size: 8pt;
    display: flex;
    align-items: center;
}

.dropping-file {
    border: 5px dashed var(--drop-file-border-colour) !important;
}

#stale-indicator {
    opacity: 1;
    visibility: visible;
    transition: margin 0s, opacity 0.3s;
    margin-left: 5px;
    cursor: help;
}

#stale-indicator i {
    vertical-align: middle;
    margin-bottom: 5px;
}

#magic {
    opacity: 1;
    visibility: visible;
    transition: margin 0s 0.3s, opacity 0.3s 0.3s, visibility 0.3s 0.3s;
    margin-left: 5px;
    margin-bottom: 5px;
}

#magic.hidden,
#stale-indicator.hidden {
    visibility: hidden;
    transition: opacity 0.3s, margin 0.3s 0.3s, visibility 0.3s;
    opacity: 0;
}

#magic.hidden {
    margin-left: -32px;
}

#magic svg path {
    fill: var(--primary-font-colour);
}

.pulse {
    box-shadow: 0 0 0 0 rgba(90, 153, 212, .3);
    animation: pulse 1.5s 1;
}

.pulse:hover {
    animation-play-state: paused;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 20px rgba(90, 153, 212, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(90, 153, 212, 0);
    }
}

#input-find-options,
#output-find-options {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
}

#input-tab-body .form-group.input-group,
#output-tab-body .form-group.input-group {
    width: 70%;
    float: left;
    margin-bottom: 2rem;
}

.input-find-option .toggle-string {
    width: 70%;
    display: inline-block;
}

.input-find-option-append button {
    border-top-right-radius: 4px;
    background-color: var(--arg-background) !important;
    margin: unset;
}

.input-find-option-append button:hover {
    filter: brightness(97%);
}

.form-group.output-find-option {
    width: 70%;
    float: left;
}

#input-num-results-container,
#output-num-results-container {
    width: 20%;
    float: right;
    margin: 0;
    margin-left: 10%;
}

#input-find-options-checkboxes,
#output-find-options-checkboxes {
    list-style: none;
    padding: 0;
    margin: auto;
    overflow-x: auto;
    overflow-y: hidden;
    text-align: center;
    width: fit-content;
}

#input-find-options-checkboxes li,
#output-find-options-checkboxes li {
    display: flex;
    flex-direction: row;
    float: left;
    padding: 10px;
    text-align: center;
}


#input-search-results,
#output-search-results {
    list-style: none;
    width: 75%;
    min-width: 200px;
    margin-left: auto;
    margin-right: auto;
}

#input-search-results li,
#output-search-results li {
    padding-left: 5px;
    padding-right: 5px;
    padding-top: 10px;
    padding-bottom: 10px;
    text-align: center;
    width: 100%;
    color: var(--op-list-operation-font-colour);
    background-color: var(--op-list-operation-bg-colour);
    border-bottom: 2px solid var(--op-list-operation-border-colour);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

#input-search-results li:first-of-type,
#output-search-results li:first-of-type {
    border-top: 2px solid var(--op-list-operation-border-colour);
}

#input-search-results li:hover,
#output-search-results li:hover {
    cursor: pointer;
    filter: brightness(98%);
}

/* Highlighting */
.ͼ2.cm-focused .cm-selectionBackground {
    background-color: var(--hl5);
}

.ͼ2 .cm-selectionBackground {
    background-color: var(--hl1);
}

.ͼ1 .cm-selectionMatch {
    background-color: var(--hl2);
}

.ͼ1.cm-focused .cm-cursor.cm-cursor-primary {
    border-color: var(--primary-font-colour);
}

.ͼ1 .cm-cursor.cm-cursor-primary {
    display: block;
    border-color: var(--subtext-font-colour);
}


/* Status bar */

.cm-panel input::placeholder {
    font-size: 12px !important;
}

.ͼ2 .cm-panels,
.ͼ2 .cm-side-panels {
    background-color: var(--secondary-background-colour);
    border-color: var(--primary-border-colour);
    color: var(--primary-font-colour);
}

.cm-status-bar {
    font-family: var(--fixed-width-font-family);
    font-weight: normal;
    font-size: 8pt;
    margin: 0 5px;
    display: flex;
    flex-flow: row nowrap;
    justify-content: space-between;
    align-items: center;
}

.cm-status-bar i {
    font-size: 12pt;
    vertical-align: middle;
    margin-left: 8px;
}
.cm-status-bar>div>span:first-child i {
    margin-left: 0;
}

.cm-status-bar .disabled {
    background-color: unset !important;
    cursor: not-allowed;
}

/* Dropup Button */
.cm-status-bar-select-btn {
    border: none;
    cursor: pointer;
}

/* The container <div> - needed to position the dropup content */
.cm-status-bar-select {
    position: relative;
    display: inline-block;
}

/* Dropup content (Hidden by Default) */
.cm-status-bar-select-content {
    display: none;
    position: absolute;
    bottom: 20px;
    right: 0;
    background-color: #f1f1f1;
    min-width: 200px;
    box-shadow: 0px 4px 4px 0px rgba(0,0,0,0.2);
    z-index: 1;
}

/* Links inside the dropup */
.cm-status-bar-select-content a {
    color: black;
    padding: 2px 5px;
    text-decoration: none;
    display: block;
}

/* Change color of dropup links on hover */
.cm-status-bar-select-content a:hover {
    background-color: #ddd
}

/* Change the background color of the dropup button when the dropup content is shown */
.cm-status-bar-select:hover .cm-status-bar-select-btn {
    background-color: #f1f1f1;
}

/* The search field */
.cm-status-bar-filter-input {
    box-sizing: border-box;
    font-size: 12px;
    padding-left: 10px !important;
    border: none;
}

.cm-status-bar-filter-search {
    border-top: 1px solid #ddd;
}

/* Show the dropup menu */
.cm-status-bar-select .show {
    display: block;
}

.cm-status-bar-select-scroll {
    overflow-y: auto;
    max-height: 300px;
}

.chr-enc-value {
    max-width: 150px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}


/* File details panel */

.cm-file-details {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    padding-bottom: 21px;
    height: 100%;
}

.file-details-toggle-shown,
.file-details-toggle-hidden {
    width: 8px;
    height: 40px;
    border: 1px solid var(--secondary-border-colour);
    position: absolute;
    top: calc(50% - 20px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--secondary-border-colour);
    color: var(--subtext-font-colour);
    z-index: 1;
}

.file-details-toggle-shown {
    left: 0;
    border-left: none;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
}

.file-details-toggle-hidden {
    left: -8px;
    border-right: none;
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
}

.file-details-toggle-shown:hover,
.file-details-toggle-hidden:hover {
    background-color: var(--primary-border-colour);
    border-color: var(--primary-border-colour);
    color: var(--primary-font-colour);
}

.file-details-heading {
    font-weight: bold;
    margin: 10px 0 10px 0;
}

.file-details-data {
    text-align: left;
    margin: 10px 2px;
}

.file-details-data td {
    padding: 0 3px;
    max-width: 130px;
    min-width: 60px;
    overflow: hidden;
    vertical-align: top;
    word-break: break-all;
}

.file-details-error {
    color: #f00;
}

.file-details-thumbnail {
    max-width: 180px;
}
