@import 'colors';
@import 'fonts';
@import 'mixins';

#editor {

  main {
    background-color: $sand;
    overflow: hidden;

    > svg {
      display: block;
      @include no-select;
      cursor: cell;

      &.mode-m {
        cursor: move;
      }
    }
  }

  aside.context {
    top: 16px * 2 + 36px;
  }

  .appbar {
    .edit-name {
      flex: 1;
      height: 36px;
      margin: 8px;
      margin-right: 0;
      padding: 8px;
      font-size: 21px;
      background-color: transparent;
      color: #ddd;
      border: none;
      outline: none;

      &:hover {
        background-color: lighten($charcoal, 4%);
      }

      &:focus {
        background-color: lighten($charcoal, 8%);
      }
    }

    .actions {
      padding: 8px;
    }
  }

  .surface-modes {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 2;
    display: flex;
    @include shadow-light;

    &:hover {
      @include shadow-medium;
    }

    a {
      display: block;
      color: $mediumGrey;
      padding: 0 16px 0 8px;
      line-height: 36px;
      vertical-align: middle;
      background-color: lighten($charcoal, 8%);
      transition: bezier(background-color), bezier(color);

      &:first-child {
        border-top-left-radius: 2px;
        border-bottom-left-radius: 2px;
      }

      &:last-child {
        border-top-right-radius: 2px;
        border-bottom-right-radius: 2px;
      }

      .surface-icon {
        display: inline-block;
        width: 18px;
        height: 18px;
        margin-right: 8px;
        margin-top: 4px;
        vertical-align: top;
      }

      i {
        font-size: 18px;
      }


      &:hover {
        color: $white;
        background-color: lighten($charcoal, 12%);
      }

      &.current, &.current:hover {
        color: $whiteSmoke;
        background-color: darken($charcoal, 8%);
        @include shadow-inset-light;
      }
    }
  }

  aside.context {
    max-height: calc(100% - 16px * 2 - 52px);

    display: flex;
    flex-direction: column;

    .tab-body {
      flex: 1;
      overflow: scroll;
    }

    .list-gates {
      margin-top: 16px;

      .gate {
        position: relative;
        cursor: pointer;
        padding: 0 24px;

        &.selected, &.selected:hover {
          background-color: #F3F3F3;

          .name {
            color: $seaBlue;
          }

          .remove-gate {
            visibility: visible;
          }
        }

        &:hover {
          background-color: $whiteSmoke;
        }

        .gate-header {
          display: flex;
          margin: 0;
          padding-top: 8px;
        }

        .name, .orientation {
          vertical-align: bottom;
        }

        .name {
          flex: 1;
          margin-top: 2px;
          line-height: 30px;
          font-size: 16px;
          font-weight: bold;
          color: $darkGrey;
        }

        .orientations {
          padding: 4px;
        }

        .orientation {
          display: inline-block;
          cursor: pointer;
          height: 24px;
          width: 24px;
          text-align: center;
          /* border-radius: 12px; */
          overflow: hidden;
          color: $mediumGrey;

          i {
            font-size: 18px;
            line-height: 24px;
          }

          &.current, &.current:hover {
            background-color: #eee;
            color: $charcoal;
          }

          &:hover {
            background-color: $whiteSeaBlue;
            color: $mainBlue;
          }

          & + .orientation {
            margin-left: 4px;
          }
        }

        .gate-fields {
          /* clear: both; */
        }

        .remove-gate {
          visibility: hidden;
          position: absolute;
          z-index: 3;
          bottom: -20px;
          left: 0;
          right: 0;
          margin: 0 auto;
          background-color: white;
        }
      }
    }

    .add-gate {
      margin: -20px 16px 24px 16px;
      float: right;
      @include clearfix;
    }


    .wind-fields {
      padding: 24px;

      .form-row .form-group {
        margin-bottom: 8px;
      }
    }

    .gusts-fields {
      padding: 24px;
    }

    .wind-graph {
      margin: 0 24px;

      h3 {
        margin: 0;
        line-height: 24px;
      }
      .wind-sim-duration {
        span {
          display: inline-block;
          margin-left: 4px;
          cursor: pointer;
          padding: 0 8px;
          line-height: 24px;
          color: $mediumGrey;

          &:hover {
            color: $mainBlue;
            background-color: $whiteSeaBlue;
          }

          &.selected {
            color: $darkGrey;
            background-color: #eee;
          }
        }
      }

      svg {
        margin-top: 8px;
        background-color: $whiteSmoke;
        border: 1px solid $lightGrey;

        text {
          fill: $mediumGrey;
        }
      }

      .curve {
        stroke: $darkGrey;
        fill: transparent;
      }

      .origin-axis {
        stroke: $lightGrey;
      }

      .time-marks line {
        stroke: $lightGrey;
      }
    }
  }

  @media screen and (max-width: $break-tablet) {
    .surface-modes {
      a {
        padding: 0 8px;

        .surface-icon {
          margin-right: 0;
        }

        .surface-label {
          display: none;
        }
      }
    }
  }
}

