





/****************************************************
 *                    Container                      *
 ****************************************************/

.sound-effect-editor-widget {
    overflow-y: auto;
}

.sound-effect-editor {
    width: 100%;
    box-shadow: 0 0 3px ~"rgb(0 0 0 / 30%)";
    overflow: hidden;
    border-radius: 0.25rem;
    background-color: var(--pxt-neutral-background1);
    color: var(--pxt-neutral-foreground1);
    display: flex;
    flex-direction: column;
    user-select: none;
    -webkit-user-select: none;

    .link-button {
        margin-left: 1.8rem;
    }

    .common-menu-dropdown-pane {
        width: 8rem !important;
    }
}

.sound-effect-editor-content {
    flex-grow: 1;
    position: relative;
    overflow: hidden;

    .common-dropdown-item:focus-visible {
        outline: 3px solid var(--pxt-focus-border);
        outline-offset: -3px;
    }
}

.sound-controls {
    padding: 0.5rem 1.8rem;
}

.sound-effect-header {
    display: flex;
    flex-direction: row;
    position: relative;
    height: 3.5rem;
    position: relative;

    justify-content: center;
    align-items: center;

    background-color: #e30fc0; // Matches block color

    & > .common-button {
        position: absolute;
        right: 0;
        top: 0;
        border: none;
        &:focus-visible {
            outline: 3px solid var(--pxt-neutral-background1);
            outline-offset: -7px;
            &:after {
                outline: none !important;
            }
        }
    }
}

#sound-effect-editor-toggle.focused {
    outline: 3px solid var(--pxt-neutral-background1);
    outline-offset: 2px;
}

.common-button.link-button.generate-similar {
    margin-bottom: 0.5rem;
}


/****************************************************
 *                      Graphs                      *
 ****************************************************/

.sound-graph-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;

    & > span {
        flex-grow: 1;
    }

    .common-dropdown-button:focus-visible,
    .common-dropdown-item:focus-visible {
        outline: 3px solid var(--pxt-focus-border);
        outline-offset: -3px;
    }
}

.frequency-graph {
    padding-top: 0.5rem;
    border-bottom: 1px solid var(--pxt-neutral-stencil2);
}

.dropdown-and-label {
    display: flex;
    flex-direction: row;
    margin-right: 0.5rem;
    align-items: center;
}

.sound-graph-container {
    margin-top: 0.5rem;
    border: 1px solid var(--pxt-neutral-stencil2);
}

.sound-label {
    font-size: 14px;
    font-weight: 400;
    line-height: 2rem;
    margin-right: 0.5rem;
    user-select: none;
}

.sound-label.waveform-name {
    font-weight: 600;
    margin-left: 0.5rem;
}

.waveform-and-duration-controls {
    display: flex;
    flex-direction: row;
    align-items: center;

    .duration-controls {
        display: flex;
        flex-direction: row;
        flex-grow: 1;
        justify-content: right;

        input {
            width: 3.5rem;
        }
    }
}

#waveform-select .common-radio-choice {
    input:focus-visible {
        outline: 3px solid var(--pxt-focus-border) !important;
    }
}

/****************************************************
 *                     Preview                      *
 ****************************************************/

 .sound-preview {
    height: 8rem;
    padding: 0 2.5rem;
    background: var(--pxt-neutral-background2);

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

    svg {
        height: 100%;
    }
}

.common-button.sound-effect-play-button {
    width: 3rem;
    height: 3rem;
    overflow: hidden;
    padding: 0;
    border-radius: 2rem;
    background-color: var(--pxt-neutral-foreground2);
    color: var(--pxt-neutral-background2);
    position: absolute;
    right: 5px;
    margin-top: -1.5rem;

    .fas.fa-play, .fas.fa-stop {
        margin: 0 0 0 0.25rem;
        color: var(--pxt-neutral-background2);
    }

    .fas.fa-stop {
        margin: 0;
    }
}

.rtl .common-button.sound-effect-play-button {
    .fas.fa-play, .fas.fa-stop {
        margin: 0 0.25rem 0 0;
    }
}

.common-button.sound-effect-play-button:focus-visible {
    outline: 3px solid var(--pxt-focus-border) !important;
    outline-offset: 3px;
}

.sound-preview-baseline {
    stroke: var(--pxt-neutral-alpha50);
}

.sound-preview-static-wave {
    stroke: var(--pxt-neutral-alpha50);
}

.sound-preview-animated-wave {
    stroke: var(--pxt-primary-background);
}


/****************************************************
 *                      Gallery                     *
 ****************************************************/

.sound-gallery {
    position: absolute;
    height: 100%;
    top: -100%;
    width: 100%;
    transition: top 0.25s ease;
    background: var(--pxt-colors-purple-background);
    padding: 1rem;
    overflow-y: auto;
}

.sound-gallery.visible {
    top: 0px;
}

.sound-gallery-scroller {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.sound-gallery-scroller > .common-button {
    margin-bottom: 0.5rem;
    padding: 0.3rem 1rem 0.3rem 0.5rem;

    &:focus-visible {
        outline: 5px solid var(--pxt-focus-border);
        outline-offset: -7px;
    }
}


.sound-gallery-item-label {
    display: flex;
    flex-direction: row;
    align-items: center;

    .common-button.sound-effect-play-button {
        position: relative;
        margin-top: 0;
        z-index: 2;
    }
}

.sound-gallery-item-label-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-grow: 1;
    margin-right: 0.5rem;
    padding: 0.3rem 0 0.3rem 0.5rem;

    .sound-effect-name {
        font-size: 22px;
        width: 8rem;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: left;
        height: 2rem;
        align-items: center;
        display: flex;
    }

    svg {
        width: 10rem;
    }

    .sound-gallery-preview {
        flex-grow: 1;
    }
}


.sound-gallery-preview-wave {
    stroke: var(--pxt-primary-background);
}

.hc {
    .sound-gallery-item-label-inner:focus {
        outline: 3px solid @highContrastHighlightColor !important;
    }

    .common-button.sound-effect-play-button {
        .fas.fa-play, .fas.fa-stop {
            margin: 0 0 0 0.25rem;
            color: @highContrastTextColor;
        }
        &:focus,:focus-visible {
            outline: 3px solid var(--pxt-focus-border) !important;
            &:after {
                border: none;
                outline: none;
            }
        }
    }
    #waveform-select .common-radio-choice.selected i {
        color: @highContrastHighlightColor;
    }
}
