@import 'font-awesome/scss/font-awesome';
@import 'partials/colours';
@import 'partials/form_elements';

$ibg: map-get(map-get($colors, dsst), light);
$dbg: nth(map-get($colors, dark), 1);
$text: $dbg;

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Helvetica, sans-serif;
    font-size: 16px;
    font-weight: normal;
    background-color: map-get(map-get($colors, background), dark);
    color: $text;
}

.iconset {
    display: none;
}

main {
    background-color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    margin: auto;
    padding: 1rem;
    width: 64em;
}

input, textarea, select, button i span {
    font-family: Helvetica, sans-serif;
}

textarea {
    resize: none;
    overflow: hidden;
    min-height: 1em;
    max-height: 3em;
}

input:not([type=text]) {
    max-width: 4rem;
}

input[type=color] {
    display: none;
}

input[type=color] ~ label {
    flex: 1;
    height: 0.3rem;
    width: 99.35%;
    margin: 0.2rem 0.2rem -0.5rem 0.2rem;
}

input[type=color]::-webkit-color-swatch {
    border-width: 0;
    border-radius: 50%;
}

input[type=color]::-moz-color-swatch {
    border-width: 0;
    border-radius: 50%;
}

header, footer, main > section {
    margin: 0.5rem 0;
}

header {
    display: flex;
    flex-direction: column;

    .title-row {
        display: flex;
    }

    .factbox-title {
        flex: 2;
        font-size: 2.25rem;
        font-weight: bold;
    }

    .factbox-description {
        font-size: 1.5rem;
    }

    .factbox-summary {
        font-size: 1rem;
    }

    .logo {
        flex: initial;
    }
}

label {
    border: 1px solid transparent;
    color: $text;
}

.faq-qa, .classes {
    display: flex;
}

.faq-qa, .class-group {
    background-color: #f3f3f3;
    margin: 2px 0;
    padding: 0.5rem;
}

.faq {
    display: flex;
    flex-direction: column;

    .question, .answer {
        flex: 3;
        max-height: 4.6rem;
    }
}

.reference-classes {
    display: flex;
    justify-content: space-between;
}

.reference-class {
      display: flex;
      flex: 1;
      font-weight: bold;
      width: 100%;

      label {
          flex: initial;
      }

      input {
          flex: auto;
          font-weight: bold;
      }
  }

.align-right {
    text-align: right;
}

.add-remove {
    display: flex;
    justify-content: space-between;
    button {
        flex: 1;
    }
}

.checkbox-label {
    flex: 1;
}

.class-risk-toggle, .faq-title-page-toggle {
    display: flex;
}

.class-controls, .faq-controls {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.classes {
    flex-direction: column;

    textarea {
        max-height: 4.6rem;
        flex: 6;
    }

    .class-name {
        display: flex;
    }

    .class-size-context-wrapper {
        display: flex;
    }

    .class-size.class-context {
        display: flex;
        flex: 1;

        input {
            font-weight: bold;
            font-size: 1.3em;
        }
    }

    .class-comment-controls {
        display: flex;
        flex: 1;
    }
}

.references {
    display: flex;
    flex-direction: column;

    .references-text {
        max-height: 4.6rem;
    }
}

.url-last-update {
    display: flex;

    .fact-box-url-wrapper, .fact-box-last-update-wrapper {
        flex: 1;
        display: flex;
        input {
            flex: 1;
        }
    }
}

.class-size-context {
    display: flex;
}

.meta-info {
    display: flex;
    flex-direction: column;
}


footer {

    display: flex;
    flex-direction: column;
    padding-top: 1rem;
    border-top: 1px dashed;

    label {
        font-size: 0.667rem;
    }

    .settings, .importexport {
        display: flex;

        input {
            max-width: none;
        }
    }

    .importexport {
        #upload {
            max-width: none;
        }
        label {
            border: $bs solid $tcol;
        }
    }

    .settings {
        justify-content: flex-end;
        flex-direction: column;
    }

    iframe {
        &#preview {
            width: 100%;
            height: 600px; // firefox
        }
    }
}
