html {
    overflow-x: hidden;
}

body {
    background-color: #eee;
    margin: 0;
    font-family: Arial, sans-serif;
}

nav, .container, footer {
    min-width: 360px;
}

nav {
    background-color: #0073E7;
    color: #fff;
    font-family: Arial, sans-serif;
    height: 50px;
    line-height: 50px;
    padding: 14px 0 14px 14px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

.container {
    clear: both;
    margin: 0 auto;
    overflow: hidden;
}

nav .logo {
    display: block;
    float: left;
    height: 32px;
    margin-top: 10px;
    border-right: #e6e6e6 1px solid;
    padding-right: 18px;
}

nav .title {
    display: block;
    float: left;
    font-size: 42px;
    font-weight: bold;
    margin-left: 16px;
}

main {
    clear: both;
    position: fixed;
    top: 80px;
    bottom: 50px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

main > * {
    flex: 1;
}

#main-noscript {
    font-size: 24px;
    margin-top: 8px;
    text-align: center;
}

article {
    clear: both;
    text-align: justify;
    margin: 80px 0 80px 0;
}

.container-code {
    flex: 1;

    display: flex;
    flex-direction: column;
    margin: 4px;
}

.container-code .caption {
    display: block;
    font-family: Arial;
    font-size: 24px;
    margin-bottom: 4px;
    flex: 0;
}

.container-editor {
    flex: 1;
}

.code-input {
    font-family: Consolas, monospace;
    width: 100%;
    height: 100%;
}

.container-controls {
    padding: 8px;
}

#container-loading {
    display: flex;
    flex-direction: column;
    pointer-events: none;
    position: absolute;
    left: 50%;
    right: 0;
    top: 0;
    bottom: 0;
    margin: 0;
    z-index: 99999999;
}

#container-loading :nth-child(1) { flex: 1; }
#container-loading :nth-child(2) { flex: 0; }
#container-loading :nth-child(3) { flex: 0; }
#container-loading :nth-child(4) { flex: 1; }

#error-message {
    color: red;
    font-size: 24px;
    text-align: center;
    margin-top: 24px;
}

footer {
    background: #293138;
    color: #a0a0a0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    font-size: 14px;
    padding: 8px;
    overflow: hidden;
}

footer a:hover {
    text-decoration: underline;
}

#footer-copyright {
    float: left;
    margin-right: 8px;
}

#footer-right {
    float: right;
}

a {
    color: inherit;
    text-decoration: none;
}

#container-options {
    border: 1px solid #ccc;
    margin-top: 8px;
    display: flex;
    flex-direction: row;
    font-size: 14px;
}

#container-options > :first-child,
#container-options > :last-child {
    flex: 1;
}

#container-options .control-line {
    padding: 2px;
}

#container-options input[type=checkbox] {
    margin: 2px 0 0 0;
    vertical-align: top;
}

/******************************************************************************
 * Responsive tweaks
 *****************************************************************************/
@media (max-width: 768px) {
    nav {
        height: 32px;
        line-height: 32px;
    }
    nav .logo {
        height: 24px;
        margin-top: 4px;
        padding-right: 10px;
    }
    nav .title {
        font-size: 20px;
        margin-left: 8px;
        font-weight: normal;
    }

    .container {
        width: 100%;
        box-sizing: border-box;
        padding: 0 8px;
    }

    main {
        flex-direction: column;
        top: 60px;
        bottom: 26px;
    }

    footer {
        font-size: 9px;
    }

    .container-code .caption {
        font-size: 16px;
    }

    #container-loading {
        left: 0;
        top: 50%;
    }
}

@media (min-width: 768px) {
    .container { width: 768px; }
}

@media (min-width: 992px) {
    .container { width: 992px; }
}

@media (min-width: 1200px) {
    .container { width: 1200px; }
}

/******************************************************************************
 * Loading animation
 *****************************************************************************/
@keyframes mf-logo-loading-animation-1 {
    0% {
        opacity: 0;
        transform: rotate3d(0, 1, 0, 90deg);
    }
    20% {
        opacity: 1;
        transform: scale(1) rotate3d(0, 0, 0, 0);
    }
    60% {
        opacity: 1;
        transform: scale(1) rotate3d(0, 0, 0, 0);
    }
    90% {
        opacity: 0;
        transform: rotate3d(0, 0, 0, 0);
    }
    100% {
        opacity: 0;
        transform: rotate3d(0, 0, 0, 0);
    }
}

@keyframes mf-logo-loading-animation-2 {
    0% {
        opacity: 0;
        transform: rotate3d(1, 0, 0, 90deg);
    }
    20% {
        opacity: 1;
        transform: scale(1) rotate3d(0, 0, 0, 0);
    }
    60% {
        opacity: 1;
        transform: scale(1) rotate3d(0, 0, 0, 0);
    }
    90% {
        opacity: 0;
        transform: rotate3d(0, 0, 0, 0);
    }
    100% {
        opacity: 0;
        transform: rotate3d(0, 0, 0, 0);
    }
}

.loading-anim {
    margin: 0 auto;
    width: 100px;
    height: 100px;
}

.loading-anim__mf-logo__container {
    position: relative;
    display: inline-block;
    width: 100px;
    height: 100px;
}

.loading-anim__mf-logo__part {
    position: absolute;
    background: #0079EF;
    animation-duration: 2.2s;
    animation-timing-function: ease;
    animation-iteration-count: infinite;
    will-change: opacity, transform;
}

.loading-anim__mf-logo__part:nth-child(1) {
    width: 81px;
    height: 19px;
    top: 0;
    right: 0;
    transform-origin: 0 50%;
    animation-name: mf-logo-loading-animation-1;
    animation-delay: 0s;
}

.loading-anim__mf-logo__part:nth-child(2) {
    width: 19px;
    height: 62px;
    top: 19px;
    right: 0;
    transform-origin: 100% 0;
    animation-name: mf-logo-loading-animation-2;
    animation-delay: 0.1s;
}

.loading-anim__mf-logo__part:nth-child(3) {
    width: 81px;
    height: 19px;
    bottom: 0;
    left: 0;
    transform-origin: 100% 0;
    animation-name: mf-logo-loading-animation-1;
    animation-delay: 0.2s;
}

.loading-anim__mf-logo__part:nth-child(4) {
    width: 19px;
    height: 62px;
    bottom: 19px;
    left: 0;
    transform-origin: 0 100%;
    animation-name: mf-logo-loading-animation-2;
    animation-delay: 0.3s;
}
