@import '../styles/vars';
$panel-width: 360px;

:host {
  display: block;
  position: relative;
  height: 100%;

  .art {
    display: flex;
    flex-direction: column;
    width: calc(100vw - 360px);
    height: 100%;
    min-height: 100%;
    overflow: hidden;
    transition: opacity 500ms ease-in-out 0s;
    opacity: 1;
    position: relative;

    .empty {
      display: flex;
      flex-direction: column;
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
      align-items: center;
      justify-content: center;
      background: #453358;
      padding-left: 40px;
      padding-right: 40px;
      text-align: center;
      font-family: lato, sans-serif;
      font-weight: 400;
      font-style: normal;

      svg {
        width: 50px;
        height: 50px;
        margin-bottom: 14px;
        fill: #FFFFFF;
      }

      .label {
        font-size: 2.4rem;
        color: #FFFFFF;
        margin-bottom: 300px;
      }
    }
  }

  .options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: absolute;
    bottom: 20px;
    left: calc(50% - 430px);
    height: 74px;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(6px);
    border-radius: 8px;
    min-width: 500px;
    z-index: 1;
    box-shadow: $box-shadow-strong;

    button.generate {
      display: flex;
      align-items: center;
      justify-content: center;
      height: 50px;
      font-size: 1.6rem;
      border-radius: 6px;
      font-family: 'Press Start 2P', sans-serif;
      color: #FFFFFF;
      background: #555555;
      font-weight: 500;
      box-shadow: 0 1px 2px rgba(0, 0, 0, .125), 0 2px 4px rgba(0, 0, 0, .125), 0 4px 8px rgba(0, 0, 0, .125), 0 8px 16px rgba(0, 0, 0, .125);
      text-shadow: 0 1px rgba(0, 0, 0, 0.14);
      transition: $transition-normal;
      letter-spacing: 1px;
      padding-left: 30px;
      padding-right: 30px;

      &:hover {
        transition: $transition-normal;
        background: lighten(#555555, 10%);
      }

      &:active {
        background: lighten(#555555, 10%);
      }
    }

    .download {
      display: flex;
      align-items: center;

      .download-icon {
        margin-right: 14px;

        svg {
          width: 18px;
          height: 18px;
          fill: #888888;
        }
      }

      button.save {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        box-shadow: 0 1px 2px rgba(0, 0, 0, .125), 0 2px 4px rgba(0, 0, 0, .125), 0 4px 8px rgba(0, 0, 0, .125), 0 8px 16px rgba(0, 0, 0, .125);
        background: #555555;
        transition: $transition-normal;

        + .save {
          margin-left: 10px;
        }

        &:hover, &:active {
          background: lighten(#555555, 10%);
          transition: $transition-normal;
        }

        svg {
          fill: #FFFFFF;
          width: 32px;
          min-width: 32px;
        }
      }
    }
  }

  &.is-vertical {
    .art {
      flex-direction: row;
    }
  }

  .panel {
    position: absolute;
    display: flex;
    flex-direction: column;
    top: 0;
    right: 0;
    bottom: 0;
    width: $panel-width;
    box-shadow: $box-shadow-strong;
    color: #333333;
    background: #F5F5F5;

    .panel-wrapper {
      display: flex;
      flex-direction: column;
      flex-grow: 1;
      min-height: 0;
    }

    .title {
      font-size: 5.4rem;
      line-height: 1.3;
      color: #333333;
      margin-bottom: 20px;
      font-family: rucksack, sans-serif;
      font-weight: 700;
      font-style: normal;
    }

    .gradient-wrapper {
      margin: 30px 20px 0px 19px;
      padding-bottom: 30px;
      padding-left: 10px;
      padding-right: 10px;
      border-bottom: 1px solid #ddd;

      .colors {
        display: flex;
        flex-wrap: wrap;
        margin-left: -10px;
        position: relative;

        app-color-picker {
          margin-top: 10px;
          margin-left: 10px;
        }

        .new-color-wrapper {
          display: flex;
          align-items: center;
          justify-content: center;
          width: 50px;
          height: 50px;
          margin-top: 10px;
          margin-left: 10px;

          button.new-color {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            transition: $transition-normal;
            background: transparent;

            &:hover {
              transition: $transition-normal;
              background: rgba(0, 0, 0, 0.08);

              svg {
                transition: $transition-normal;
                fill: #666666;
              }
            }

            svg {
              width: 18px;
              height: 18px;
              min-width: 18px;
              transition: $transition-normal;
              fill: #999999;
            }
          }
        }
      }

      .preview {
        display: flex;
        height: 10px;
        margin-top: 14px;
        border-radius: 3px;
      }

      .about-button {
        position: absolute;
        top: 10px;
        right: 10px;
        color: #999999;
        transition: $transition-normal;
        background: transparent;

        &:hover {
          transition: $transition-normal;
          color: #ff4081;
        }
      }
    }

    .controls {
      flex-grow: 1;
      overflow: auto;
      min-height: 0;
      padding-top: 16px;
      padding-bottom: 30px;
      padding-left: 30px;
      padding-right: 30px;

      .sample-gradients {
        display: flex;
        flex-wrap: wrap;
        margin-top: 10px;
        margin-left: -4px;
        margin-bottom: 20px;

        .gradient {
          display: flex;
          height: 40px;
          width: 100%;
          max-width: 140px;
          margin-top: 4px;
          margin-left: 4px;
          border-radius: 4px;
          position: relative;
          transition: $transition-normal;

          &:after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            bottom: 0;
            background: rgba(255, 255, 255, 0.2);
            transition: $transition-normal;
            z-index: 100;
            width: 100%;
            opacity: 0;
          }

          &:hover {
            transition: $transition-normal;
            cursor: pointer;

            &:after {
              opacity: 1;
            }
          }
        }
      }

      .input-wrapper {
        display: flex;
        flex-direction: column;

        + .input-wrapper {
          margin-top: 10px;
        }

        .label {
          font-family: lato, sans-serif;
          font-weight: 400;
          font-style: normal;
          color: #666666;
          font-size: 1.6rem;
        }

        mat-radio-group {
          margin-top: 10px;
          margin-bottom: 20px;

          mat-radio-button {
            ::ng-deep {
              font-size: 1.6rem;
              font-family: lato, sans-serif;
              font-weight: 400;
              font-style: normal;
            }

            + mat-radio-button {
              margin-left: 20px;
            }
          }
        }

        mat-slider {
          padding: 0;

          ::ng-deep {
            .mat-slider-wrapper {
              left: 0;
              right: 0;
            }
          }
        }
      }
    }
  }

  .project-link {
    height: 30px;
    display: flex;
    align-items: center;
    color: #ef4e7b;
    font-family: lato, sans-serif;
    font-weight: 400;
    font-size: 1.6rem;
    text-decoration: none;
    padding-right: 10px;
    transition: $transition-normal;

    &:hover {
      color: darken(#ef4e7b, 10%);
    }

    img {
      width: 18px;
      min-width: 18px;
      height: 18px;
      margin-right: 8px;
    }
  }

  &.is-generating {
    .art {
      opacity: 0.60;
      transition: opacity 600ms ease-in-out 0s;

      .line {
        transition: $transition-slow;
      }
    }
  }

  @media screen and (max-width: $breakpoint-tablet) {
    .art {
      display: flex;
      flex-direction: column;
      width: 100%;
    }

    .panel {
      position: relative;
      width: 100%;
    }

    .options {
      left: 20px;
      right: 20px;
      min-width: unset;
    }
  }

  @media screen and (max-width: $breakpoint-mobile) {
    .options {
      height: 50px;
      background: none;
      box-shadow: none;
      padding: 0;
      backdrop-filter: none;

      button.generate {
        width: 100%;
      }

      .download-icon {
        display: none;
      }

      .download {
        button.save {
          display: none;
        }
      }
    }

    .panel {
      .gradient-wrapper {
        padding: 24px;
      }

      .controls {
        padding-left: 24px;
        padding-right: 24px;
        padding-bottom: 60px;
      }
    }

    .art {
      .empty {
        .label {
          margin-bottom: 100px;
        }
      }
    }
  }

  &.is-about-visible {
    .panel {
      .gradient-wrapper {
        .about-section {
          position: absolute;
          top: 40px;
          right: 14px;
          padding: 20px;
          box-shadow: $box-shadow-strong;
          border-radius: 8px;
          background: white;
          width: 280px;
          display: flex;
          flex-direction: column;
          z-index: 100;
          font-family: lato, sans-serif;
          font-weight: 400;
          font-style: normal;
          color: #333333;
          font-size: 1.6rem;

          div + div {
            margin-top: 20px;
          }

          a {
            text-decoration: none;
            color: #ef4e7b;
            transition: $transition-normal;
        
            &:hover {
              color: darken(#ef4e7b, 10%);
            }
          }

          .github {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 20px;
            height: 20px;
            background: transparent;
            padding: 0;
            z-index: 1000;
  
            svg {
              width: 18px;
              height: 18px;
              transition: $transition-normal;
              fill: #333333;
            }
  
            &:hover {
              svg {
                fill: #ef4e7b;
                transition: $transition-normal;
              }
            }
          }
        }
      }
    }
  }
}
