@import url('https://fonts.googleapis.com/css?family=Quicksand&display=swap');

*{
    box-sizing: border-box;
}

body{
    --max-preview-width: 80vh;

    --shortAnimationTime: 0.075s;

    --timeSegmentColor: rgba(0,0,0,0.1);

    margin: 0;
    font-family: 'Quicksand', sans-serif;
}

button{
    font-family: 'Quicksand', sans-serif;
    font-weight: 100;
    font-size: 1.1em;
    cursor: pointer;
    background: white;
    border: solid 1px #aaa;
    box-shadow: 0 2px 5px -3px rgba(0,0,0,0.3);
    padding: 3px 10px;
}
button:hover{
    box-shadow: 0 3px 6px -3px rgba(0,0,0,0.3);
}

.fileInput{
    position: relative;
    text-align: center;
    cursor: pointer;
    display: inline-block;
    border: solid 1px #aaa;
    box-shadow: 0 2px 5px -3px rgba(0,0,0,0.3);
    padding: 3px;
    font-size: 1.1em;
}
.fileInput:hover{
    box-shadow: 0 3px 6px -3px rgba(0,0,0,0.3);
}
.fileInput input{
    position: absolute;
    left: 0;
    top: 0;
    cursor: pointer;
    min-width: 0;
    width: 100%;
    opacity: 0;
}

.editor{
    position: absolute;
    top:0;
    left:0;
    bottom: 0;
    right: 0;
    display: flex;
    flex-flow: column;
    justify-content: stretch;
}

section.main{
    display: flex;
    flex-flow: row wrap;
    justify-content: stretch;
}

.preview{
    flex: 1 1 var(--max-preview-width);
    display: inline-block;
    position: relative;
    border-bottom: solid 1px rgba(0,0,0,0.3);
    vertical-align: top;
}

.preview > canvas{
    display: block;
    width: 100%;
    max-width: var(--max-preview-width);
    height: 56.25vw;
    max-height: calc(var(--max-preview-width) * 0.5625);
    background: black;
    margin: auto;
}

.preview button{
    height: 36px;
    width: 36px;
    vertical-align: middle;
    padding: 6px;
}

.preview .currentTime{
    padding: 5px;
}

.mediaList.show{
    max-height: none;
}
.mediaList{
    max-height: 40px;
    display: inline-block;
    vertical-align: top;
    flex: 1 1 200px;
    overflow: hidden;
    border-bottom: solid 1px rgba(0,0,0,0.3);
    position: relative;
}
.mediaList .list{
    display: inline-flex;
    flex-flow: row wrap;
    vertical-align: top;
    padding: 3px;
    height: 130px;
    min-height: calc(100% - 40px);
    overflow: auto;
}

.mediaList button, .mediaList .fileInput{
    margin:5px;
}

.mediaList .fileInput{
    width: 150px;
    flex: 0 0 100%;
}

.mediaList .removeClipMessage{
    position: absolute;
    pointer-events: none;
    opacity: 0;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transition: opacity 0.5s ease-out;
    transition-delay: 0s;
    padding: 50px;
    font-size: 2em;
    text-align: center;
    background-color: rgba(255,255,255,0.9);
    box-shadow: inset 0 0 50px #620;
    z-index: 1;
    display: flex;
    flex-flow: column;
    justify-content: space-around;
}

.mediaList .removeClipMessage.show{
    pointer-events: all;
    opacity: 0.5;
    transition-delay: 1s;
}

.mediaList .removeClipMessage.show:hover{
    opacity: 1;
    transition-delay: 0s;
}

.mediaList .removeClipMessage.show.isDisposingClip{
    opacity: 1;
    transition-delay: 0s;
    transition-duration: 0.1s;
}

.addHint{
    margin: 20px;
    opacity: 0.5;
}

.media{
    display: inline-block;
    padding: 2px;
    width: 192px;
    height: 108px;
    box-shadow: 0 3px 6px -3px rgba(0,0,0,0.3);
    transition: box-shadow var(--shortAnimationTime) ease-out;
}

.media.ghost{
    opacity: 1 !important;
    box-shadow: 0 10px 10px -6px rgba(0,0,0,0.5) !important;
}

.thumbnail{
    display: inline-block;
    height: 100%;
    width: auto;
}

.timeline{
    flex: auto;
    overflow-y: auto;
    margin-top: 10px;
    text-align: center;
}

.timeline .addTrack{
    margin: 30px;
}

.tracks{
    padding-top: 20px;
    position: relative;
    overflow: visible;
    margin-left: 100px;
}

.tickInfo{
    position: absolute;
    left: 5px;
    top: 0;
    font-size: 0.7em;
}

.track{
    height: 100px;
    background-color: rgba(0,0,0,0.02);
    background-image: linear-gradient(0, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0) 100%);
    position: relative;
    display: block;
    overflow: visible;
    margin-right: -100vw;
    padding-right: 100vw;
    border-top: solid 1px rgba(0,0,0,0.1);
}

.trackInfo{
    z-index: 1;
    position: absolute;
    top: -1px;
    right: 100%;
    width: 100px;
    height: 100%;
    background: linear-gradient(0, rgba(255,255,255,0.65) 0%, rgba(255,255,255, 1) 50%);
    padding: 5px;
    border-top: solid 1px rgba(0,0,0,0.1);
}

.trackInfo h1{
    margin: 0;
    font-size: 1.1em;
}

.prospectiveClips .clip.removing{
    opacity: 1;
}

.clip{
    text-align: left;
    display: inline-flex;
    position: relative;
    box-shadow: 0 5px 5px -3px rgba(0,0,0,0.3);
    position: absolute;
    top: 0;
    bottom: 0;
    margin: auto;
    height: calc(100% - 5px);
    background: rgba(0,0,0,0.7);
    border-radius: 5px;
    overflow: hidden;
}
.clip.removing{
    opacity: 0;
}

.clip video{
    max-width: 100%;
}
.currentTimeMarker,
.clipResize,
.fadeHandle
{
    --markerWidth: 4px;
    position: absolute;
    top:0;
    bottom: 0;
    width: var(--markerWidth);
    overflow: visible;
    margin-left: calc(0px - var(--markerWidth) / 2);
    margin-right: calc(0px - var(--markerWidth) / 2);
    cursor: ew-resize;
}
.currentTimeMarker{
    --timeMarkerWidth: 5px;
    margin-left: calc(1px - var(--timeMarkerWidth) / 2);
}
.currentTimeMarker:before,
.clipResize:before,
.fadeHandle:before
{
    content: '';
    position: absolute;
    top:0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
    width: 1px;
    background: rgba(255,0,0,0.7)
}

.currentTimeHandle{
    position: absolute;
    padding: 2px;
    background: rgba(255,0,0,0.7);
    color: white;
    width: fit-content;
}

.fadeHandle:before{
    background: white;
    opacity: 1;
    width: 4px;
}

.clipResize{
    top: 20px;
    bottom: 20px;
    width: 4px;
    left: 2px;
    border: none;
    background: rgba(0,0,0,0.7);
    opacity: 0.5;
    transition: opacity var(--shortAnimationTime) linear;
}
.clipResize:hover{
    opacity: 1;
}
.clipResize:before{
    background-color: black;
}
.clipResize.end{
    right: 2px;
    left: auto;
}

.clipFade{
    pointer-events: none;
    position: absolute;
    top:0;
    bottom: 0;
    width: 1px;
    overflow: visible;
    transition: background var(--shortAnimationTime) linear;
    background: linear-gradient(90deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0) 100%);
}
.clipFade:hover{
    background: linear-gradient(90deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
}
.clipFade .durationText{
    text-shadow: 0 0 5px black, 0 0 5px black;
    transition: opacity var(--shortAnimationTime) linear;
    color: white;
    opacity: 0;
    position: absolute;
    transform-origin: 25% 60%;
    transform: rotate(90deg);
}
.clipFade:hover .durationText{
    opacity: 1;
}

.clipFade.out{
    right: 0;
    background: linear-gradient(270deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0) 100%);
}
.clipFade.out:hover{
    background: linear-gradient(270deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
}
.clipFade.out .durationText{
    transform-origin: 40% 85%;
    right: 0;
}

.fadeHandle{
    opacity: 0.5;
    transition: opacity var(--shortAnimationTime) linear;
    height: 20px;
    pointer-events: all;
}
.clipFade:hover .fadeHandle{
    opacity: 1;
}

.clipFade.in .fadeHandle{
    left: calc(100% + 2px);
}

.clipFade.out .fadeHandle{
    right: calc(100% + 2px);
}