:root {
    --grammarTitleHeight: 0px;
}


/* Fonts */
@font-face {
    /* Font author: Ryoichi Tsunekawa
       https://github.com/dharmatype/Sometype-Mono
     */
    font-family: sometypeMono;
    src: url(../fonts/sometype-mono.regular.ttf);
}

@font-face {
    /* Font author: Rob Leuschke
       http://www.typesetit.com/
     */
    font-family: greatVibes;
    src: url(../fonts/great-vibes.regular.ttf);
}

.greatVibes {
    font-family: greatVibes, cursive;
}


/* Bootstrap */
.form-check {
    padding-left: 0;
}

.form-check .form-check-input {
    margin-left: 0;
}

.form-check-label {
    padding-left: 0.5rem;
}


/* Codemirror */
.CodeMirror {
    height: 100%;
    line-height: 1.5;
    font-size: 1rem;
    color: #212529;
    border-top-right-radius: 0.25rem;
    -moz-border-radius-topright: 0.25rem;
    -webkit-border-top-right-radius: 0.25rem;
    border-bottom-right-radius: 0.25rem;
    -moz-border-radius-bottomright: 0.25rem;
    -webkit-border-bottom-right-radius: 0.25rem;
}

.disabledText {
    color: #999;
}


/* Main */
#mainContainer {
    min-width: 470px;
    height: 100vh;
    min-height: 100vh;
}

#mobileWarning {
    display: none;
}

noscript {
    display: block;
    width: 50%;
    margin: 3rem auto 0;
    text-align: center;
}


/* Header */
.helpAboutButton {
    display: flex;
    width: 32px;
    height: 32px;
    padding: 0;
}

.helpAboutButton > svg {
    margin: auto;
}


/* Footer */
footer {
    flex: 1;
    position: relative;
    min-height: 6.5rem;
}

footer div {
    width: 100%;
    position: absolute;
    bottom: 0;
    margin-top: 3rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
}


/* Grammar input */
#grammarErrorMessages {
    display: none;
}

#grammarTitle {
    height: var(--grammarTitleHeight);
    line-height: var(--grammarTitleHeight);
    border-top-right-radius: 0.25rem;
    border-bottom: 1px solid #ddd;
}

#grammarTitleComment {
    font-size: 1rem;
    font-weight: 400;
    min-width: 21px;
    width: 21px;
    padding: 0 3px 0 5px;
    border-right: 1px solid #ddd;
    background-color: #f7f7f7;
}

#grammarTitleText {
    width: 100%;
    padding-left: 4px;
    color: #999;
    background-color: #fdfdfd;
    border-top-right-radius: 0.25rem;
}

#grammarInputWrapper {
    height: calc(100% - var(--grammarTitleHeight));
}

#grammarSelect {
    background-color: #fff;
    border: 1px solid #ced4da;
    color: #212529;
}


/* Local dependency exercise */
#dependenciesExercise {
    display: none;
}

#dependencyGraphsRow {
    margin-left: 8px;
    margin-right: 8px;
}

.dependenciesGraphCard .card {
    width: 402px;
}

.dependenciesGraphCardHeader {
    font-family: sometypeMono, monospace;
    height: 3rem;
}

.dependenciesGraphCardTitle {
    margin: 0;
    vertical-align: middle;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 324px;
}

.showGraphErrorsBtn {
    display: none;
    margin: 0 0 0 auto;
}

.dependencyGraphCorrectIcon {
    color: #198754;
    margin-left: auto;
}

.graphErrors {
    display: none;
    position: absolute;
    z-index: 5;

    border-radius: 0.5rem;
    -moz-border-radius: 0.5rem;
    -webkit-border-radius: 0.5rem;
    background: #f8d7da;
    opacity: 90%;

    width: 80%;
    max-height: 280px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    overflow-y: auto;

    font-size: 0.85rem;
    color: #842029;
}

.graphErrors ul {
    margin: 0;
    padding: 0.75rem 1rem 0.75rem 2rem;
}

.graphErrors li {
    line-height: 1.5rem;
}

.graphErrors li:not(:last-child) {
    margin-bottom: 0.5rem;
}


.dependenciesRecenterBtn {
    display: flex;
    height: 100%;
}

.dependenciesRecenterBtn > svg {
    display: block;
    -webkit-transition: fill 0.1s ease-out;
    -moz-transition: fill 0.1s ease-out;
    -o-transition: fill 0.1s ease-out;
    transition: fill 0.1s ease-out;
    fill: #6c757d;
}

.dependenciesRecenterBtn:hover > svg {
    fill: #fff;
}


/* Strong acyclicity exercise */
.errorText {
    color: #c71929 !important;
}

.errorRadio {
    border: 2px solid #c71929;
}

.errorTextInput {
    border-bottom: 2px solid #c71929 !important;
}

#acyclicityExercise {
    display: none;
}

#acyclicity-collapse .accordion-body {
    position: relative;
}

#shortcutEnd {
    position: absolute;
    top: 0;
    right: 0;
    width: 10px;
    height: 10px;
}

#acyclicityExerciseNotEnabledWarning {
    width: 50%;
    position: absolute;
    top: 5rem;
    left: 50%;
    transform: translate(-50%, 0);
    opacity: 90%;
    z-index: 9999;
}

.acyclicityNonterminalContainer[data-nonterminal='-1'] {
    display: none;
}

.acyclicityIterationHeaderContainer {
    position: relative;
}

.acyclicityNonterminalContainer:not(:first-of-type) {
    padding-top: 1rem;
}

.gradient {
    position: absolute;
    width: 6px;
    height: 100%;
    z-index: 999; /* needs to be under 1080, because that is the z-index of the bootstrap tooltip */
}

.leftGradient {
    left: 105px;
    background: rgb(255, 255, 255);
    background: -moz-linear-gradient(90deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
    background: -webkit-linear-gradient(90deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
    background: linear-gradient(90deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffffff", endColorstr="#ffffff", GradientType=1);
}

.rightGradient {
    right: 0;
    background: rgb(255, 255, 255);
    background: -moz-linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
    background: -webkit-linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffffff", endColorstr="#ffffff", GradientType=1);
}

.acyclicityIterationHeader {
    margin: 0 0 0.5rem 105px;
    overflow: hidden;
    white-space: nowrap;
}

.acyclicityIterationHeader ul {
    padding: 0;
    margin: 0;
    font-size: 0; /* hack to avoid a whitespace between li */
}

.acyclicityIterationHeader li {
    display: inline-block;
    width: 402px;
    line-height: 40px;
    margin: 0 1rem;
    border-radius: 0.25rem;
    -moz-border-radius: 0.25rem;
    -webkit-border-radius: 0.25rem;
    font-size: 1rem;
    text-align: center;
    vertical-align: center;
    background-color: #f7f7f7;
    border: 1px solid #dfdfdf;
}

.acyclicityContent {
    display: flex;
}

.acyclicityNonterminalTitle {
    overflow: hidden;
    flex: 0 0 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: sometypeMono, monospace;
    font-size: 18px;
    background-color: #e7f1ff;
    border: 1px solid #dfdfdf;
    border-radius: 0.25rem;
    -moz-border-radius: 0.25rem;
    -webkit-border-radius: 0.25rem;
}

.acyclicityProductionRules {
    flex-grow: 1;
    margin-left: 15px;
    overflow: hidden;
}

.acyclicityProductionRule[data-production='-1'] {
    display: none !important;
}

.acyclicityProductionRule {
    height: 390px;
}

.acyclicityProductionRule:not([data-production='-1']):not(:nth-of-type(2)) {
    margin-top: 1rem;
}

.acyclicityProductionRuleText {
    max-height: 394px;
    overflow: hidden;
    white-space: nowrap;
    display: flex;
    flex: 0 0 40px;
    justify-content: center;
    align-items: center;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: sometypeMono, monospace;
    background-color: #f7f7f7;
    border: 1px solid #dfdfdf;
    border-top-right-radius: 0.25rem;
    -moz-border-radius-topright: 0.25rem;
    -webkit-border-top-right-radius: 0.25rem;
    border-bottom-right-radius: 0.25rem;
    -moz-border-radius-bottomright: 0.25rem;
    -webkit-border-bottom-right-radius: 0.25rem;
}

.acyclicityGraphsRow {
    width: 100%;
    border: 1px solid #dfdfdf;
    border-left: 0;
    overflow-x: scroll;
}

.acyclicityGraphCardContainer {
    width: 402px;
    margin: 1rem;
}

.acyclicityGraphCardContainer[data-iteration='-1'] {
    display: none;
}

.acyclicityGraphCard {
    position: relative;
}

.acyclicityLinkTypes {
    position: absolute;
    top: 10px;
    left: 30px;
}

.acyclicityLinkTypesButton {
    position: relative;
}

.acyclicityLinkTypesButton input {
    width: 0;
    height: 0;
    visibility: hidden;
}

.acyclicityLinkTypesButton label {
    position: absolute;
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    width: 40px;
    height: 14px;
    border: 3px solid #fff;
    border-radius: 2px;
    -moz-border-radius: 2px;
    -webkit-border-radius: 2px;
    transition: all 0.2s ease;
}

.acyclicityLinkTypesButton > input:checked + label {
    box-shadow: 0 0 4px rgba(0, 0, 0, .4);
}

.acyclicityLinkTypesButton .redecorated {
    background-color: rgba(70, 187, 0, .6);
}

.acyclicityLinkTypesButton label.redecorated:hover,
.acyclicityLinkTypesButton input:checked + label.redecorated {
    background-color: rgba(70, 187, 0, 1);
}

.acyclicityLinkTypesButton .projected {
    background-color: rgba(255, 191, 0, .6);
}

.acyclicityLinkTypesButton label.projected:hover,
.acyclicityLinkTypesButton input:checked + label.projected {
    background-color: rgba(255, 191, 0, 1);
}

.acyclicityCycleFound {
    font-size: 0.875rem;
    color: #6c757d;
}

.acyclicityCycleFound p {
    padding: 0 1rem;
    margin: 0;
}

.acyclicityWarningIcon {
    margin: auto 0.5rem auto auto;
    color: #c71929;
    display: none;
    cursor: pointer;
}

.acyclicityGraphCorrectIcon {
    margin: auto 0.5rem auto auto;
    color: #198754;
    display: none;
}

.listInTooltip {
    padding-left: 0.9rem !important;
    font-size: 0.8rem !important;
    text-align: left;
}

.acyclicityGraph {
    min-width: 400px;
    height: 300px;
    border-top-left-radius: 0.25rem;
    -moz-border-radius-topleft: 0.25rem;
    -webkit-border-top-left-radius: 0.25rem;
    border-top-right-radius: 0.25rem;
    -moz-border-radius-topright: 0.25rem;
    -webkit-border-top-right-radius: 0.25rem;
}

.acyclicityTransitiveRelationsContainer {
    margin-top: 1rem;
    width: 100%;
    min-height: 53px;
}

.acyclicityTransitiveRelationsText {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 40px;
    padding-top: 6px;
    background-color: #f7f7f7;
    border: 1px solid #dfdfdf;
    border-top-left-radius: 0.25rem;
    -moz-border-radius-topleft: 0.25rem;
    -webkit-border-top-left-radius: 0.25rem;
    border-bottom-left-radius: 0.25rem;
    -moz-border-radius-bottomleft: 0.25rem;
    -webkit-border-bottom-left-radius: 0.25rem;
}

.acyclicityTransitiveRelations {
    padding: 8px 0;
    overflow: hidden;
    white-space: nowrap;
    border: 1px solid #dfdfdf;
    border-left: 0;
}

.acyclicityTransitiveRelations ul {
    padding: 0;
    margin: 0;
    font-size: 0; /* hack to avoid a whitespace between li */
}

.acyclicityTransitiveRelationsItem {
    display: inline-block;
    width: 402px;
    height: 35px;
    line-height: 35px;
    margin: 0 16px;
    border-radius: 0.25rem;
    -moz-border-radius: 0.25rem;
    -webkit-border-radius: 0.25rem;
    font-size: 1rem;
    vertical-align: center;
    align-items: center;
}

.acyclicityTransitiveRelationsItem[data-iteration='-1'] {
    display: none;
}

.acyclicityTransitiveRelations label {
    margin-right: 0.5rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.acyclicityTransitiveRelations input {
    flex: 1;
    align-items: center;
    height: 35px;
    padding: 0;
    border: 0;
    border-bottom: 2px solid #dfdfdf;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
    font-family: monospace;
}

.acyclicityTransitiveRelations input:focus {
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.acyclicityTransitiveRelations input::placeholder {
    color: #ccc;
}

#acyclicityFooterContainer {
    display: none;
    margin-top: 2rem;
    position: relative;
}

#acyclicityFooter {
    margin-left: 105px;
    overflow: hidden;
    white-space: nowrap;
}

#acyclicityFooter ul {
    padding: 0;
    margin: 0;
    font-size: 0; /* hack to avoid a whitespace between li */
}

.acyclicityIterationFooter[data-iteration='-1'] {
    display: none;
}

.acyclicityIterationFooter {
    position: relative;
    background-color: #f7f7f7;
    display: inline-block;
    width: 402px;
    line-height: 1.5rem;
    margin: 0 1rem;
    font-size: 1rem;
    text-align: center;
    vertical-align: center;
    border-radius: 0.25rem;
    -moz-border-radius: 0.25rem;
    -webkit-border-radius: 0.25rem;
    border: 1px solid #dfdfdf;
}

.acyclicityIterationFooter p {
    padding: 0;
    margin: auto 1rem auto 0.5rem;
}

.acyclicityIterationFooter div {
    margin-top: auto;
    margin-bottom: auto;
}

.shortcutNext {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    background-color: #f7f7f7;
}

#strongAcyclicityQuestion {
    display: none;
}

#congrats {
    display: none;
    color: #0f5132;
}

.redFlash {
    -webkit-animation-name: redFlash;
    -webkit-animation-duration: 800ms;
    -webkit-animation-iteration-count: 1;
    -webkit-animation-timing-function: ease-in-out;
    animation-name: redFlash;
    animation-duration: 800ms;
    animation-iteration-count: 1;
    animation-timing-function: ease-in-out;
}

@-webkit-keyframes redFlash {
    0% {
        background-color: #c71929;
        border-color: #c71929;
        box-shadow: 0 0 0 .25rem rgba(199, 25, 41, 0.5);
    }
    40% {
        background-color: #c71929;
        border-color: #c71929;
        box-shadow: 0 0 0 .25rem rgba(199, 25, 41, 0.5);
    }
    100% {
        background-color: #0b5ed7;
        border-color: #0a58ca;
    }
}

@keyframes redFlash {
    0% {
        background-color: #c71929;
        border-color: #c71929;
        box-shadow: 0 0 0 .25rem rgba(199, 25, 41, 0.5);
    }
    40% {
        background-color: #c71929;
        border-color: #c71929;
        box-shadow: 0 0 0 .25rem rgba(199, 25, 41, 0.5);
    }
    100% {
        background-color: #0b5ed7;
        border-color: #0a58ca;
    }
}


/* About */
#aboutContent img {
    max-width: 662px;
}


/* Help */
#help code {
    border-radius: 5px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border: 1px solid #BCBEC0;
    color: #111;
    padding: 2px 5px;
    font: 12px Monaco, Consolas, "Andale  Mono", "DejaVu Sans Mono", monospace;
    white-space: nowrap;
}

#help kbd {
    white-space: nowrap;
}

#helpContents {
    font-size: .9rem;
}

#help .col-sm-1 {
    min-width: 60px;
}

#help .col-sm-2 {
    min-width: 130px;
}

#help .col-sm-3 {
    min-width: 215px;
}

#helpGreenEdge {
    width: 40px;
    height: 8px;
    background-color: #46BB00;
}

#helpYellowEdge {
    width: 40px;
    height: 8px;
    background-color: #FFBF00;
}


/* General */
a[target="_blank"]:after {
    /* Add 'open in new tab'-icon after all links, which open in new tab */
    content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVR42qXKwQkAIAxDUUdxtO6/RBQkQZvSi8I/pL4BoGw/XPkh4XigPmsUgh0626AjRsgxHTkUThsG2T/sIlzdTsp52kSS1wAAAABJRU5ErkJggg==);
    margin: 0 3px 0 5px;
}

.noselect {
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
    -khtml-user-select: none; /* Konqueror HTML */
    -moz-user-select: none; /* Old versions of Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none; /* Non-prefixed version, currently supported by Chrome, Edge, Opera and Firefox */
}

.hide {
    display: none !important;
}

/* JointJS */
.joint-tool[data-tool-name="connect"]:not(:hover) {
    opacity: 0;
}

.joint-tool[data-tool-name="button"] circle {
    fill: #333;
    opacity: 0.5;
}

.acyclicityGraph .joint-type-attrsys-symbollink > path,
.acyclicityGraph .joint-type-attrsys-attributelink > path {
    cursor: default;
}