@use "../variables" as *;

.headerContainer {
  z-index: 999;
  width: 100%;
  background-color: $headerContBg;
  color: $headerContColor;
  font-family: "Arial", sans-serif;

  .container {
    width: $containerWidth;
    max-width: 70%;
    margin: 0 auto;
    padding: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;

    @media (max-width: 1550px) {
      max-width: 90%;
    }
  }

  .logoAndNavigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .logo {
    text-align: left;

    img {
      height: 80px;
      max-width: 100%;
      width: auto;
      transition: height 0.3s ease;

      @media (max-width: 1024px) {
        height: 70px;
      }
      @media (max-width: 768px) {
        height: 60px;
      }
      @media (max-width: 480px) {
        height: 50px;
      }
      @media (max-width: 360px) {
        height: 40px;
      }
    }
  }

  .navLinks {
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateX(-65px);

    ul {
      display: flex;
      gap: 3rem;
      list-style: none;
      padding: 0;
      margin: 0;

      li {
        position: relative;

        a {
          color: $headerNavLinkLinkColor;
          text-decoration: none;
          font-size: 1rem;
          font-weight: bold;
          transition: color 0.3s ease;
          display: flex;
          align-items: center;

          &:hover {
            color: $headerNavLinkLinkHoverColor;
          }
        }

        &.corporateMenu {
          position: relative;

          .dropdownIcon {
            font-size: 0.8rem;
            margin-left: 4px;
            display: inline-block;
            transform: rotate(270deg);
            transition: transform 0.3s ease;
          }

          .subMenu {
            position: absolute;
            top: 100%;
            left: 50%;
            transform: translateX(-50%) translateY(5px);
            background-color: $headerNavLinkSubMenuBg;
            box-shadow: 0 4px 8px $headerNavLinkSubMenuShadow;
            padding: 1rem;
            border-radius: 8px;
            min-width: 150px;
            z-index: 1000;
            visibility: hidden;
            opacity: 0;
            transition: visibility 0s linear 0.3s, opacity 0.3s ease,
              transform 0.3s ease;
            flex-direction: column;
            gap: 0.5rem;
            text-align: center;

            li a {
              color: $headerNavLinkSubMenuLinkColor;
              font-size: 0.875rem;
              white-space: nowrap;
              transition: color 0.3s ease;
              justify-content: center;

              &:hover {
                color: $headerNavLinkSubMenuLinkHoverColor;
              }
            }
          }

          &:hover {
            .subMenu {
              visibility: visible;
              opacity: 1;
              transform: translateX(-50%) translateY(0);
            }
            .dropdownIcon {
              transform: rotate(360deg);
            }
          }
        }
      }
    }

    @media (max-width: 1550px) {
      display: none;
    }
  }

  .menuButton {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: $headerIconLinkButtonColor;
    cursor: pointer;
    transition: color 0.3s ease;

    &:hover {
      color: $headerIconLinkButtonHoverColor;
    }

    @media (max-width: 1550px) {
      display: block;
    }
  }

  .iconLinks {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;

    .iconButton {
      background: transparent;
      border: none;
      color: $headerIconLinkButtonColor;
      font-size: 1.2rem;
      cursor: pointer;
      transition: color 0.3s ease;

      &:hover {
        color: $headerIconLinkButtonHoverColor;
      }
    }
  }

  .sideMenu {
    display: flex;
    position: fixed;
    right: 0;
    top: 0;
    height: 100%;
    width: 60%;
    background-color: $headerContBg;
    z-index: 9999;
    backdrop-filter: blur(10px);
    color: $headerContColor;
    padding: 2rem;
    text-align: center;
    flex-direction: column;
    gap: 7vh;
    transform: translateX(100%);
    transition: transform 0.3s ease;

    .logo {
      display: flex;
      justify-content: center;
      align-items: center;
      margin-bottom: 2rem;

      img {
        height: 80px;
        max-width: 100%;
        width: auto;
        transition: height 0.3s ease;

        @media (max-width: 1024px) {
          height: 70px;
        }
        @media (max-width: 768px) {
          height: 60px;
        }
        @media (max-width: 480px) {
          height: 50px;
        }
        @media (max-width: 360px) {
          height: 40px;
        }
      }
    }

    &.open {
      transform: translateX(0);
    }

    a {
      color: $headerNavLinkLinkColor;
      font-size: 1.2rem;
      font-weight: bold;
      text-decoration: none;
      cursor: pointer;
      transition: color 0.3s ease;
      display: flex;
      align-items: center;
      justify-content: center;

      @media (max-width: 768px) {
        font-size: 1rem;
      }

      &:hover {
        color: $headerNavLinkLinkHoverColor;
      }
    }

    .sideCorporateMenu {
      position: relative;
      display: flex;
      flex-direction: column;
      gap: 1rem;
      align-items: center;

      .dropdownIcon {
        font-size: 0.8rem;
        margin-left: 8px;
        display: inline-block;
        transform: rotate(270deg);
        transition: transform 0.3s ease;

        &.rotate {
          transform: rotate(360deg);
        }
      }

      .subMenu {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: all 0.3s ease;
        width: 100%;
        text-align: center;
        padding-left: 0;

        a {
          width: 100%;
          padding: 0.5rem;
          font-size: 0.85rem;
          color: $headerNavLinkSubMenuLinkColor;
          text-decoration: none;
          transition: color 0.3s ease;
          justify-content: center;

          &:hover {
            color: $headerNavLinkLinkHoverColor;
          }

          @media (max-width: 768px) {
            font-size: 0.85rem;
          }
        }
      }

      &.open {
        .subMenu {
          max-height: 500px;
          opacity: 1;
          margin-top: 1rem;
        }
      }
    }

    .closeButton {
      align-self: center;
      background: transparent;
      border: none;
      color: $headerIconLinkButtonColor;
      font-size: 1.5rem;
      cursor: pointer;
      transition: color 0.3s ease;

      &:hover {
        color: $headerIconLinkButtonHoverColor;
      }
    }

    @media (max-width: 768px) {
      width: 75%;
      padding: 1.5rem;
      gap: 5vh;
    }

    @media (max-width: 480px) {
      width: 85%;
      padding: 1rem;
    }
  }
}
