
/* ----------------------------------------- */

* {
    box-sizing: border-box;
    margin: 0rem;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    user-select: none;
    color: var(--text-default);

    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

a {
    color: var(--text-muted);
    text-decoration: none;
}

a:hover {
    color: var(--text-default);
}

a:empty {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0%;
    left: 0%;
    z-index: 10;
}

hr {
    border: calc(var(--thickness) / 2) solid var(--general-default);
    border-radius: var(--roundness);
}

samp {
    background-color: var(--general-dark);
    border-radius: var(--roundness);
    padding: 0.5rem 1rem 0.5rem 1rem;
    font-family: monospace;
    width: fit-content;
    height: fit-content;
}

em {
    transition: 0.25s;
    padding: 0.5rem;
    color: var(--general-highlight);
    font-style: normal;
}

em:hover {
    transition: 0.25s;
    color: var(--text-default);
}

/* ----------------------------------------- */

input {
    font-size: 1rem;
}

input[type="text"] {
    background-color: var(--general-dark);
    border-radius: var(--roundness);
    border: none;
    padding: 0.5rem 0.751rem 0.5rem 0.75rem;
    width: 6rem;
    font-family: monospace;
}

input[type="text"]:invalid {
    background-color: var(--error-dark);
    color: var(--error-default);
}

input[type="range"] {
    -webkit-appearance: none;
    background: var(--general-dark);
    height: 0.5rem;
    border-radius: var(--roundness);
}

input[type="range"]::-webkit-slider-thumb {
    transition: 0.25s;
    -webkit-appearance: none;
    cursor: pointer;
    background: var(--general-default);
    border-radius: var(--roundness);
    aspect-ratio: 1;
    height: 2rem;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transition: 0.25s;
    background-color: var(--general-highlight);
}

/* ----------------------------------------- */

button {
    position: relative;
    
    transition: 0.25s;
    background-color: var(--general-default);
    border-radius: var(--roundness);
    border: none;
    font-size: 1rem;
    
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;

    width: fit-content;
    gap: 0.25rem;
    padding: 0.5rem 1rem 0.5rem 1rem;
}

button:hover {
    transition: 0.25s;
    background-color: var(--general-highlight);
}

button.active {
    transition: 0.25s;
    background-color: var(--accent-default);
    /* box-shadow: 0.25rem 0.25rem 0rem var(--accent-dark); */
    box-shadow: 0.15rem 0.15rem 0rem var(--accent-dark);
}

button.round {
    border-radius: 50%;
    padding: 0rem;
    width: 2rem;
    aspect-ratio: 1;
}

button.square {
    border-radius: var(--roundness);
    padding: 0rem;
    width: 2rem;
    aspect-ratio: 1;
}

button, button * {
    user-select: none;
    cursor: pointer;
}

/* ----------------------------------------- */

.error {
    width: 100%;
    padding: 1rem;
    color: var(--error-default);
    background-color: var(--error-dark);
    border-radius: var(--roundness);
}

.error:empty {
    display: none;
}

.warning {
    width: 100%;
    padding: 1rem;
    color: var(--warning-default);
    background-color: var(--warning-dark);
    border-radius: var(--roundness);
}

.warning:empty {
    display: none;
}

/* ----------------------------------------- */

.boolean {
    transition: 0.25s;
    border-radius: var(--roundness);
    background-color: var(--general-dark);
    width: 4rem;
    height: 2rem;

    display: flex;
    flex-direction: row;
    align-items: center;
}

.boolean[value="true"] {
    transition: 0.25s;
    padding-left: 2rem;
}

.boolean>* {
    transition: 0.25s;
    height: 100%;
    aspect-ratio: 1;
    border-radius: var(--roundness);
    background-color: var(--general-default);
}

.boolean:hover>* {
    background-color: var(--general-highlight);
}

.boolean:hover {
    cursor: pointer;
}

/* ----------------------------------------- */

.toggle, .slider, .incrementer, .drag, .color, .vector, .switch{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
}

.switch {
    flex-wrap: wrap;
}

.drag .button, .drag .button * {
    cursor: ew-resize;
}

/* ----------------------------------------- */

.code {
    position: relative;
    width: 100%;
    height: 100%;
}

.code::after {
    content: attr(language);
    font-family: monospace;
    background-color: var(--general-default);
    border-radius: var(--roundness);
    padding: 0.25rem 0.5rem 0.25rem 0.5rem;
    filter: opacity(50%);

    position: absolute;
    top: 1rem;
    right: 1rem;
}

textarea {
    resize: none;
    width: 6rem;

    background-color: var(--general-dark);
    border-radius: var(--roundness);
    border: none;
    font-family: monospace;
    
    padding: 0.5rem;
}

/* ----------------------------------------- */

.popup {
    position: absolute;
    top: 0%;
    left: 0%;
    width: 100vw;
    height: 100vh;

    background-color: var(--transluscent);
    border-radius: 0rem;
    box-shadow: none;
    backdrop-filter: blur(4px);

    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing);
}

.popup.hidden {
    display: none;
}

.popup>div {
    border-radius: var(--roundness);
    background: linear-gradient(0deg, var(--error-dark) 0%, var(--background-light) 100%);
    box-shadow: 0.25rem 0.25rem 0rem var(--shadow);

    display: flex;
    flex-direction: column;
    padding: 2rem;
    gap: 1rem;
}

.popup header {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;

    font-size: 1.5rem;
    font-weight: bold;
}

.popup header i {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;

    background-color: var(--error-default);
    box-shadow: 0.25rem 0.25rem 0rem var(--error-dark);

    display: flex;
    justify-content: center;
    align-items: center;
}

.popup header p {
    color: var(--error-default);
    text-shadow: 0.25rem 0.25rem 0rem var(--error-dark);
}

/* ----------------------------------------- */

*[tooltip] {
    position: relative;
}

*[tooltip]:hover::after {
    content: attr(tooltip);

    position: absolute;
    left: 0rem;
    bottom: calc(100% + 0.5rem);
    z-index: 100;

    padding: 0.5rem 1rem 0.5rem 1rem;
    border-radius: var(--roundness);
    background-color: var(--background-light);
    box-shadow: 0.25rem 0.25rem 0rem var(--shadow);
    border: 1px solid var(--accent-default);

    opacity: 0%;
    animation-name: appear-delayed;
    animation-duration: 1.5s;
    animation-fill-mode: forwards;
}

figure>*[tooltip]:hover::after {
    width: max-content;
    max-width: 25rem;
}


@media screen and (max-width: 768px) {
    *[tooltip]:hover::after {
        display: none;
    }
}

/* ----------------------------------------- */