/*********************************************************
* TRAY TIMELINE
*/
@_trackEventHeight: 27px;
@_trackHeight: @_trackEventHeight + 3;
@_mediaContainerHeight: 140px;
@_trackContainerSpacing: 0;
@_trackHandleWidth: 129px;

@_trackEventColor: #FFF;

// Main timeline section
.butter-timeline-area {
  position: absolute;
  left: 0;
  border-top: 1px solid @baseLightOutline;
}

// butter-timeline-area-inner
.butter-timeline {
  position: absolute;
  top: 0;
  left: 0;
  right: @_timebarRight;
  z-index: @TRAY_Z_INDEX + 1;
}
// inside .butter-timeline
.media-instance {
  height: 100%;
  padding-left: @_trackHandleWidth;
  position: relative;
  .selectable( none );
  .transition( top 0.5s );
  .butter-scroll-bar-v {
    right: -18px;
    width: 10px;
    height: 100%;
    top: 0;
  }
  .butter-scroll-bar-h {
    right: -5px;
    height: 10px;
    width: 100%;
    top: 0;
    visibility: hidden;
    opacity: 0;
  }
}

//inside .media-instance
.media-container {
  position: relative;
  top: @_trackContainerSpacing;
  height: @_mediaContainerHeight;
}

.tracks-container-wrapper {
  background: @baseLight;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-left: 1px solid @baseLightOutline;
  border-right: 1px solid @baseLightOutline;
  box-shadow: inset 0 0 5px 0 rgba( 0, 0, 0, 0.2 );
}

.tracks-container {
  padding-bottom: @_trackHeight;  //must have padding to account for add popcorn button
  position: relative;
  overflow: hidden;
}

/*********************************************************
* Track
*/
.butter-track {
  width: 100%;
  height: @_trackHeight;
  position: relative;
  border-bottom: 1px dashed @baseLightOutline;

  .track-title {
    display: inline-block;
    position: absolute;
    left: 5px;
    top: 50%;
  }
  &.draggable-hover {
    //box-shadow: inset 0 0 0 2px @green;
    background: fade( #FFF, 80% );
  }

  &.butter-track-ghost {
    opacity: 0.7;
  }
}

/*********************************************************
* Track Event
*/
.butter-track-event {
  .selectable( none );
  background: @_trackEventColor;
  box-shadow: 1px 5px 2px -3px rgba( 0, 0, 0, 0.1 );
  border: 1px solid #CCC;
  border-radius: 4px;
  border-top-color: #E3E3E3;
  border-bottom-color: #BDBDBD;
  cursor: move;
  display: block;
  height: @_trackEventHeight;
  padding: 1px 0;
  position: absolute;
  overflow: hidden;

  &[selected="true"] {
    border-color: @green;
    box-shadow: 1px 5px 2px -3px rgba( 0, 0, 0, 0.2 );
  }

  .butter-track-event-info {
    position: relative;
    width: 100%;
    overflow: hidden;
    height: 100%;
  }

  .title {
    font-size: 11px;
    font-weight: 700;
    text-align: left;
    position: absolute;
    left: 35px;
    line-height: 25px;
    color: @baseText;
  }
  .butter-track-event-icon {
    position: absolute;
    height: 25px;
    width: 30px;
    background-size: 20px;
    background-image: url( "../resources/icons/default-icon.png" );
    background-position: center center;
    background-repeat: no-repeat;
  }
  .handle {
    position: absolute;
    height: 18px;
    width: 18px;
    top: 5px;
    opacity: 0;
    background: @_trackEventColor;
    .transition( all 0.1s ease );
    &:after {
      content: "";
      position: absolute;
      display: inline-block;
      background-image: url( "../resources/icons/glyphiconshalflings-green.png" );
      width: 14px;
      height: 14px;
      top: 2px;
    }
  }
 .left-handle {
    left: 10px;
    cursor: w-resize;
    cursor: ew-resize;
    &:after {
      background-position: -240px -96px;
      left: 2px;
    }
  }
  .right-handle {
    right: 10px;
    cursor: e-resize;
    cursor: ew-resize;
    &:after {
      background-position: -264px -96px;
      right: 2px;
    }
  }

  &:hover,
  &.butter-resizable {
    .handle {
      opacity: 0.7;
    }
    .left-handle {
      left: 0;
    }
    .right-handle {
      right: 0;
    }
  }

  &.trackevent-small {
    overflow: visible;
    .handle {
      background: none;
    }
    .butter-track-event-info {
      left: 0;
    }
    .left-handle {
      left: -16px;
      &:after {
        left: -2px;
      }
    }
    .right-handle {
      right: -16px;
      &:after {
        right: -2px;
      }
    }
  }

  &.trackevent-dragging {
    overflow: hidden;
  }

  &.butter-track-event-ghost {
    opacity: 0.7;
  }
}

.butter-track-event[data-butter-trackevent-type="sequencer"] {
  background: #424242;
  border: 1px solid #424242;
  border-bottom-color: lighten( #424242, 7% );
  .title {
    font-weight: normal;
    color: #FFF;
    .sequencer-audio&:before,
    .sequencer-video&:before {
      text-transform: uppercase;
      margin-right: 5px;
      font-weight: 700;
      font-size: 0.9em;
    }
    .sequencer-audio&:before {
      content: "audio";
    }
    .sequencer-video&:before {
      content: "video";
    }
  }
  &[selected="true"] {
    border-color: @green;
    box-shadow: 1px 5px 2px -3px rgba( 0, 0, 0, 0.2 );
  }
  .butter-track-event-icon {
    background-image: url( ../resources/icons/media-white.png ) !important;
  }
  .handle {
    background: #424242;
  }
}

/*********************************************************
* Track Handle Container - Left-hand side panel
*/

.track-handle-container {
  position: absolute;
  width: @_trackHandleWidth;
  height: @_mediaContainerHeight;
  left: 0;
  top: @_trackContainerSpacing;
  bottom: 1px;
  border-bottom: 1px solid lighten( @baseLightOutline, 5% );
  overflow: hidden;
  background: @baseLight;
}

.handle-list {
  position: relative;
  padding-bottom: @_trackHeight;
}

.track-handle {
  border: none;
  border-bottom: 1px solid darken( @baseLight, 25% );
  cursor: pointer;
  width: 100%;
  height: @_trackHeight;
  background: @baseLight;
  position: relative;
  line-height: @_trackHeight;
  overflow: hidden;
  box-shadow: inset 0 1px #FFF;
  .title {
    padding-left: 22px;
    font-size: 11px;
    color: @baseText;
  }
  &:first-of-type {
    box-shadow: none;
  }

  .menu {
    position: absolute;
    width: 0;
    height: 100%;
    top: 0;
    left: 0;
    .transition( width 0.1s );
    opacity: 0.3;
    &:hover {
      opacity: 1;
    }
    .delete {
      position: absolute;
      right: 0;
      top: 8px;
      background-image: url( "../resources/icons/glyphiconshalflings-alt.png" );
      background-position: -456px 0;
      cursor: pointer;
      width: 14px;
      height: 14px;
    }
  }
  &:hover .menu {
    width: 15px;
  }
  &:hover .track-handle-icon {
    border-color: #000;
    &:after {
      border-bottom-color: #000;
    }
  }
}

.track-handle-icon {
  border: 0 solid darken( @baseLightOutline, 10% );
  box-shadow: inset 0 1px 0 #FFF, 0 1px 0 #FFF;
  position: absolute;
  top: 9px;
  right: 10px;
  display: inline-block;
  width: 14px;
  height: 9px;
  border-top-width: 1px;
  border-bottom-width: 1px;
  &:after {
    box-shadow: 0 1px 0 #FFF;
    border-bottom: 1px solid darken( @baseLightOutline, 10% );
    content: " ";
    position: absolute;
    display: block;
    top: 4px;
    width: 100%;
  }
}

.add-track {
  padding: 0;
  font-size: 11px;
  position: absolute;
  right: 9px;
  width: 20px;
  font-weight: 700;
  margin-left: 10px;
  margin-top: 14px; // This is a crappy work-around because the height of this is getting set in javascript
  line-height: 20px;
}

// Drag and dropping track handles
.placeholder {
  width: 95px;
  box-shadow: inset 0 1px 0 #999, 0 0 1px #AAA;
  background: transparent;
}
