@import "utilities.css";
@import "fonts/lt-cushion-font.css";

* {
    box-sizing: border-box;
}

:root {
  --white: #f2f2f2;
  --black: #111;
  --light-grey: #e3e3e3;
  --dark-light-grey: #d0d0d0;
  --grey: #b3b3b3;
  --dark-grey: #555;
  --brand-color: #dd62ad;
  --second-brand-color: #87f8b4;

  --error-color: #f14f4f;
  --error-background-color: #f9dbd8;
  --success-color: #adf2ab;
  --warning-color: #eec794;
  --warning-background-color: #f5e2cb;

  --max-width: 500px;
  --viewport-height: 100vh;
  --content-box-border-radius: 0.5rem;
}

.alternate-colors {
    --white: #faf4f0;
    --black: #35232b;
    --light-grey: #ebe3e0;
    --dark-light-grey: #d9d2cf;
    --brand-color: #ed7eb9;
    --second-brand-color: #b3de6b;
    --second-brand-dark-color: #317e08;
}

html, body {
    padding: 0;
    margin: 0;
    -webkit-text-size-adjust: 100%;
    overflow: hidden;
}

body {
    background-color: #000;
    color: var(--black);
    font-family: sans-serif;
    width: 100vw;
    min-height: var(--viewport-height);
    font-size: 16px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

a {
    color: var(--brand-color);
}

a.-link-button {
    text-decoration: none;
    display: inline-block;
}

p {
    margin: 0.5rem 1rem;
    user-select: text;
    -webkit-user-select: text;
    line-height: 1.3;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0.5rem 1rem;
    margin-top: 0.8rem;
}

img {
    max-width: 100%;
}

hr {
    margin: 2rem 1rem;
    border: 1px dashed var(--grey);
}

button, select, input, textarea {
    font-size: 1rem;
}

/**
 * Feather Icons
 */

.feather-icon {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.-with-glow {
    filter: drop-shadow(1px 1px 2px var(--brand-color));
}

@keyframes rotating {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.feather-icon.-rotate-animation {
    animation: rotating 2s linear infinite;
}

.feather-icon.-normalize {
    width: 1em;
    height: 1em
}

/**
 * BUTTONS
 *
 * NOTE: This is not strictly rscss, because there is no `button-component` class.
 *
 * - I want to enforce that every UI button is actually a DOM button
 *          -> which is apparently so much better for accessibility!
 * - Writing everywhere button-xxxx seems a bit superflous
 */

.-button-reset {
    background-color: transparent;
    border: none;
    padding: 0.6em 0.8em;
    color: inherit;
}

button > .feather-icon {
    vertical-align: bottom;
}

.-button-primary,
.-button-primary-alt,
.-button-toggle,
.-button-secondary {
    line-height: 1.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid;
    color: inherit;
}

.-button-primary {
    border-color: var(--brand-color);
    background-color: var(--brand-color);
    color: var(--white);
}

.-button-primary-alt {
    border-color: var(--second-brand-color);
    background-color: var(--second-brand-color);
    color: var(--black);
}

.-button-toggle {
    background-color: inherit;
    border: none;
    padding-left: 0;
    line-height: normal;
}

.-button-secondary {
    border-color: var(--grey);
    background-color: var(--white);
}

.-button-primary > .feather-icon,
.-button-primary-alt > .feather-icon,
.-button-toggle > .feather-icon,
.-button-secondary > .feather-icon {
    width: 1rem;
    height: 1rem;
    vertical-align: middle;
    margin-top: -2px;
    margin-left: 0.2rem;
}

.-button-only-icon > .feather-icon {
    margin-left: 0;
}

.-button-toggle > .feather-icon.-toggle {
    width: 1.3rem;
    height: 1.3rem;
    margin-left: 0;
    margin-right: 0.2rem;
    margin-top: -3px;
}

.-button-toggle > .feather-icon.-toggle .-toggle-on {
    color: var(--brand-color);
}

.-button-small {
    line-height: normal;
    padding: 0.3rem 0.5rem;
}

.-button-disabled,
button[disabled] {
    opacity: 0.7;
}

.-button-disabled {
    pointer-events: none;
}

.-button-link {
    text-decoration: underline;
    cursor: pointer;
    display: inline;
    padding: 0;
    background-color: transparent;
    border: none;
    text-align: unset;
    color: inherit;
}

button.-with-badge {
    position: relative;
}

button.-with-badge:after {
    content: '';
    display: block;
    background-color: var(--brand-color);
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    position: absolute;
    top: 0;
    right: 0;
}

.-button-inline-icon {
    padding: 0 0.3rem;
    background-color: transparent;
    border: none;
    vertical-align: middle;
}

/**
 * Forms
 */

.form > .label {
    display: block;
    margin: 0.2rem 1rem;
}

.form > .input {
    width: 100%;
    padding: 1rem;;
    border-radius: 0;
    font-size: inherit;
    border: none;
    margin: 0.2rem 0;
    margin-bottom: 0.2rem;
    background-color: #fff;
}

.form > .input + .label {
    margin-top: 1rem;
}

.form > button {
    margin: 1rem;
}

.form.-oneline {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.form.-oneline > .label {
    width: 100%;
}

.form.-oneline > .input {
    width: auto;
    flex-grow: 1;
}

.form.-oneline > .input > button {
    margin: -0.5rem 0;
}

.form.-oneline-checkbox {
    display: flex;
    flex-wrap: wrap;
}

.form.-oneline-checkbox > .label {
    align-self: center;
    margin: 0;
}

.form.-oneline-checkbox > .input {
    width: auto;
    flex-grow: 0;
    margin: 1rem;
    padding: 0;
}

.form.-oneline-checkbox > .info {
    flex-grow: 1;
    margin-left: 3rem;
    margin-top: -0.5rem;
    margin-right: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

/**
 * Content box
 */

.content-box {
    margin: 0.3rem 1rem 1rem 1rem;
    padding: 0.2rem 0.8rem;
    background-color: var(--light-grey);
    border-radius: var(--content-box-border-radius);
}

.content-box.-has-error {
    background-color: var(--error-background-color);
}

.content-box.-has-warning {
    background-color: var(--warning-background-color);
}

h5,
.content-box > header {
    font-weight: bold;
    font-size: 0.8em;
    text-transform: uppercase;
    margin-top: 0.6rem;
    display: flex;
    justify-content: space-between;
}

.content-box > header .feather-icon {
    position: relative;
    top: 2px;
}

.content-box > p {
    margin: 0.6rem 0;
}

.content-box > .button-row {
    display: flex;
    justify-content: space-between;
    margin: 0.6rem 0;
}

#debug {
    position: absolute;
    z-index: 100;
    color: #fff;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2px;
    pointer-events: none;
    touch-action: none;
}

.scrollable-code-line {
    overflow-x: scroll;
}

.scrollable-code-line > code {
    font-size: 0.8rem;
    white-space: nowrap;
}

details {
    margin: 1rem;
}

details > summary {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

details:not(.content-box) > summary,
details[open] > summary {
    font-weight: bold;
}

@keyframes brand-shadow-pulse {
    0% {
        box-shadow: 0 0 0 0 var(--brand-color);
    }

    70% {
        box-shadow: 0 0 1rem 0 var(--brand-color);
    }

    100% {
        box-shadow: 0 0 0 0 var(--brand-color);
    }
}
