@import 'styles/Variables.scss';

.wrapper {
  height: 100vh;
  margin: 0 auto;
  flex-basis: 15rem;
  display: flex;
  flex-flow: column nowrap;
}

.pokemonName {
  margin-bottom: 0;
}

.pokemonInfoWrapper,
.leaguePokemonRank {
  display: flex;
  justify-content: space-evenly;
  margin-bottom: 1rem;

  .pokemonInfoLeftColumn,
  .pokemonInfoRightColumn {
    display: flex;
    flex-flow: column nowrap;
    flex-basis: 45%;
    align-items: center;
  }

  .pokemonInfoLeftColumn {
    text-align: center;
  }

  .pokemonInfoRightColumn {
    flex-grow: 1;
    align-items: start;
  }
}

.pokemonTypeWrapper {
  display: flex;
  justify-content: center;
  align-self: stretch;
}

.leaguePokemonRank {
  justify-content: flex-start;
  flex-wrap: wrap;

  .pokemonInfoWraper {
    flex: 1 0 100%;
    display: flex;
  }

  .pokemonInfoLeftColumn {
    align-items: flex-start;
  }

  .pokemonRankValue {
    display: inline;
  }
}

.pokemonType {
  text-transform: uppercase;

  &:global(.nes-container) {
    padding: 0;
    margin-top: 0.5rem;
    font-size: 0.7em;
    flex-basis: 50%;
    margin-bottom: 11px; // default nes.css value is 14px
  }

  // override the default nes.css default, which uses #fff
  @mixin rounded-box-shadow($shadow-color) {
    box-shadow: 0 -4px $shadow-color, 0 -8px, 4px 0 $shadow-color, 4px -4px, 8px 0, 0 4px $shadow-color, 0 8px, -4px 0 $shadow-color, -4px 4px, -8px 0, -4px -4px, 4px 4px;
  }

  @each $type, $colors in $type-colors {
    $primary: map-get($colors, 'primary');
    $contrast: map-get($colors, 'contrast');

    &:global(.#{$type}) {
      color: $contrast;
      background-color: $primary;

      &::after {
        @include rounded-box-shadow($primary);
      }
    }
  }
}

.dexHeader {
  margin-bottom: 0.25rem;
}

.formHeader {
  text-transform: uppercase;
  margin-bottom: 0;
}

.pokemonBaseStats {
  display: flex;
  flex-flow: column nowrap;
  align-items: start;
  align-self: stretch;
}

:global(.nes-field.is-inline) .ivInput {
  width: 4.25em;
  padding-left: 0.7em;
  padding-right: 0.5em;

  &.levelInput {
    width: 6.5em;
  }
}

:global(.nes-field.is-inline).fieldRow {
  justify-content: space-between;

  label {
    flex-grow: 0;
    margin-left: 1em;

    &:first-child {
      margin-left: 0;
    }
  }
}
