/*
    Landon Hansen
    4/22/2024
    Learning to use the WaveSurfer API
*/

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    
    --blank-color: #656666;
    --fill-color: #EE772F;
    --background-color: #333;
    overflow-x: hidden;
    
    color: white;
    background-color: var(--background-color);
}

main {
    max-width: 920px;
    margin: auto;   
}

#drop {
    display: flex;
    height: 128px;

    border: 4px dashed #999;
    margin: 2em 0;
    
    text-align: center;
    flex-direction: column;
    justify-content: center;
}

#drop.over {
    border-color: #333;
}

.song {

}

.progressbar {
    height: 25px;

    border-radius: 7px;
    margin: 5px;

    z-index: 100;
    
    opacity: 0.8;
    background-color: var(--blank-color);

    overflow: hidden;
}

.progressbar::before {
    position: absolute;
    content: attr(progress-value);
    
    width: 100%;

    text-align: center;
    font-weight: bold;
}

.progressbar::after {
    display: block;
    content: attr(file);
   
    background-color: var(--fill-color);
    
    box-sizing: border-box;
    width: var(--progress-value);
    height: 100%;

    padding-left: 5px;

    font-weight: bold;

    transition: width 100ms linear;
}

.progressbar.disappearing {
    animation: hide 2s forwards;
    animation-delay: 2s;
}

.toggle-playing {
    position: absolute;
    display: block;
    
    width: 50px;
    height: 50px;
    border-radius: 100%;

    transform: rotate(90deg);

    z-index: 20;

    background-color: var(--fill-color);
    cursor: pointer;
}

.toggle-playing.playing::after {
    display: block;
    position: absolute;

    content: "";

    top: 65%;
    left: 50%;

    transform: translate(-50%, -50%);

    width: 25px;
    height: 7px;

    background-color: white;
}

.toggle-playing.playing::before {
    display: block;
    position: absolute;

    content: "";

    top: 35%;
    left: 50%;

    transform: translate(-50%, -50%);

    width: 25px;
    height: 7px;
    
    background-color: white;
}

.toggle-playing:not(.playing)::after {
    display: block;
    position: absolute;

    content: "";

    top: 45%;
    left: 50%;

    transform: translate(-50%, -50%);

    width: 30px;
    height: 20px;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    background-color: white;
}

.waveform {
    position: relative;
}

.waveform::before {
    position: absolute;
    content: attr(file);
    
    top: 0;
    left: 55px;

    z-index: 15;
    
    line-height: 50px;
    font-weight: bold;
}

.waveform[has-transcript]::after {
    position: absolute;
    content: attr(current-line);
    
    width: 100%;

    padding: 10px;

    box-sizing: border-box;

    left: 0;
    bottom: 0;

    z-index: 10;

    background-color: rgb(0,0,0,0.5);
}

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    
    width: 100vw;
    padding: 10px;

    box-sizing: border-box;

    /* background-color: blue; */
}

@keyframes hide {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0;
        height: 25px;
    }
    100% {
        opacity: 0;
        height: 0;
    }
}