/**
 * Styles for control elements in examples, not required for the examples' functionality
 */
:root {
    --main-fg: #101828;
    --main-bg: #fff;

    --chart-bg: #fff;
    --chart-border: #d0d5dd;

    --button-fg: #212529;
    --button-bg: transparent;
    --button-border: #d0d5dd;
    --button-hover-bg: rgba(0, 0, 0, 0.1);

    --input-accent: #0e4491;
    --input-focus-border: #3d7acd;
    --range-track-bg: #efefef;

    --row-gap: 6px;

    --select-chevron: url('data:image/svg+xml;utf8,<svg fill="none" stroke="%23667085" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M6 9L12 15L18 9"/></svg>');
    --checkbox-tick-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17L4 12'/%3E%3C/svg%3E");
}

:root[data-dark-mode='true'] {
    --main-fg: #fff;
    --main-bg: #141d2c;

    --chart-bg: #192232;
    --chart-border: #344054;

    --button-fg: #f8f9fa;
    --button-bg: transparent;
    --button-border: rgba(255, 255, 255, 0.2);
    --button-hover-bg: #2a343e;

    --input-accent: #a9c5ec;
    --input-focus-border: #3d7acd;
    --range-track-bg: #4a5465;

    --select-chevron: url('data:image/svg+xml;utf8,<svg fill="none" stroke="%239CA3AF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M6 9L12 15L18 9"/></svg>');
    --checkbox-tick-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232a343e' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17L4 12'/%3E%3C/svg%3E");
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

:root,
body {
    height: 100%;
    width: 100%;
    margin: 0;
    overflow: hidden;
}

/* Hide codesandbox highlighter */
body > #highlighter {
    display: none;
}

.example-controls {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
}

.example-controls *,
.example-controls *::before,
.example-controls *::after {
    margin: 0;
    font-family: -apple-system, 'system-ui', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 17px;
    letter-spacing: 0.01em;
    color: var(--main-fg);
}

.example-controls :where(button, textarea, select, input[type='submit'], input[type='text'], input[type='number']) {
    appearance: none;
    display: inline-block;
    height: 36px;
    padding: 5px 14px 7px;
    white-space: nowrap;
    border-radius: 6px;
    color: var(--button-fg);
    background-color: var(--button-bg);
    border: 1px solid var(--button-border);
    box-shadow: 0 0 0 0 transparent;
    transition:
        background-color 0.25s ease-in-out,
        border-color 0.25s ease-in-out,
        box-shadow 0.25s ease-in-out;
    align-self: flex-start;
}

.example-controls :where(button, select, input[type='submit']) {
    cursor: pointer;
}

.example-controls select {
    appearance: none;
    padding-right: 32px;
    padding-left: 14px;
    background: no-repeat center right 4px var(--select-chevron);
}

.example-controls textarea {
    height: auto;
    padding: 7px 14px;
}

.example-controls pre,
.example-controls code {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

.example-controls input {
    appearance: none;
}

.example-controls input[type='checkbox'],
.example-controls input[type='radio'] {
    border: 1px solid var(--button-border);
    cursor: pointer;
}

.example-controls input[type='radio'] {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.example-controls input[type='radio']:checked {
    border-width: 0;
    box-shadow: inset 0 0 0 6px var(--input-accent);
}

.example-controls input[type='radio']:checked:focus-visible {
    box-shadow:
        inset 0 0 0 2px var(--input-focus-border),
        inset 0 0 0 3px var(--main-bg),
        inset 0 0 0 6px var(--input-accent);
}

.example-controls input[type='checkbox'] {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    cursor: pointer;
}

.example-controls input[type='checkbox']:checked {
    background: var(--input-accent) no-repeat center/14px var(--checkbox-tick-icon);
    border-color: var(--input-accent);
}

.example-controls input[type='range'] {
    appearance: none;
    min-width: 160px;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden; /*  slider progress trick  */
    background: var(--range-track-bg);
}

.example-controls input[type='range']::-webkit-slider-runnable-track {
    appearance: none;
    height: 16px;
    background: var(--range-track-bg);
}

.example-controls input[type='range']::-moz-range-track {
    appearance: none;
    height: 16px;
    background: var(--range-track-bg);
}

.example-controls input[type='range']::-webkit-slider-thumb {
    appearance: none;
    height: 16px;
    width: 16px;
    background-color: var(--main-bg);
    border-radius: 50%;
    border: 2px solid var(--input-accent);
    box-shadow: -1007px 0 0 1000px var(--input-accent); /*  slider progress trick  */
}

.example-controls input[type='range']::-moz-range-thumb {
    appearance: none;
    height: 16px;
    width: 16px;
    background-color: var(--main-bg);
    border-radius: 50%;
    border: 2px solid var(--input-accent);
    box-shadow: -1007px 0 0 1000px var(--input-accent); /*  slider progress trick  */
}

.example-controls :is(button, input[type='submit'], select):hover {
    background-color: var(--button-hover-bg);
}

.example-controls :is(button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible) {
    border-color: var(--input-focus-border);
    box-shadow:
        inset 0 0 0 1px var(--input-focus-border),
        inset 0 0 0 2px var(--main-bg);
    outline: none;
}

.controls-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--row-gap);
    font-variant: tabular-nums;
}

.controls-row + .controls-row {
    margin-top: var(--row-gap);
}

.controls-row.center {
    justify-content: center;
}

.controls-row .push-right {
    margin-left: auto;
}

.controls-row .push-left {
    margin-right: auto;
}

.controls-row .gap-right {
    margin-right: calc(var(--row-gap) * 6);
}

.controls-row .gap-left {
    margin-left: calc(var(--row-gap) * 6);
}
