@import 'src/styles/vars';

@mixin opacity-hover {
  position: absolute;
  content: '';
  z-index: 2;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: rgba(255, 255, 255, 0);
  transition: background 0.7s $ease 0s;
}

:host {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
  padding-left: 20px;
  padding-right: 20px;

  nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    max-width: 1200px;

    .filters {
      display: flex;
      align-items: center;
      margin-right: 20px;

      .label {
        margin-right: 10px;
        color: $grey;
      }

      .filters-wrapper {
        display: flex;
        align-items: center;
        height: 32px;
        position: relative;
        border-radius: 5px;
        overflow: hidden;

        button.color {
          width: 20px;
          height: 100%;
          transition: $transition-normal;
          position: relative;

          &::after {
            @include opacity-hover;
          }

          &:hover, &:focus {
            &::after {
              background: rgba(255, 255, 255, 0.30);
              transition: background 700ms $ease 0s;
            }
          }
        }

        button.clear-filter {
          display: flex;
          align-items: center;
          justify-content: center;
          position: absolute;
          left: 0;
          right: 0;
          bottom: 0;
          width: 100%;
          height: 100%;
          z-index: 10;

          &::after {
            @include opacity-hover;
          }

          &:hover, &:focus {
            &::after {
              background: rgba(255, 255, 255, 0.30);
              transition: background 700ms $ease 0s;
            }
          }

          svg {
            width: 20px;
            height: 20px;
            fill: $white;
          }
        }
      }
    }

    .about {
      color: $oil;
      font-size: 1.6rem;
      font-weight: $regular;
      transition: border 350ms $ease 0s;
      display: flex;
      align-items: center;
      justify-content: center;
      height: 46px;
      padding-left: 20px;
      padding-right: 20px;
      border: 1px solid #CCCCCC;
      border-radius: 5px;
      background-color: $white;

      &:hover, &:focus {
        border: 1px solid $grey;
      }
    }
  }

  header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 30px;

    .site-name {
      h1 {
        transition: color 350ms $ease 0s;
      }

      &:hover {
        h1 {
          color: $pink;
        }
      }
    }

    h2.description {
      position: relative;
      text-align: center;

      &::after {
        position: absolute;
        content: '';
        bottom: -14px;
        left: 0;
        right: 0;
        height: 4px;
        border-radius: 3px;
        background: linear-gradient(to right, rgb(255, 68, 68), rgb(255, 152, 60), rgb(255, 233, 56), rgb(93, 255, 58), rgb(59, 254, 255), rgb(58, 187, 255), rgb(168, 55, 255), rgb(255, 62, 250));
        transition: background 350ms $ease 0s;
      }

      &.red {
        &::after {
          background: #e83a30;
        }
      }

      &.orange {
        &::after {
          background: #e88c30;
        }
      }

      &.yellow {
        &::after {
          background: #e8e230;
        }
      }

      &.green {
        &::after {
          background: #3ab650;
        }
      }

      &.teal {
        &::after {
          background: #3bdeb8;
        }
      }

      &.blue {
        &::after {
          background: #3080e8;
        }
      }

      &.purple {
        &::after {
          background: #8a3cdd;
        }
      }

      &.pink {
        &::after {
          background: #e830c7;
        }
      }
    }
  }

  @media screen and (max-width: $breakpoint-medium) {
    nav {
      width: 100%;

      .filters {
        width: 100%;
        margin-right: 0;

        .filters-wrapper {
          width: 100%;
        }

        .color {
          display: flex;
          flex-grow: 1;
        }
      }

      .about {
        display: none;
      }
    }

    header {
      margin-top: 40px;
    }
  }
}
