@import url("/vendor/fontawesome/font-awesome.css");
@import url("/css/base.css");

#output,
#content {
    white-space: pre-wrap; /* wrap long lines */
    word-break: break-word;
    line-height: 2;
    padding: 0.5rem;

    font-size: 1.2rem;
    margin-top: 1rem;
}

#output {
    text-align: center;
}

#loading {
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

main {
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Default (light) theme */
:root {
    --btn-bg: #0078d4;
    --btn-bg-hover: #005a9e;
    --btn-text: #fff;
    --btn-focus: #80bfff;
}

/* Dark theme */
[data-theme="dark"] {
    --btn-bg: #444;
    --btn-bg-hover: #666;
    --btn-text: #fff;
    --btn-focus: #aaa;
}

/* Sepia theme */
[data-theme="sepia"] {
    --btn-bg: #a67c52;
    --btn-bg-hover: #8b5e34;
    --btn-text: #fff8f0;
    --btn-focus: #d4b48c;
}

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin: 1rem auto;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;

    background-color: var(--btn-bg);
    color: var(--btn-text);
    font-weight: 600;
}

.copy-btn {
    width: 2em;
    height: 2em;
    border-radius: 4px;
}

button:hover {
    background-color: var(--btn-bg-hover);
}

button:focus {
    outline: 2px solid var(--btn-focus);
    outline-offset: 2px;
}

/* Hide when loaded */
body.loaded > main > #loading {
    display: none;
}

body:not(.loaded) > main > #loading::before {
    content: "Loading...";
}

body:not(.loaded):has(> main > #loading) .copy-btn {
    display: none;
}

#input {
    height: 10rem;
}

textarea {
    margin-top: .5rem;
}

#powered-by {
    font-size: 0.85em;
    margin-top: 1em;
    font-style: italic;
    position: absolute;
    bottom: 1rem;
    right: 1rem;
}

#powered-by::before {
    content: "powered by ";
    filter: brightness(0.6);
}

#powered-by a {
    font-weight: bold;
    text-decoration: inherit;
}

canvas {
    border: 1px solid grey;
}

#back {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
}