import styled from 'styled-components';

import { Colors, Sizes } from '../index';

const Hiperlink = styled.a<{isType?: string; isActiveRoute: boolean; }>`
  font-family: "sentico-sans-medium";
	-webkit-font-smoothing: antialiased;
	transition: all 0.15s ease-in-out;
  display: inline-block;
  cursor: pointer;
  text-decoration: none;
  will-change: transform;

  & svg {
    position: relative;
    top: 3px;
    height: 16px;
    fill:none;
    stroke: ${Colors.lochmara};
    stroke-miterlimit: 10;
    stroke-width: 2px;
    margin-left: 6px;
  }

  ${({ isType }) => (isType === 'forward' || isType === 'backward') && `
    &:hover {
      .switch-arrow-elements {
        transition: stroke 0.15s ease-in-out, transform 0.15s ease-in-out;
      }

      .switch-arrow-elements.one {
        stroke: ${Colors.line};
        transform: translateX(-1px);
      }

      .switch-arrow-elements.two {
        stroke: ${Colors.regalBlue};
        transform: translateX(5px);
      }
    }
  `}

  ${({ isType }) => isType === 'arrow-plus' && `
    .link-arrow-elements {
      fill: none;
      transition: stroke 0.15s ease-in-out, transform 0.15s ease-in-out;
    }

    &:hover .link-arrow-elements {
      stroke: ${Colors.regalBlue};
      transform: translateX(5px);
    }
  `}

  ${({ isType }) => isType === 'download' && `
    .link-arrow-elements {
      fill: none;
      transition: stroke 0.15s ease-in-out, transform 0.15s ease-in-out;
    }

    &:hover .link-arrow-elements {
      stroke: ${Colors.regalBlue};
      transform: translateX(3px);
    }
  `}

  ${({ isType }) => isType === 'plus' && `
    .plus { transition: stroke 0.15s ease-in-out, transform 0.15s ease-in-out; }
    &:hover .plus { stroke: ${Colors.regalBlue}; }
    &:hover  .plus.tl { transform: translate(8px, 8px); }
    &:hover  .plus.tr { transform: translate(-8px, 8px); }
    &:hover  .plus.bl { transform: translate(8px, -8px); }
    &:hover  .plus.br { transform: translate(-8px, -8px); }
  `}

  ${({ className }) => className !== 'navItem' && `
    color: ${Colors.lochmara};
    text-transform: uppercase;
    &:hover { color: ${Colors.regalBlue}; }
  ` }

  ${({ className }) => className === 'navItem' && `
      color: ${Colors.support};
      display: block;
      margin-bottom: ${Sizes.s4}px;
      text-transform: capitalize;
      font-family: inherit;

      &:hover {
        color: ${Colors.line};
      }
  ` }

  ${({ isActiveRoute }) => isActiveRoute && `
    position: relative;
    font-family: 'sentico-sans-medium';
    &:before {
      content: '';
      position: absolute;
      height: 25px;
      width: 3px;
      left: -${Sizes.s5}px;
      top: -4px;
      background-color: ${Colors.lochmara};
    }
  ` }
`;

export default Hiperlink;
