:root {
    --font-size-xsmall: 12px;
    --font-size-small: 14px;
    --font-size-medium: 16px;
    --font-size-large: 20px;
    --font-size-xlarge: 28px;
    --font-size-xxlarge: 36px;

    --border-radius: 5px;
    --large-border-radius: calc(var(--border-radius) * 2);

    --gap: 5px;
    --layout-gap: 15px;

    --orange-base: #ff7300;
    --green-base: #26891d;
    --red-base: #d72516;
    --blue-base: #00aee7;

    --primary: #276E41;
    --base: #000000;
    --contrast: #ffffff;

    --orange: color-mix(in oklab, var(--orange-base), var(--primary) 10%);
    --green: color-mix(in oklab, var(--green-base), var(--primary) 10%);
    --red: color-mix(in oklab, var(--red-base), var(--primary) 10%);
    --blue: color-mix(in oklab, var(--blue-base), var(--primary) 10%);

    --c1: color-mix(in oklab, var(--base), var(--contrast) 15%);
    --c2: color-mix(in oklab, var(--base), var(--contrast) 20%);
    --c3: color-mix(in oklab, var(--base), var(--contrast) 30%);
    --c4: color-mix(in oklab, var(--base), var(--contrast) 40%);
    --c5: color-mix(in oklab, var(--base), var(--contrast) 50%);
    --c6: color-mix(in oklab, var(--base), var(--contrast) 60%);
    --c7: color-mix(in oklab, var(--base), var(--contrast) 70%);
    --c8: color-mix(in oklab, var(--base), var(--contrast) 80%);
    --c9: color-mix(in oklab, var(--base), var(--contrast) 85%);

    --bg-1: color-mix(in oklab, var(--c1), var(--primary) 10%);
    --bg-2: color-mix(in oklab, var(--c2), var(--primary) 10%);
    --bg-3: color-mix(in oklab, var(--c3), var(--primary) 5%);
    --bg-4: color-mix(in oklab, var(--c4), var(--primary) 5%);

    --neutral: color-mix(in oklab, var(--c5), var(--primary) 5%);

    --fg-1: color-mix(in oklab, var(--c9), var(--primary) 20%);
    --fg-2: color-mix(in oklab, var(--c8), var(--primary) 10%);
    --fg-3: color-mix(in oklab, var(--c7), var(--primary) 5%);
    --fg-4: color-mix(in oklab, var(--c6), var(--primary) 5%);

    --orange-dark: color-mix(in oklab, var(--orange), var(--c1) 50%);
    --green-dark: color-mix(in oklab, var(--green), var(--c1) 50%);
    --red-dark: color-mix(in oklab, var(--red), var(--c1) 50%);
    --blue-dark: color-mix(in oklab, var(--blue), var(--c1) 50%);

    --border-color: var(--neutral);

    --font-family: sans-serif;

    /* Jess components */
    --jessc-interactive-background: var(--bg-1);
    --jessc-interactive-color: var(--fg-1);
    --jessc-interactive-background-active: var(--bg-3);
    --jessc-interactive-border-active: var(--fg-2);
    --jessc-border-radius-small: var(--border-radius);
    --jessc-text-color: var(--fg-1);
    --jessc-interactive-color-active: var(--fg-1);
}

html, body {
    background: var(--bg-1);
    height: 100dvh;
    width: 100dvw;
    color: var(--fg-1);
    font-family: var(--font-family);
    overflow: hidden;
}

.spinner {
    border: 1px solid var(--fg-1);
    border-radius: 50%;
    border-top: 1px solid transparent;
    width: var(--font-size-large);
    height: var(--font-size-large);
    animation: spin 1.2s linear infinite;
}

.nopointer, .nopointer * {
    pointer-events: none;
}

.card {
    padding: var(--layout-gap);
    background: var(--bg-1);
    border-radius: var(--border-radius);

    &.secondary {
        border: 1px dashed var(--bg-4);
    }
}

.adaptive-icon {
    color: inherit !important;
}

.relative {
    position: relative;
}

.flex, .flex-v {
    display: flex;
    gap: var(--gap);
    flex-wrap: wrap;
}

.flex-v {
    flex-direction: column;
}

.small-gap {
    gap: var(--gap) !important;
}

.no-gap {
    gap: 0 !important;
}

.no-wrap {
    flex-wrap: nowrap;
}

.flex-grow {
    flex-grow: 1;
}

.box {
    padding: var(--layout-gap);
}

.box + .box {
    padding-left: 0;
}

.box-content {
    padding: var(--layout-gap);
    background: var(--bg-2);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    overflow: auto;
}

.full-height {
    height: 100%;
}

.full-width {
    width: 100%;
}

.navigation-button {
    width: 100%;
}

button span {
    text-wrap: nowrap;
}

.mobile-navigation-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100dvw;
    height: 100dvh;
    background: var(--bg-1);
    border-bottom: 1px solid var(--border-color);
    z-index: 9999;
}

.mobile-navigation {
    display: none !important;
}

.nav-icon {
    width: var(--font-size-large);
    height: var(--font-size-large);
}

.nav-title {
    font-size: var(--font-size-large) !important;
    line-height: 1;
}

.search {
    font-size: var(--font-size-large);
    width: 100%;
}

.checkbox-container {
    position: relative;
    padding-left: 25px;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkbox-container input:focus-visible ~ .checkmark {
    border: 2px solid var(--border-color);
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    height: var(--font-size-medium);
    width: var(--font-size-medium);
    background-color: var(--bg-2);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transform: translateY(-50%);
}

.checkmark:hover {
    background: var(--bg-3);
}

.checkmark-icon {
    top: -4px;
    position: absolute;
    left: 2px;
    font-size: var(--font-size-medium);
    display: none;
}

.checkbox-container input:checked ~ .checkmark .checkmark-icon {
    display: initial;
}

.align-children {
    align-items: center;
}

.align-center {
    align-self: center;
}

.align-end {
    align-self: end;
}

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

.inlineLink {
    text-decoration: underline;
    cursor: pointer;
    color: var(--fg-1);
    width: max-content;
    border-radius: var(--border-radius);
    padding: 0 var(--gap);
}

.inlineLink:hover {
    background: var(--bg-3);
}

button > * {
    align-self: center;
}

button {
    font-family: inherit;
    cursor: pointer;
    width: max-content;
    display: flex;
    align-items: center;
    gap: var(--gap);
}

button.negative:hover {
    background: var(--red-dark);
    border: 1px solid var(--red);
}

button.positive {
    background: var(--green-dark);
    border: 1px solid var(--green);
}

.warning {
    color: var(--orange);
}

.text-positive {
    color: var(--green);
}

.file-name {
    color: var(--fg-1);
}

.error {
    color: var(--red);
}

.success {
    color: var(--green);
}

.notifications {
    position: absolute;
    right: 15px;
    transform: translateY(-50%);
    top: 50%;
    width: max-content;
    z-index: 99999;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: end;
}

.notification {
    background: var(--orange);
    border: 1px solid var(--orange-dark);
    border-radius: var(--border-radius);
    color: var(--fg-1);
    padding: 10px 20px;
    max-width: 100dvw;
    font-size: 1.2em;
    transition: transform .2s ease-in-out;
    cursor: pointer;
    transform: translateX(0%);
}

.notification.out-of-frame {
    transform: translateX(150%);
}

.notification.warning {
    background: var(--orange);
    border-color: var(--orange-dark);
}

.notification.error {
    background: var(--red-dark);
    border-color: var(--red);
    color: var(--fg-1);
}

.notification.success {
    background: var(--green-dark);
    border-color: var(--green);
    color: var(--fg-1);
}

.dragging {
    cursor: grab;
    border-style: dashed;
    background: var(--bg-3);
}

.space-between {
    justify-content: space-between;
}

.ellipses {
    text-overflow: ellipsis;
    overflow: hidden;
}

.no-text-wrap {
    white-space: nowrap;
}

.sound-title, .pack-title {
    cursor: pointer;
    font-size: var(--font-size-large);
    text-wrap: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 300px;
}

.search-clear {
    position: absolute;
    right: var(--gap);
    top: 50%;
    transform: translateY(-50%);
}

.sound-in-list, .pack-in-list {
    border-radius: var(--border-radius);
    padding: var(--layout-gap);
    border: 1px solid var(--bg-3);
    transition: all .2s ease-in-out;
}

.bold {
    font-weight: bold;
}

.modal {
    position: absolute;
    border: 1px solid var(--border-color);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    border-radius: calc(var(--border-radius) * 2);
    max-height: calc(100% - 100px);
    overflow: auto;
    min-width: 300px;
    max-width: 80dvw;
    width: max-content;
    padding: var(--layout-gap);
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    backdrop-filter: blur(5px);
}

.waveform {
    width: 100%;
    height: 3em;
    display: flex;
    gap: 1px;
    align-items: stretch;
    --step: 1;
    background: var(--bg-1);
    border-radius: var(--border-radius);
    position: relative;
    border: 1px solid var(--border-color);
}

.waveform-bar {
    background: var(--fg-1);
    flex: 1 1 0;
    align-self: end;
    pointer-events: none;
}

.waveform-bar.active {
    background: var(--blue-dark);
}

.waveform[data-step="2"] .waveform-bar:nth-child(2n),
.waveform[data-step="3"] .waveform-bar:nth-child(3n),
.waveform[data-step="4"] .waveform-bar:nth-child(4n),
.waveform[data-step="5"] .waveform-bar:nth-child(5n),
.waveform[data-step="6"] .waveform-bar:nth-child(6n),
.waveform[data-step="7"] .waveform-bar:nth-child(7n),
.waveform[data-step="8"] .waveform-bar:nth-child(8n) {
    display: none;
}

.player {
    width: 100%;
    max-width: 600px;
}

input[type=range]:focus {
    outline: none;
}

input[type=range] {
    border-radius: var(--border-radius);
    background-color: var(--bg-1);
}

input[type=range][orient=vertical]::-moz-range-thumb {
    background: var(--blue-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    width: 100%;
    height: 1em;
    cursor: pointer;
}

.volume-slider {
    max-height: 3em;
    -webkit-appearance: slider-vertical;
    accent-color: var(--blue-dark);
}

.play-button, .loop-button {
    height: 3em !important;
    width: 3em !important;
    justify-content: center;
    transition: all .2s ease-in-out;
}

audio {
    display: none;
}

.play-button.playing, .loop-button.active {
    background: var(--green-dark) !important;
}

.waveform-fill {
    position: absolute;
    top: 0;
    left: 0;
    background: color-mix(in oklab, var(--green-dark), transparent 80%);
    height: 100%;
    pointer-events: none;
    border-right: 3px solid var(--fg-1);
}

.player-wrapper {
    height: auto;
    transition: all .2s ease-in-out;
}

.player-wrapper.playing {
    height: 4.5em;
}

.player-time, .license {
    padding: 0 5px;
    background: var(--bg-1);
    border-radius: var(--border-radius);
    font-variant-numeric: tabular-nums;
}

.player-time {
    position: absolute;
    top: calc(100% + var(--gap));
    left: 0;
    max-width: max-content;
    transform: translateX(-50%);
    min-width: max-content;
    transition: opacity .2s ease-in-out;
}

.player-wrapper.paused .player-time {
    opacity: 0;
}

.user-icon {
    width: 2em;
    height: 2em;
    border-radius: 50%;
}

@media only screen and (max-width: 600px) {
    .mobile-navigation {
        display: flex !important;
    }

    .desktop-navigation {
        display: none !important;
    }

    .mobile-content {
        padding-left: var(--layout-gap) !important;
    }

    .volume-slider {
        display: none;
    }

    .sound-header, .pack-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
